diff options
author | Josh Blum <josh@joshknows.com> | 2011-10-03 11:35:16 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-11-03 20:37:10 -0700 |
commit | 8c182d75e7adc20ff12cbc1065debd8dd4f2ef9d (patch) | |
tree | 74b7ed55b664a8a1583294d81eef63c071e89b4f /host/lib/deprecated.cpp | |
parent | bf5aba2dc1b32c8eb0d016e98f942fb7119fdfde (diff) | |
download | uhd-8c182d75e7adc20ff12cbc1065debd8dd4f2ef9d.tar.gz uhd-8c182d75e7adc20ff12cbc1065debd8dd4f2ef9d.tar.bz2 uhd-8c182d75e7adc20ff12cbc1065debd8dd4f2ef9d.zip |
uhd: removed unsed interfaces, deprecated otw and io type
Diffstat (limited to 'host/lib/deprecated.cpp')
-rw-r--r-- | host/lib/deprecated.cpp | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/host/lib/deprecated.cpp b/host/lib/deprecated.cpp index eeaba03cb..dd4cc02ad 100644 --- a/host/lib/deprecated.cpp +++ b/host/lib/deprecated.cpp @@ -153,3 +153,53 @@ void wax::obj::get(const obj &, obj &){ void wax::obj::set(const obj &, const obj &){ throw uhd::type_error("Cannot call set on wax obj base class"); } + +#include <uhd/types/otw_type.hpp> +#include <uhd/types/io_type.hpp> +#include <boost/cstdint.hpp> +#include <stdexcept> +#include <complex> +#include <vector> + +using namespace uhd; + +/*********************************************************************** + * otw type + **********************************************************************/ +size_t otw_type_t::get_sample_size(void) const{ + return (this->width * 2) / 8; +} + +otw_type_t::otw_type_t(void): + width(0), + shift(0), + byteorder(BO_NATIVE) +{ + /* NOP */ +} + +/*********************************************************************** + * io type + **********************************************************************/ +static std::vector<size_t> get_tid_size_table(void){ + std::vector<size_t> table(128, 0); + table[size_t(io_type_t::COMPLEX_FLOAT64)] = sizeof(std::complex<double>); + table[size_t(io_type_t::COMPLEX_FLOAT32)] = sizeof(std::complex<float>); + table[size_t(io_type_t::COMPLEX_INT16)] = sizeof(std::complex<boost::int16_t>); + table[size_t(io_type_t::COMPLEX_INT8)] = sizeof(std::complex<boost::int8_t>); + return table; +} + +static const std::vector<size_t> tid_size_table(get_tid_size_table()); + +io_type_t::io_type_t(tid_t tid): + size(tid_size_table[size_t(tid) & 0x7f]), tid(tid) +{ + /* NOP */ +} + +io_type_t::io_type_t(size_t size): + size(size), tid(CUSTOM_TYPE) +{ + /* NOP */ +} |