UHD
003.004.002-0-unknown
|
00001 // 00002 // Copyright 2010-2011 Ettus Research LLC 00003 // 00004 // This program is free software: you can redistribute it and/or modify 00005 // it under the terms of the GNU General Public License as published by 00006 // the Free Software Foundation, either version 3 of the License, or 00007 // (at your option) any later version. 00008 // 00009 // This program is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 // GNU General Public License for more details. 00013 // 00014 // You should have received a copy of the GNU General Public License 00015 // along with this program. If not, see <http://www.gnu.org/licenses/>. 00016 // 00017 00018 #ifndef INCLUDED_UHD_DEVICE_HPP 00019 #define INCLUDED_UHD_DEVICE_HPP 00020 00021 #include <uhd/config.hpp> 00022 #include <uhd/stream.hpp> 00023 #include <uhd/deprecated.hpp> 00024 #include <uhd/types/device_addr.hpp> 00025 #include <boost/utility.hpp> 00026 #include <boost/shared_ptr.hpp> 00027 #include <boost/function.hpp> 00028 00029 namespace uhd{ 00030 00031 class property_tree; //forward declaration 00032 00037 class UHD_API device : boost::noncopyable{ 00038 00039 public: 00040 typedef boost::shared_ptr<device> sptr; 00041 typedef boost::function<device_addrs_t(const device_addr_t &)> find_t; 00042 typedef boost::function<sptr(const device_addr_t &)> make_t; 00043 00050 static void register_device( 00051 const find_t &find, 00052 const make_t &make 00053 ); 00054 00064 static device_addrs_t find(const device_addr_t &hint); 00065 00077 static sptr make(const device_addr_t &hint, size_t which = 0); 00078 00080 virtual rx_streamer::sptr get_rx_stream(const stream_args_t &args) = 0; 00081 00083 virtual tx_streamer::sptr get_tx_stream(const stream_args_t &args) = 0; 00084 00091 virtual bool recv_async_msg( 00092 async_metadata_t &async_metadata, double timeout = 0.1 00093 ) = 0; 00094 00096 virtual boost::shared_ptr<property_tree> get_tree(void) const = 0; 00097 00098 #include <uhd/device_deprecated.ipp> 00099 00100 }; 00101 00102 } //namespace uhd 00103 00104 #endif /* INCLUDED_UHD_DEVICE_HPP */