UHD 003.000.001
|
00001 // 00002 // Copyright 2010 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_USRP_DBOARD_BASE_HPP 00019 #define INCLUDED_UHD_USRP_DBOARD_BASE_HPP 00020 00021 #include <uhd/config.hpp> 00022 #include <uhd/wax.hpp> 00023 #include <uhd/utils/pimpl.hpp> 00024 #include <boost/utility.hpp> 00025 #include <boost/shared_ptr.hpp> 00026 #include <uhd/usrp/dboard_id.hpp> 00027 #include <uhd/usrp/dboard_iface.hpp> 00028 00029 namespace uhd{ namespace usrp{ 00030 00035 class UHD_API dboard_base : boost::noncopyable{ 00036 public: 00037 typedef boost::shared_ptr<dboard_base> sptr; 00043 typedef void * ctor_args_t; 00044 00045 //structors 00046 dboard_base(ctor_args_t); 00047 virtual ~dboard_base(void); 00048 00049 //interface 00050 virtual void rx_get(const wax::obj &key, wax::obj &val) = 0; 00051 virtual void rx_set(const wax::obj &key, const wax::obj &val) = 0; 00052 virtual void tx_get(const wax::obj &key, wax::obj &val) = 0; 00053 virtual void tx_set(const wax::obj &key, const wax::obj &val) = 0; 00054 00055 protected: 00056 std::string get_subdev_name(void); 00057 dboard_iface::sptr get_iface(void); 00058 dboard_id_t get_rx_id(void); 00059 dboard_id_t get_tx_id(void); 00060 00061 private: 00062 UHD_PIMPL_DECL(impl) _impl; 00063 }; 00064 00069 class UHD_API xcvr_dboard_base : public dboard_base{ 00070 public: 00074 xcvr_dboard_base(ctor_args_t); 00075 00076 virtual ~xcvr_dboard_base(void); 00077 }; 00078 00083 class UHD_API rx_dboard_base : public dboard_base{ 00084 public: 00088 rx_dboard_base(ctor_args_t); 00089 00090 virtual ~rx_dboard_base(void); 00091 00092 //override here so the derived classes cannot 00093 void tx_get(const wax::obj &key, wax::obj &val); 00094 void tx_set(const wax::obj &key, const wax::obj &val); 00095 }; 00096 00101 class UHD_API tx_dboard_base : public dboard_base{ 00102 public: 00106 tx_dboard_base(ctor_args_t); 00107 00108 virtual ~tx_dboard_base(void); 00109 00110 //override here so the derived classes cannot 00111 void rx_get(const wax::obj &key, wax::obj &val); 00112 void rx_set(const wax::obj &key, const wax::obj &val); 00113 }; 00114 00115 }} //namespace 00116 00117 #endif /* INCLUDED_UHD_USRP_DBOARD_BASE_HPP */