UHD 003.002.002

include/uhd/convert.hpp

Go to the documentation of this file.
00001 //
00002 // Copyright 2011 Ettus Research LLC
00003 //
00004 // This program is free software: you can redistribute it and/or modify
00005 // it under the terms of the GNU General Public License as published by
00006 // the Free Software Foundation, either version 3 of the License, or
00007 // (at your option) any later version.
00008 //
00009 // This program is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 // GNU General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU General Public License
00015 // along with this program.  If not, see <http://www.gnu.org/licenses/>.
00016 //
00017 
00018 #ifndef INCLUDED_UHD_CONVERT_HPP
00019 #define INCLUDED_UHD_CONVERT_HPP
00020 
00021 #include <uhd/config.hpp>
00022 #include <uhd/types/io_type.hpp>
00023 #include <uhd/types/otw_type.hpp>
00024 #include <uhd/types/ref_vector.hpp>
00025 #include <boost/function.hpp>
00026 #include <string>
00027 
00028 namespace uhd{ namespace convert{
00029 
00030     typedef uhd::ref_vector<void *> output_type;
00031     typedef uhd::ref_vector<const void *> input_type;
00032     typedef boost::function<void(const input_type&, const output_type&, size_t, double)> function_type;
00033 
00041     enum priority_type{
00042         PRIORITY_GENERAL = 0,
00043         PRIORITY_LIBORC = 1,
00044         PRIORITY_CUSTOM = 2,
00045         PRIORITY_EMPTY = -1,
00046     };
00047 
00054     UHD_API void register_converter(
00055         const std::string &markup,
00056         function_type fcn,
00057         priority_type prio
00058     );
00059 
00067     UHD_API const function_type &get_converter_cpu_to_otw(
00068         const io_type_t &io_type,
00069         const otw_type_t &otw_type,
00070         size_t num_input_buffs,
00071         size_t num_output_buffs
00072     );
00073 
00081     UHD_API const function_type &get_converter_otw_to_cpu(
00082         const io_type_t &io_type,
00083         const otw_type_t &otw_type,
00084         size_t num_input_buffs,
00085         size_t num_output_buffs
00086     );
00087 
00088 }} //namespace
00089 
00090 #endif /* INCLUDED_UHD_CONVERT_HPP */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines