UHD 003.004.003-0-unknown

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

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/types/device_addr.hpp>
25 #include <boost/utility.hpp>
26 #include <boost/shared_ptr.hpp>
27 #include <boost/function.hpp>
28
29 namespace uhd{
30
31 class property_tree; //forward declaration
32
37 class UHD_API device : boost::noncopyable{
38
39 public:
40 typedef boost::shared_ptr<device> sptr;
41 typedef boost::function<device_addrs_t(const device_addr_t &)> find_t;
42 typedef boost::function<sptr(const device_addr_t &)> make_t;
43
50 static void register_device(
51 const find_t &find,
52 const make_t &make
53 );
54
64 static device_addrs_t find(const device_addr_t &hint);
65
77 static sptr make(const device_addr_t &hint, size_t which = 0);
78
80 virtual rx_streamer::sptr get_rx_stream(const stream_args_t &args) = 0;
81
83 virtual tx_streamer::sptr get_tx_stream(const stream_args_t &args) = 0;
84
91 virtual bool recv_async_msg(
92 async_metadata_t &async_metadata, double timeout = 0.1
93 ) = 0;
94
96 virtual boost::shared_ptr<property_tree> get_tree(void) const = 0;
97
98 #include <uhd/device_deprecated.ipp>
99
100 };
101
102 } //namespace uhd
103
104 #endif /* INCLUDED_UHD_DEVICE_HPP */