USRP Hardware Driver and USRP Manual  Version: 003.009.002-0-gf18abe54
UHD and USRP Manual
device.hpp
Go to the documentation of this file.
1 //
2 // Copyright 2010-2011,2014 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_DEVICE_HPP
19 #define INCLUDED_UHD_DEVICE_HPP
20 
21 #include <uhd/config.hpp>
22 #include <uhd/stream.hpp>
23 #include <uhd/deprecated.hpp>
24 #include <uhd/property_tree.hpp>
26 #include <boost/utility.hpp>
27 #include <boost/shared_ptr.hpp>
28 #include <boost/function.hpp>
29 
30 namespace uhd{
31 
32 class property_tree; //forward declaration
33 
38 class UHD_API device : boost::noncopyable{
39 
40 public:
41  typedef boost::shared_ptr<device> sptr;
42  typedef boost::function<device_addrs_t(const device_addr_t &)> find_t;
43  typedef boost::function<sptr(const device_addr_t &)> make_t;
44 
47  ANY,
49  CLOCK
50  };
51  virtual ~device(void) = 0;
52 
60  static void register_device(
61  const find_t &find,
62  const make_t &make,
63  const device_filter_t filter
64  );
65 
76  static device_addrs_t find(const device_addr_t &hint, device_filter_t filter = ANY);
77 
92  static sptr make(const device_addr_t &hint, device_filter_t filter = ANY, size_t which = 0);
93 
99  virtual rx_streamer::sptr get_rx_stream(const stream_args_t &args) = 0;
100 
106  virtual tx_streamer::sptr get_tx_stream(const stream_args_t &args) = 0;
107 
109  uhd::property_tree::sptr get_tree(void) const;
110 
112  device_filter_t get_device_type() const;
113 
114  #include <uhd/device_deprecated.ipp>
115 
116 protected:
119 };
120 
121 } //namespace uhd
122 
123 #endif /* INCLUDED_UHD_DEVICE_HPP */
boost::shared_ptr< device > sptr
Definition: device.hpp:41
Definition: device.hpp:47
boost::shared_ptr< property_tree > sptr
Definition: property_tree.hpp:130
boost::shared_ptr< rx_streamer > sptr
Definition: stream.hpp:184
Definition: convert.hpp:28
device_filter_t
Device type, used as a filter in make.
Definition: device.hpp:46
std::vector< device_addr_t > device_addrs_t
A typedef for a vector of device addresses.
Definition: device_addr.hpp:88
uhd::property_tree::sptr _tree
Definition: device.hpp:117
boost::function< sptr(const device_addr_t &)> make_t
Definition: device.hpp:43
Definition: stream.hpp:57
#define UHD_API
Definition: config.h:66
Definition: device.hpp:38
boost::shared_ptr< tx_streamer > sptr
Definition: stream.hpp:256
device_filter_t _type
Definition: device.hpp:118
Definition: device.hpp:48
boost::function< device_addrs_t(const device_addr_t &)> find_t
Definition: device.hpp:42
Definition: device_addr.hpp:47