USRP Hardware Driver and USRP Manual
Version: 003.008.001-release
UHD and USRP Manual
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
convert.hpp
Go to the documentation of this file.
1
//
2
// Copyright 2011-2012,2014 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_CONVERT_HPP
19
#define INCLUDED_UHD_CONVERT_HPP
20
21
#include <
uhd/config.hpp
>
22
#include <
uhd/types/ref_vector.hpp
>
23
#include <boost/shared_ptr.hpp>
24
#include <boost/function.hpp>
25
#include <boost/operators.hpp>
26
#include <string>
27
28
namespace
uhd{
namespace
convert{
29
31
class
converter
{
32
public
:
33
typedef
boost::shared_ptr<converter>
sptr
;
34
typedef
uhd::ref_vector<void *>
output_type
;
35
typedef
uhd::ref_vector<const void *>
input_type
;
36
37
virtual
~converter
(
void
) = 0;
38
40
virtual
void
set_scalar
(
const
double
) = 0;
41
43
UHD_INLINE
void
conv
(
const
input_type
&in,
const
output_type
&out,
const
size_t
num){
44
if
(num != 0) (*this)(in, out, num);
45
}
46
47
private
:
49
virtual
void
operator()(
const
input_type
&,
const
output_type
&,
const
size_t
) = 0;
50
};
51
53
typedef
boost::function<converter::sptr(void)>
function_type
;
54
56
typedef
int
priority_type
;
57
59
struct
id_type
: boost::equality_comparable<id_type>{
60
std::string
input_format
;
61
size_t
num_inputs
;
62
std::string
output_format
;
63
size_t
num_outputs
;
64
std::string
to_pp_string
(
void
)
const
;
65
};
66
68
UHD_API
bool
operator==
(
const
id_type
&,
const
id_type
&);
69
76
UHD_API
void
register_converter
(
77
const
id_type
&
id
,
78
const
function_type
&fcn,
79
const
priority_type
prio
80
);
81
88
UHD_API
function_type
get_converter
(
89
const
id_type
&
id
,
90
const
priority_type
prio = -1
91
);
92
98
UHD_API
void
register_bytes_per_item
(
99
const
std::string &format,
const
size_t
size
100
);
101
103
UHD_API
size_t
get_bytes_per_item
(
const
std::string &format);
104
105
}}
//namespace
106
107
#endif
/* INCLUDED_UHD_CONVERT_HPP */
include
uhd
convert.hpp
Generated on Mon Apr 28 2014 15:04:36 for USRP Hardware Driver and USRP Manual by
1.8.3.1