USRP Hardware Driver and USRP Manual  Version: 004.000.000.HEAD-0-g8773fb2c
UHD and USRP Manual
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/usrp/dboard_base.hpp>
24 #include <uhd/usrp/dboard_id.hpp>
25 #include <boost/utility.hpp>
26 #include <boost/shared_ptr.hpp>
27 #include <string>
28 #include <vector>
29 
30 namespace uhd{ namespace usrp{
31 
37 class UHD_API dboard_manager : boost::noncopyable{
38 public:
39  typedef boost::shared_ptr<dboard_manager> sptr;
40 
41  //dboard constructor (each dboard should have a ::make with this signature)
42  typedef dboard_base::sptr(*dboard_ctor_t)(dboard_base::ctor_args_t);
43 
53  static void register_dboard(
54  const dboard_id_t &dboard_id,
55  dboard_ctor_t db_subdev_ctor,
56  const std::string &name,
57  const std::vector<std::string> &subdev_names = std::vector<std::string>(1, "0"),
58  dboard_ctor_t db_container_ctor = NULL
59  );
60 
71  static void register_dboard(
72  const dboard_id_t &rx_dboard_id,
73  const dboard_id_t &tx_dboard_id,
74  dboard_ctor_t db_subdev_ctor,
75  const std::string &name,
76  const std::vector<std::string> &subdev_names = std::vector<std::string>(1, "0"),
77  dboard_ctor_t db_container_ctor = NULL
78  );
79 
91  static void register_dboard_restricted(
92  const dboard_id_t &dboard_id,
93  dboard_ctor_t db_subdev_ctor,
94  const std::string &name,
95  const std::vector<std::string> &subdev_names = std::vector<std::string>(1, "0"),
96  dboard_ctor_t db_container_ctor = NULL
97  );
98 
111  static void register_dboard_restricted(
112  const dboard_id_t &rx_dboard_id,
113  const dboard_id_t &tx_dboard_id,
114  dboard_ctor_t db_subdev_ctor,
115  const std::string &name,
116  const std::vector<std::string> &subdev_names = std::vector<std::string>(1, "0"),
117  dboard_ctor_t db_container_ctor = NULL
118  );
119 
130  static sptr make(
131  dboard_id_t rx_dboard_id,
132  dboard_id_t tx_dboard_id,
133  dboard_id_t gdboard_id,
134  dboard_iface::sptr iface,
135  property_tree::sptr subtree,
136  bool defer_db_init = false
137  );
138 
139  virtual ~dboard_manager() {}
140 
144  virtual void initialize_dboards() = 0;
145 
150  virtual const std::vector<std::string>& get_rx_frontends() const = 0;
151 
156  virtual const std::vector<std::string>& get_tx_frontends() const = 0;
157 };
158 
159 }} //namespace
160 
161 #endif /* INCLUDED_UHD_USRP_DBOARD_MANAGER_HPP */
boost::shared_ptr< dboard_manager > sptr
Definition: dboard_manager.hpp:39
Definition: dboard_id.hpp:28
boost::shared_ptr< property_tree > sptr
Definition: property_tree.hpp:220
Definition: dboard_manager.hpp:37
Definition: build_info.hpp:25
boost::shared_ptr< dboard_base > sptr
Definition: dboard_base.hpp:37
void * ctor_args_t
Definition: dboard_base.hpp:43
virtual ~dboard_manager()
Definition: dboard_manager.hpp:139
#define UHD_API
Definition: config.h:73
boost::shared_ptr< dboard_iface > sptr
Definition: dboard_iface.hpp:64