UHD
003.006.002-rc1
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
include
uhd
stream.hpp
Go to the documentation of this file.
1
//
2
// Copyright 2011-2013 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
>
23
#include <
uhd/types/device_addr.hpp
>
24
#include <
uhd/types/stream_cmd.hpp
>
25
#include <
uhd/types/ref_vector.hpp
>
26
#include <boost/utility.hpp>
27
#include <boost/shared_ptr.hpp>
28
#include <vector>
29
#include <string>
30
31
namespace
uhd{
32
40
struct
UHD_API
stream_args_t
{
41
43
stream_args_t
(
44
const
std::string &cpu =
""
,
45
const
std::string &otw =
""
46
){
47
cpu_format = cpu;
48
otw_format = otw;
49
}
50
65
std::string
cpu_format
;
66
77
std::string
otw_format
;
78
108
device_addr_t
args
;
109
116
std::vector<size_t>
channels
;
117
};
118
124
class
UHD_API
rx_streamer
: boost::noncopyable{
125
public
:
126
typedef
boost::shared_ptr<rx_streamer>
sptr
;
127
128
virtual
~
rx_streamer
(
void
);
129
131
virtual
size_t
get_num_channels(
void
)
const
= 0;
132
134
virtual
size_t
get_max_num_samps(
void
)
const
= 0;
135
137
typedef
ref_vector<void *>
buffs_type
;
138
169
virtual
size_t
recv(
170
const
buffs_type
&buffs,
171
const
size_t
nsamps_per_buff,
172
rx_metadata_t
&metadata,
173
const
double
timeout = 0.1,
174
const
bool
one_packet =
false
175
) = 0;
176
188
virtual
void
issue_stream_cmd(
const
stream_cmd_t
&stream_cmd) = 0;
189
};
190
196
class
UHD_API
tx_streamer
: boost::noncopyable{
197
public
:
198
typedef
boost::shared_ptr<tx_streamer>
sptr
;
199
200
virtual
~
tx_streamer
(
void
);
201
203
virtual
size_t
get_num_channels(
void
)
const
= 0;
204
206
virtual
size_t
get_max_num_samps(
void
)
const
= 0;
207
209
typedef
ref_vector<const void *>
buffs_type
;
210
232
virtual
size_t
send(
233
const
buffs_type
&buffs,
234
const
size_t
nsamps_per_buff,
235
const
tx_metadata_t
&metadata,
236
const
double
timeout = 0.1
237
) = 0;
238
245
virtual
bool
recv_async_msg(
246
async_metadata_t
&async_metadata,
double
timeout = 0.1
247
) = 0;
248
};
249
250
}
//namespace uhd
251
252
#endif
/* INCLUDED_UHD_STREAM_HPP */
Generated by
1.8.3.1