USRP Hardware Driver and USRP Manual  Version: 3.11.0.HEAD-0-g13c32cef
UHD and USRP Manual
dboard_manager.hpp
Go to the documentation of this file.
1 //
2 // Copyright 2010,2017 Ettus Research, A National Instruments Company
3 //
4 // SPDX-License-Identifier: GPL-3.0-or-later
5 //
6 
7 #ifndef INCLUDED_UHD_USRP_DBOARD_MANAGER_HPP
8 #define INCLUDED_UHD_USRP_DBOARD_MANAGER_HPP
9 
10 #include <uhd/config.hpp>
11 #include <uhd/property_tree.hpp>
12 #include <uhd/usrp/dboard_base.hpp>
13 #include <uhd/usrp/dboard_id.hpp>
15 #include <boost/utility.hpp>
16 #include <boost/shared_ptr.hpp>
17 #include <string>
18 #include <vector>
19 
20 namespace uhd{ namespace usrp{
21 
27 class UHD_API dboard_manager : boost::noncopyable{
28 public:
29  typedef boost::shared_ptr<dboard_manager> sptr;
30 
31  //dboard constructor (each dboard should have a ::make with this signature)
32  typedef dboard_base::sptr(*dboard_ctor_t)(dboard_base::ctor_args_t);
33 
43  static void register_dboard(
44  const dboard_id_t &dboard_id,
45  dboard_ctor_t db_subdev_ctor,
46  const std::string &name,
47  const std::vector<std::string> &subdev_names = std::vector<std::string>(1, "0"),
48  dboard_ctor_t db_container_ctor = NULL
49  );
50 
61  static void register_dboard(
62  const dboard_id_t &rx_dboard_id,
63  const dboard_id_t &tx_dboard_id,
64  dboard_ctor_t db_subdev_ctor,
65  const std::string &name,
66  const std::vector<std::string> &subdev_names = std::vector<std::string>(1, "0"),
67  dboard_ctor_t db_container_ctor = NULL
68  );
69 
81  static void register_dboard_restricted(
82  const dboard_id_t &dboard_id,
83  dboard_ctor_t db_subdev_ctor,
84  const std::string &name,
85  const std::vector<std::string> &subdev_names = std::vector<std::string>(1, "0"),
86  dboard_ctor_t db_container_ctor = NULL
87  );
88 
101  static void register_dboard_restricted(
102  const dboard_id_t &rx_dboard_id,
103  const dboard_id_t &tx_dboard_id,
104  dboard_ctor_t db_subdev_ctor,
105  const std::string &name,
106  const std::vector<std::string> &subdev_names = std::vector<std::string>(1, "0"),
107  dboard_ctor_t db_container_ctor = NULL
108  );
109 
120  static sptr make(
121  dboard_id_t rx_dboard_id,
122  dboard_id_t tx_dboard_id,
123  dboard_id_t gdboard_id,
124  dboard_iface::sptr iface,
125  property_tree::sptr subtree,
126  bool defer_db_init = false
127  );
128 
139  static sptr make(
140  dboard_eeprom_t rx_eeprom,
141  dboard_eeprom_t tx_eeprom,
142  dboard_eeprom_t gdb_eeprom,
143  dboard_iface::sptr iface,
144  property_tree::sptr subtree,
145  bool defer_db_init = false
146  );
147 
148  virtual ~dboard_manager() {}
149 
153  virtual void initialize_dboards() = 0;
154 
159  virtual const std::vector<std::string>& get_rx_frontends() const = 0;
160 
165  virtual const std::vector<std::string>& get_tx_frontends() const = 0;
166 };
167 
168 }} //namespace
169 
170 #endif /* INCLUDED_UHD_USRP_DBOARD_MANAGER_HPP */
boost::shared_ptr< dboard_manager > sptr
Definition: dboard_manager.hpp:29
Definition: dboard_id.hpp:18
boost::shared_ptr< property_tree > sptr
Definition: property_tree.hpp:210
Definition: dboard_manager.hpp:27
Definition: build_info.hpp:14
Definition: dboard_eeprom.hpp:18
boost::shared_ptr< dboard_base > sptr
Definition: dboard_base.hpp:27
void * ctor_args_t
Definition: dboard_base.hpp:33
virtual ~dboard_manager()
Definition: dboard_manager.hpp:148
#define UHD_API
Definition: config.h:63
boost::shared_ptr< dboard_iface > sptr
Definition: dboard_iface.hpp:54