USRP Hardware Driver and USRP Manual  Version: 003.008.001-0-g2474ac32
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 
59  static void register_device(
60  const find_t &find,
61  const make_t &make,
62  const device_filter_t filter
63  );
64 
75  static device_addrs_t find(const device_addr_t &hint, device_filter_t filter = ANY);
76 
89  static sptr make(const device_addr_t &hint, device_filter_t filter = ANY, size_t which = 0);
90 
96  virtual rx_streamer::sptr get_rx_stream(const stream_args_t &args) = 0;
97 
103  virtual tx_streamer::sptr get_tx_stream(const stream_args_t &args) = 0;
104 
106  uhd::property_tree::sptr get_tree(void) const;
107 
109  device_filter_t get_device_type() const;
110 
111  #include <uhd/device_deprecated.ipp>
112 
113 protected:
116 };
117 
118 } //namespace uhd
119 
120 #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:126
#define UHD_API
Definition: config.hpp:79
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:114
boost::function< sptr(const device_addr_t &)> make_t
Definition: device.hpp:43
Definition: stream.hpp:40
Definition: device.hpp:38
boost::shared_ptr< tx_streamer > sptr
Definition: stream.hpp:198
device_filter_t _type
Definition: device.hpp:115
Definition: device.hpp:48
boost::function< device_addrs_t(const device_addr_t &)> find_t
Definition: device.hpp:42
Definition: device_addr.hpp:47