USRP Hardware Driver and USRP Manual: uhd::convert Namespace Reference

| USRP Hardware Driver and USRP Manual Version: 4.9.0.makepkg-0-g9ec1f582 UHD and USRP Manual |

Loading...
Searching...
No Matches
uhd::convert Namespace Reference

## Classes
class | converter
| A conversion class that implements a conversion from inputs -> outputs. More...
struct | id_type
| Identify a conversion routine in the registry. More...

## Typedefs
typedef std::function< converter::sptr(void)> | function_type
| Conversion factory function typedef.
typedef int | priority_type
| Priority of conversion routines.

## Functions
UHD_API bool | operator== (const id_type &, const id_type &)
| Implement equality_comparable interface.
UHD_API void | register_converter (const id_type &id, const function_type &fcn, const priority_type prio)
UHD_API function_type | get_converter (const id_type &id, const priority_type prio=-1)
UHD_API void | register_bytes_per_item (const std::string &format, const size_t size)
UHD_API size_t | get_bytes_per_item (const std::string &format)
| Convert an item format to a size in bytes.

## Typedef Documentation

## ◆ function_type

typedef std::function<converter::sptr(void)> uhd::convert::function_type

Conversion factory function typedef.

## ◆ priority_type

typedef int uhd::convert::priority_type

Priority of conversion routines.

## Function Documentation

## ◆ get_bytes_per_item()

UHD_API size_t uhd::convert::get_bytes_per_item | ( | const std::string & | format | ) |

Convert an item format to a size in bytes.

## ◆ get_converter()

UHD_API function_type uhd::convert::get_converter | ( | const id_type & | id,
|  | const priority_type | prio = -1 )

Get a converter factory function.

Parameters

  id | identify the conversion
  prio | the desired prio or -1 for best

Returns
  the converter factory function

## ◆ operator==()

UHD_API bool uhd::convert::operator== | ( | const id_type & | ,
|  | const id_type & | )

Implement equality_comparable interface.

## ◆ register_bytes_per_item()

UHD_API void uhd::convert::register_bytes_per_item | ( | const std::string & | format,
|  | const size_t | size )

Register the size of a particular item.

Parameters

  format | the item format
  size | the size in bytes

## ◆ register_converter()

UHD_API void uhd::convert::register_converter | ( | const id_type & | id,
|  | const function_type & | fcn,
|  | const priority_type | prio )

Register a converter function.

Converters with higher priority are given preference.

Parameters

  id | identify the conversion
  fcn | makes a new converter
  prio | the function priority