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