GNU Radio Manual and C++ API Reference 3.8.5.0
The Free & Open Software Radio Ecosystem
 
Loading...
Searching...
No Matches
rpcpmtconverters_thrift.h
Go to the documentation of this file.
1/*
2 * Copyright 2014,2015 Free Software Foundation, Inc.
3 *
4 * This file is part of GNU Radio
5 *
6 * GNU Radio is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3, or (at your option)
9 * any later version.
10 *
11 * GNU Radio is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with GNU Radio; see the file COPYING. If not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Street,
19 * Boston, MA 02110-1301, USA.
20 */
21
22#ifndef RPCPMTCONVERTERS_THRIFT_H
23#define RPCPMTCONVERTERS_THRIFT_H
24
25#include "thrift/gnuradio_types.h"
26#include <pmt/pmt.h>
27#include <boost/noncopyable.hpp>
28#include <boost/ptr_container/ptr_map.hpp>
29
30
31namespace rpcpmtconverter {
32GNURadio::Knob from_pmt(const pmt::pmt_t& knob);
33
34struct to_pmt_f {
35 to_pmt_f() { ; }
36 virtual ~to_pmt_f() {}
37 virtual pmt::pmt_t operator()(const GNURadio::Knob& knob);
38};
39
40struct to_pmt_byte_f : public to_pmt_f {
41 pmt::pmt_t operator()(const GNURadio::Knob& knob);
42};
43struct to_pmt_short_f : public to_pmt_f {
44 pmt::pmt_t operator()(const GNURadio::Knob& knob);
45};
46struct to_pmt_int_f : public to_pmt_f {
47 pmt::pmt_t operator()(const GNURadio::Knob& knob);
48};
49struct to_pmt_long_f : public to_pmt_f {
50 pmt::pmt_t operator()(const GNURadio::Knob& knob);
51};
52struct to_pmt_double_f : public to_pmt_f {
53 pmt::pmt_t operator()(const GNURadio::Knob& knob);
54};
55struct to_pmt_string_f : public to_pmt_f {
56 pmt::pmt_t operator()(const GNURadio::Knob& knob);
57};
58struct to_pmt_bool_f : public to_pmt_f {
59 pmt::pmt_t operator()(const GNURadio::Knob& knob);
60};
61struct to_pmt_complex_f : public to_pmt_f {
62 pmt::pmt_t operator()(const GNURadio::Knob& knob);
63};
64struct to_pmt_f32vect_f : public to_pmt_f {
65 pmt::pmt_t operator()(const GNURadio::Knob& knob);
66};
67struct to_pmt_f64vect_f : public to_pmt_f {
68 pmt::pmt_t operator()(const GNURadio::Knob& knob);
69};
70struct to_pmt_s64vect_f : public to_pmt_f {
71 pmt::pmt_t operator()(const GNURadio::Knob& knob);
72};
73struct to_pmt_s32vect_f : public to_pmt_f {
74 pmt::pmt_t operator()(const GNURadio::Knob& knob);
75};
76struct to_pmt_s16vect_f : public to_pmt_f {
77 pmt::pmt_t operator()(const GNURadio::Knob& knob);
78};
79struct to_pmt_s8vect_f : public to_pmt_f {
80 pmt::pmt_t operator()(const GNURadio::Knob& knob);
81};
82struct to_pmt_c32vect_f : public to_pmt_f {
83 pmt::pmt_t operator()(const GNURadio::Knob& knob);
84};
85
86class To_PMT : private boost::noncopyable
87{
88public:
90 template <typename TO_PMT_F>
91 friend struct to_pmt_reg;
92 pmt::pmt_t operator()(const GNURadio::Knob& knob);
93
94protected:
95 boost::ptr_map<GNURadio::BaseTypes::type, to_pmt_f> to_pmt_map;
96
97private:
98 To_PMT() { ; }
99};
100
101template <typename TO_PMT_F>
103 to_pmt_reg(To_PMT& instance, const GNURadio::BaseTypes::type type);
104};
105} // namespace rpcpmtconverter
106
107#endif /* RPCPMTCONVERTERS_THRIFT_H */
Definition rpcpmtconverters_thrift.h:87
boost::ptr_map< GNURadio::BaseTypes::type, to_pmt_f > to_pmt_map
Definition rpcpmtconverters_thrift.h:95
pmt::pmt_t operator()(const GNURadio::Knob &knob)
static To_PMT instance
Definition rpcpmtconverters_thrift.h:89
boost::shared_ptr< pmt_base > pmt_t
typedef for shared pointer (transparent reference counting). See http://www.boost....
Definition pmt.h:96
Definition rpcpmtconverters_thrift.h:31
GNURadio::Knob from_pmt(const pmt::pmt_t &knob)
Definition rpcpmtconverters_thrift.h:58
pmt::pmt_t operator()(const GNURadio::Knob &knob)
Definition rpcpmtconverters_thrift.h:40
pmt::pmt_t operator()(const GNURadio::Knob &knob)
Definition rpcpmtconverters_thrift.h:82
pmt::pmt_t operator()(const GNURadio::Knob &knob)
Definition rpcpmtconverters_thrift.h:61
pmt::pmt_t operator()(const GNURadio::Knob &knob)
Definition rpcpmtconverters_thrift.h:52
pmt::pmt_t operator()(const GNURadio::Knob &knob)
Definition rpcpmtconverters_thrift.h:64
pmt::pmt_t operator()(const GNURadio::Knob &knob)
Definition rpcpmtconverters_thrift.h:67
pmt::pmt_t operator()(const GNURadio::Knob &knob)
Definition rpcpmtconverters_thrift.h:34
to_pmt_f()
Definition rpcpmtconverters_thrift.h:35
virtual ~to_pmt_f()
Definition rpcpmtconverters_thrift.h:36
virtual pmt::pmt_t operator()(const GNURadio::Knob &knob)
Definition rpcpmtconverters_thrift.h:46
pmt::pmt_t operator()(const GNURadio::Knob &knob)
Definition rpcpmtconverters_thrift.h:49
pmt::pmt_t operator()(const GNURadio::Knob &knob)
Definition rpcpmtconverters_thrift.h:102
to_pmt_reg(To_PMT &instance, const GNURadio::BaseTypes::type type)
Definition rpcpmtconverters_thrift.h:76
pmt::pmt_t operator()(const GNURadio::Knob &knob)
Definition rpcpmtconverters_thrift.h:73
pmt::pmt_t operator()(const GNURadio::Knob &knob)
Definition rpcpmtconverters_thrift.h:70
pmt::pmt_t operator()(const GNURadio::Knob &knob)
Definition rpcpmtconverters_thrift.h:79
pmt::pmt_t operator()(const GNURadio::Knob &knob)
Definition rpcpmtconverters_thrift.h:43
pmt::pmt_t operator()(const GNURadio::Knob &knob)
Definition rpcpmtconverters_thrift.h:55
pmt::pmt_t operator()(const GNURadio::Knob &knob)