UHD  003.005.004-0-ga219f16c
stream.hpp
Go to the documentation of this file.
1 //
2 // Copyright 2011-2012 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_STREAM_HPP
19 #define INCLUDED_UHD_STREAM_HPP
20 
21 #include <uhd/config.hpp>
22 #include <uhd/types/metadata.hpp>
24 #include <uhd/types/ref_vector.hpp>
25 #include <boost/utility.hpp>
26 #include <boost/shared_ptr.hpp>
27 #include <vector>
28 #include <string>
29 
30 namespace uhd{
31 
40 
43  const std::string &cpu = "",
44  const std::string &otw = ""
45  ){
46  cpu_format = cpu;
47  otw_format = otw;
48  }
49 
64  std::string cpu_format;
65 
76  std::string otw_format;
77 
108 
115  std::vector<size_t> channels;
116 };
117 
123 class UHD_API rx_streamer : boost::noncopyable{
124 public:
125  typedef boost::shared_ptr<rx_streamer> sptr;
126 
128  virtual size_t get_num_channels(void) const = 0;
129 
131  virtual size_t get_max_num_samps(void) const = 0;
132 
135 
166  virtual size_t recv(
167  const buffs_type &buffs,
168  const size_t nsamps_per_buff,
169  rx_metadata_t &metadata,
170  const double timeout = 0.1,
171  const bool one_packet = false
172  ) = 0;
173 };
174 
180 class UHD_API tx_streamer : boost::noncopyable{
181 public:
182  typedef boost::shared_ptr<tx_streamer> sptr;
183 
185  virtual size_t get_num_channels(void) const = 0;
186 
188  virtual size_t get_max_num_samps(void) const = 0;
189 
192 
214  virtual size_t send(
215  const buffs_type &buffs,
216  const size_t nsamps_per_buff,
217  const tx_metadata_t &metadata,
218  const double timeout = 0.1
219  ) = 0;
220 };
221 
222 } //namespace uhd
223 
224 #endif /* INCLUDED_UHD_STREAM_HPP */
Definition: stream.hpp:123
Definition: stream.hpp:180
std::vector< size_t > channels
Definition: stream.hpp:115
boost::shared_ptr< rx_streamer > sptr
Definition: stream.hpp:125
std::string otw_format
Definition: stream.hpp:76
Definition: metadata.hpp:32
Definition: metadata.hpp:97
#define UHD_API
Definition: config.hpp:76
Definition: convert.hpp:28
std::string cpu_format
Definition: stream.hpp:64
Definition: ref_vector.hpp:30
ref_vector< void * > buffs_type
Typedef for a pointer to a single, or a collection of recv buffers.
Definition: stream.hpp:134
stream_args_t(const std::string &cpu="", const std::string &otw="")
Convenience constructor for streamer args.
Definition: stream.hpp:42
device_addr_t args
Definition: stream.hpp:107
ref_vector< const void * > buffs_type
Typedef for a pointer to a single, or a collection of send buffers.
Definition: stream.hpp:191
Definition: stream.hpp:39
boost::shared_ptr< tx_streamer > sptr
Definition: stream.hpp:182
Definition: device_addr.hpp:47