USRP Hardware Driver and USRP Manual  Version: 003.010.003.HEAD-0-gef157678
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 // 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/usrp/dboard_base.hpp>
24 #include <uhd/usrp/dboard_id.hpp>
26 #include <boost/utility.hpp>
27 #include <boost/shared_ptr.hpp>
28 #include <string>
29 #include <vector>
30 
31 namespace uhd{ namespace usrp{
32 
38 class UHD_API dboard_manager : boost::noncopyable{
39 public:
40  typedef boost::shared_ptr<dboard_manager> sptr;
41 
42  //dboard constructor (each dboard should have a ::make with this signature)
43  typedef dboard_base::sptr(*dboard_ctor_t)(dboard_base::ctor_args_t);
44 
54  static void register_dboard(
55  const dboard_id_t &dboard_id,
56  dboard_ctor_t db_subdev_ctor,
57  const std::string &name,
58  const std::vector<std::string> &subdev_names = std::vector<std::string>(1, "0"),
59  dboard_ctor_t db_container_ctor = NULL
60  );
61 
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 db_subdev_ctor,
76  const std::string &name,
77  const std::vector<std::string> &subdev_names = std::vector<std::string>(1, "0"),
78  dboard_ctor_t db_container_ctor = NULL
79  );
80 
92  static void register_dboard_restricted(
93  const dboard_id_t &dboard_id,
94  dboard_ctor_t db_subdev_ctor,
95  const std::string &name,
96  const std::vector<std::string> &subdev_names = std::vector<std::string>(1, "0"),
97  dboard_ctor_t db_container_ctor = NULL
98  );
99 
112  static void register_dboard_restricted(
113  const dboard_id_t &rx_dboard_id,
114  const dboard_id_t &tx_dboard_id,
115  dboard_ctor_t db_subdev_ctor,
116  const std::string &name,
117  const std::vector<std::string> &subdev_names = std::vector<std::string>(1, "0"),
118  dboard_ctor_t db_container_ctor = NULL
119  );
120 
131  static sptr make(
132  dboard_id_t rx_dboard_id,
133  dboard_id_t tx_dboard_id,
134  dboard_id_t gdboard_id,
135  dboard_iface::sptr iface,
136  property_tree::sptr subtree,
137  bool defer_db_init = false
138  );
139 
150  static sptr make(
151  dboard_eeprom_t rx_eeprom,
152  dboard_eeprom_t tx_eeprom,
153  dboard_eeprom_t gdb_eeprom,
154  dboard_iface::sptr iface,
155  property_tree::sptr subtree,
156  bool defer_db_init = false
157  );
158 
159  virtual ~dboard_manager() {}
160 
164  virtual void initialize_dboards() = 0;
165 
170  virtual const std::vector<std::string>& get_rx_frontends() const = 0;
171 
176  virtual const std::vector<std::string>& get_tx_frontends() const = 0;
177 };
178 
179 }} //namespace
180 
181 #endif /* INCLUDED_UHD_USRP_DBOARD_MANAGER_HPP */
boost::shared_ptr< dboard_manager > sptr
Definition: dboard_manager.hpp:40
Definition: dboard_id.hpp:28
boost::shared_ptr< property_tree > sptr
Definition: property_tree.hpp:220
Definition: dboard_manager.hpp:38
Definition: build_info.hpp:25
Definition: dboard_eeprom.hpp:28
boost::shared_ptr< dboard_base > sptr
Definition: dboard_base.hpp:38
void * ctor_args_t
Definition: dboard_base.hpp:44
virtual ~dboard_manager()
Definition: dboard_manager.hpp:159
#define UHD_API
Definition: config.h:73
boost::shared_ptr< dboard_iface > sptr
Definition: dboard_iface.hpp:64