UHD  003.003.000
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
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/property_tree.hpp>
23 #include <uhd/utils/props.hpp>
24 #include <uhd/usrp/dboard_base.hpp>
25 #include <uhd/usrp/dboard_id.hpp>
26 #include <boost/utility.hpp>
27 #include <boost/shared_ptr.hpp>
28 
29 namespace uhd{ namespace usrp{
30 
36 class UHD_API dboard_manager : boost::noncopyable{
37 public:
38  typedef boost::shared_ptr<dboard_manager> sptr;
39 
41  static void populate_prop_tree_from_subdev(
42  property_tree::sptr subtree, wax::obj subdev
43  );
44 
45  //dboard constructor (each dboard should have a ::make with this signature)
46  typedef dboard_base::sptr(*dboard_ctor_t)(dboard_base::ctor_args_t);
47 
56  static void register_dboard(
57  const dboard_id_t &dboard_id,
58  dboard_ctor_t dboard_ctor,
59  const std::string &name,
60  const prop_names_t &subdev_names = prop_names_t(1, "0")
61  );
62 
72  static void register_dboard(
73  const dboard_id_t &rx_dboard_id,
74  const dboard_id_t &tx_dboard_id,
75  dboard_ctor_t dboard_ctor,
76  const std::string &name,
77  const prop_names_t &subdev_names = prop_names_t(1, "0")
78  );
79 
87  static sptr make(
88  dboard_id_t rx_dboard_id,
89  dboard_id_t tx_dboard_id,
90  dboard_iface::sptr iface
91  );
92 
93  //dboard manager interface
94  virtual prop_names_t get_rx_subdev_names(void) = 0;
95  virtual prop_names_t get_tx_subdev_names(void) = 0;
96  virtual wax::obj get_rx_subdev(const std::string &subdev_name) = 0;
97  virtual wax::obj get_tx_subdev(const std::string &subdev_name) = 0;
98 };
99 
100 }} //namespace
101 
102 #endif /* INCLUDED_UHD_USRP_DBOARD_MANAGER_HPP */
boost::shared_ptr< dboard_manager > sptr
Definition: dboard_manager.hpp:38
Definition: dboard_id.hpp:28
boost::shared_ptr< property_tree > sptr
Definition: property_tree.hpp:122
Definition: dboard_manager.hpp:36
#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:74
void * ctor_args_t
Definition: dboard_base.hpp:80
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