18 #ifndef INCLUDED_UHD_CONVERT_HPP 19 #define INCLUDED_UHD_CONVERT_HPP 23 #include <boost/shared_ptr.hpp> 24 #include <boost/function.hpp> 25 #include <boost/operators.hpp> 28 namespace uhd{
namespace convert{
33 typedef boost::shared_ptr<converter>
sptr;
43 UHD_INLINE void conv(
const input_type &in,
const output_type &out,
const size_t num){
44 if (num != 0) (*this)(in, out, num);
56 virtual void operator()(
const input_type& in,
const output_type& out,
const size_t num) = 0;
71 std::string to_pp_string(
void)
const;
72 std::string to_string(
void)
const;
89 const function_type &fcn,
90 const priority_type prio
101 const priority_type prio = -1
110 const std::string &format,
const size_t size
UHD_API function_type get_converter(const id_type &id, const priority_type prio=-1)
Identify a conversion routine in the registry.
Definition: convert.hpp:66
UHD_API void register_bytes_per_item(const std::string &format, const size_t size)
boost::function< converter::sptr(void)> function_type
Conversion factory function typedef.
Definition: convert.hpp:60
virtual void set_scalar(const double)=0
Set the scale factor (used in floating point conversions)
UHD_API size_t get_bytes_per_item(const std::string &format)
Convert an item format to a size in bytes.
uhd::ref_vector< const void * > input_type
Definition: convert.hpp:35
UHD_API bool operator==(const id_type &, const id_type &)
Implement equality_comparable interface.
A conversion class that implements a conversion from inputs -> outputs.
Definition: convert.hpp:31
std::string output_format
Definition: convert.hpp:69
Definition: convert.hpp:28
UHD_INLINE void conv(const input_type &in, const output_type &out, const size_t num)
The public conversion method to convert inputs -> outputs.
Definition: convert.hpp:43
Definition: ref_vector.hpp:30
#define UHD_INLINE
Definition: config.h:56
int priority_type
Priority of conversion routines.
Definition: convert.hpp:63
virtual ~converter(void)=0
#define UHD_API
Definition: config.h:66
size_t num_inputs
Definition: convert.hpp:68
UHD_API void register_converter(const id_type &id, const function_type &fcn, const priority_type prio)
uhd::ref_vector< void * > output_type
Definition: convert.hpp:34
size_t num_outputs
Definition: convert.hpp:70
boost::shared_ptr< converter > sptr
Definition: convert.hpp:33
std::string input_format
Definition: convert.hpp:67