UHD  003.001.002
dboard_manager.hpp
Go to the documentation of this file.
1 //
2 // Copyright 2010 Ettus Research LLC
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
16 //
17 
18 #ifndef INCLUDED_UHD_USRP_DBOARD_MANAGER_HPP
19 #define INCLUDED_UHD_USRP_DBOARD_MANAGER_HPP
20 
21 #include <uhd/config.hpp>
22 #include <uhd/utils/props.hpp>
23 #include <uhd/usrp/dboard_base.hpp>
24 #include <uhd/usrp/dboard_id.hpp>
25 #include <boost/utility.hpp>
26 #include <boost/shared_ptr.hpp>
27 
28 namespace uhd{ namespace usrp{
29 
35 class UHD_API dboard_manager : boost::noncopyable{
36 public:
37  typedef boost::shared_ptr<dboard_manager> sptr;
38 
39  //dboard constructor (each dboard should have a ::make with this signature)
40  typedef dboard_base::sptr(*dboard_ctor_t)(dboard_base::ctor_args_t);
41 
50  static void register_dboard(
51  const dboard_id_t &dboard_id,
52  dboard_ctor_t dboard_ctor,
53  const std::string &name,
54  const prop_names_t &subdev_names = prop_names_t(1, "0")
55  );
56 
66  static void register_dboard(
67  const dboard_id_t &rx_dboard_id,
68  const dboard_id_t &tx_dboard_id,
69  dboard_ctor_t dboard_ctor,
70  const std::string &name,
71  const prop_names_t &subdev_names = prop_names_t(1, "0")
72  );
73 
81  static sptr make(
82  dboard_id_t rx_dboard_id,
83  dboard_id_t tx_dboard_id,
84  dboard_iface::sptr iface
85  );
86 
87  //dboard manager interface
88  virtual prop_names_t get_rx_subdev_names(void) = 0;
89  virtual prop_names_t get_tx_subdev_names(void) = 0;
90  virtual wax::obj get_rx_subdev(const std::string &subdev_name) = 0;
91  virtual wax::obj get_tx_subdev(const std::string &subdev_name) = 0;
92 };
93 
94 }} //namespace
95 
96 #endif /* INCLUDED_UHD_USRP_DBOARD_MANAGER_HPP */
boost::shared_ptr< dboard_manager > sptr
Definition: dboard_manager.hpp:37
Definition: dboard_id.hpp:28
Definition: dboard_manager.hpp:35
#define UHD_API
Definition: config.hpp:76
Definition: convert.hpp:28
Definition: wax.hpp:64
boost::shared_ptr< dboard_base > sptr
Definition: dboard_base.hpp:37
void * ctor_args_t
Definition: dboard_base.hpp:43
std::vector< std::string > prop_names_t
The type for a vector of property names.
Definition: props.hpp:30
boost::shared_ptr< dboard_iface > sptr
Definition: dboard_iface.hpp:60