diff options
author | Josh Blum <josh@joshknows.com> | 2011-10-03 16:46:00 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-11-03 20:37:10 -0700 |
commit | 75b7967fac3ec72fb35c542da23491215d53a8bb (patch) | |
tree | fa588c1e71bb7cbc751d2f5738bb37aad5cfec45 /host/lib/convert/convert_common.hpp | |
parent | c480414fea7948dedd9428f545dfff90f4c8f2c8 (diff) | |
download | uhd-75b7967fac3ec72fb35c542da23491215d53a8bb.tar.gz uhd-75b7967fac3ec72fb35c542da23491215d53a8bb.tar.bz2 uhd-75b7967fac3ec72fb35c542da23491215d53a8bb.zip |
convert: reworked convert to use new identification standard
Diffstat (limited to 'host/lib/convert/convert_common.hpp')
-rw-r--r-- | host/lib/convert/convert_common.hpp | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/host/lib/convert/convert_common.hpp b/host/lib/convert/convert_common.hpp index 7f513b124..8c8cc88b0 100644 --- a/host/lib/convert/convert_common.hpp +++ b/host/lib/convert/convert_common.hpp @@ -23,28 +23,45 @@ #include <boost/cstdint.hpp> #include <complex> -#define DECLARE_CONVERTER(fcn, prio) \ +#define _DECLARE_CONVERTER(fcn, in_mark, num_in, out_mark, num_out, prio) \ static void fcn( \ const uhd::convert::input_type &inputs, \ const uhd::convert::output_type &outputs, \ - size_t nsamps, double scale_factor \ + const size_t nsamps, \ + const double scale_factor \ ); \ - UHD_STATIC_BLOCK(register_##fcn##_##prio){ \ - uhd::convert::register_converter(#fcn, fcn, prio); \ + UHD_STATIC_BLOCK(__register_##fcn##_##prio){ \ + uhd::convert::id_type id; \ + id.input_markup = #in_mark; \ + id.num_inputs = num_in; \ + id.output_markup = #out_mark; \ + id.num_outputs = num_out; \ + uhd::convert::register_converter(id, fcn, prio); \ } \ static void fcn( \ const uhd::convert::input_type &inputs, \ const uhd::convert::output_type &outputs, \ - size_t nsamps, double scale_factor \ + const size_t nsamps, \ + const double scale_factor \ ) +#define DECLARE_CONVERTER(in_mark, num_in, out_mark, num_out, prio) \ + _DECLARE_CONVERTER(__convert_##in_mark##_##num_in##_##out_mark##_##num_out, in_mark, num_in, out_mark, num_out, prio) + /*********************************************************************** * Typedefs **********************************************************************/ typedef std::complex<double> fc64_t; typedef std::complex<float> fc32_t; +typedef std::complex<boost::int32_t> sc32_t; typedef std::complex<boost::int16_t> sc16_t; typedef std::complex<boost::int8_t> sc8_t; +typedef double f64_t; +typedef float f32_t; +typedef boost::int32_t s32_t; +typedef boost::int16_t s16_t; +typedef boost::int8_t s8_t; + typedef boost::uint32_t item32_t; /*********************************************************************** |