UHD  003.007.001-0-g8f46b048
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
device.hpp
Go to the documentation of this file.
1 //
2 // Copyright 2010-2011 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 
51  static void register_device(
52  const find_t &find,
53  const make_t &make
54  );
55 
65  static device_addrs_t find(const device_addr_t &hint);
66 
78  static sptr make(const device_addr_t &hint, size_t which = 0);
79 
85  virtual rx_streamer::sptr get_rx_stream(const stream_args_t &args) = 0;
86 
92  virtual tx_streamer::sptr get_tx_stream(const stream_args_t &args) = 0;
93 
95  uhd::property_tree::sptr get_tree(void) const;
96 
97  #include <uhd/device_deprecated.ipp>
98 
99 protected:
101 };
102 
103 } //namespace uhd
104 
105 #endif /* INCLUDED_UHD_DEVICE_HPP */
boost::shared_ptr< device > sptr
Definition: device.hpp:41
boost::shared_ptr< property_tree > sptr
Definition: property_tree.hpp:122
boost::shared_ptr< rx_streamer > sptr
Definition: stream.hpp:126
#define UHD_API
Definition: config.hpp:79
Definition: convert.hpp:28
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:100
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
boost::function< device_addrs_t(const device_addr_t &)> find_t
Definition: device.hpp:42
Definition: device_addr.hpp:47