GNU Radio Manual and C++ API Reference  v3.9.2.0-89-gb7c7001e
The Free & Open Software Radio Ecosystem
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  * SPDX-License-Identifier: GPL-3.0-or-later
7  *
8  */
9 
10 #ifndef RPCPMTCONVERTERS_THRIFT_H
11 #define RPCPMTCONVERTERS_THRIFT_H
12 
13 #include "thrift/gnuradio_types.h"
14 #include <pmt/pmt.h>
15 #include <boost/noncopyable.hpp>
16 #include <boost/ptr_container/ptr_map.hpp>
17 
18 
19 namespace rpcpmtconverter {
20 GNURadio::Knob from_pmt(const pmt::pmt_t& knob);
21 
22 struct to_pmt_f {
23  to_pmt_f() { ; }
24  virtual ~to_pmt_f() {}
25  virtual pmt::pmt_t operator()(const GNURadio::Knob& knob);
26 };
27 
28 struct to_pmt_byte_f : public to_pmt_f {
29  pmt::pmt_t operator()(const GNURadio::Knob& knob);
30 };
31 struct to_pmt_short_f : public to_pmt_f {
32  pmt::pmt_t operator()(const GNURadio::Knob& knob);
33 };
34 struct to_pmt_int_f : public to_pmt_f {
35  pmt::pmt_t operator()(const GNURadio::Knob& knob);
36 };
37 struct to_pmt_long_f : public to_pmt_f {
38  pmt::pmt_t operator()(const GNURadio::Knob& knob);
39 };
40 struct to_pmt_double_f : public to_pmt_f {
41  pmt::pmt_t operator()(const GNURadio::Knob& knob);
42 };
43 struct to_pmt_string_f : public to_pmt_f {
44  pmt::pmt_t operator()(const GNURadio::Knob& knob);
45 };
46 struct to_pmt_bool_f : public to_pmt_f {
47  pmt::pmt_t operator()(const GNURadio::Knob& knob);
48 };
49 struct to_pmt_complex_f : public to_pmt_f {
50  pmt::pmt_t operator()(const GNURadio::Knob& knob);
51 };
52 struct to_pmt_f32vect_f : public to_pmt_f {
53  pmt::pmt_t operator()(const GNURadio::Knob& knob);
54 };
55 struct to_pmt_f64vect_f : public to_pmt_f {
56  pmt::pmt_t operator()(const GNURadio::Knob& knob);
57 };
58 struct to_pmt_s64vect_f : public to_pmt_f {
59  pmt::pmt_t operator()(const GNURadio::Knob& knob);
60 };
61 struct to_pmt_s32vect_f : public to_pmt_f {
62  pmt::pmt_t operator()(const GNURadio::Knob& knob);
63 };
64 struct to_pmt_s16vect_f : public to_pmt_f {
65  pmt::pmt_t operator()(const GNURadio::Knob& knob);
66 };
67 struct to_pmt_s8vect_f : public to_pmt_f {
68  pmt::pmt_t operator()(const GNURadio::Knob& knob);
69 };
70 struct to_pmt_c32vect_f : public to_pmt_f {
71  pmt::pmt_t operator()(const GNURadio::Knob& knob);
72 };
73 
74 class To_PMT : private boost::noncopyable
75 {
76 public:
77  static To_PMT instance;
78  template <typename TO_PMT_F>
79  friend struct to_pmt_reg;
80  pmt::pmt_t operator()(const GNURadio::Knob& knob);
81 
82 protected:
83  boost::ptr_map<GNURadio::BaseTypes::type, to_pmt_f> to_pmt_map;
84 
85 private:
86  To_PMT() { ; }
87 };
88 
89 template <typename TO_PMT_F>
90 struct to_pmt_reg {
91  to_pmt_reg(To_PMT& instance, const GNURadio::BaseTypes::type type);
92 };
93 } // namespace rpcpmtconverter
94 
95 #endif /* RPCPMTCONVERTERS_THRIFT_H */
Definition: rpcpmtconverters_thrift.h:75
boost::ptr_map< GNURadio::BaseTypes::type, to_pmt_f > to_pmt_map
Definition: rpcpmtconverters_thrift.h:83
pmt::pmt_t operator()(const GNURadio::Knob &knob)
static To_PMT instance
Definition: rpcpmtconverters_thrift.h:77
std::shared_ptr< pmt_base > pmt_t
typedef for shared pointer (transparent reference counting).
Definition: pmt.h:84
Definition: rpcpmtconverters_thrift.h:19
GNURadio::Knob from_pmt(const pmt::pmt_t &knob)
Definition: rpcpmtconverters_thrift.h:46
pmt::pmt_t operator()(const GNURadio::Knob &knob)
Definition: rpcpmtconverters_thrift.h:28
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:49
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:52
pmt::pmt_t operator()(const GNURadio::Knob &knob)
Definition: rpcpmtconverters_thrift.h:55
pmt::pmt_t operator()(const GNURadio::Knob &knob)
Definition: rpcpmtconverters_thrift.h:22
to_pmt_f()
Definition: rpcpmtconverters_thrift.h:23
virtual ~to_pmt_f()
Definition: rpcpmtconverters_thrift.h:24
virtual pmt::pmt_t operator()(const GNURadio::Knob &knob)
Definition: rpcpmtconverters_thrift.h:34
pmt::pmt_t operator()(const GNURadio::Knob &knob)
Definition: rpcpmtconverters_thrift.h:37
pmt::pmt_t operator()(const GNURadio::Knob &knob)
Definition: rpcpmtconverters_thrift.h:90
to_pmt_reg(To_PMT &instance, const GNURadio::BaseTypes::type type)
Definition: rpcpmtconverters_thrift.h:64
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:58
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:31
pmt::pmt_t operator()(const GNURadio::Knob &knob)
Definition: rpcpmtconverters_thrift.h:43
pmt::pmt_t operator()(const GNURadio::Knob &knob)