GNU Radio 3.7.3 C++ API
rpccallbackregister_base.h
Go to the documentation of this file.
1
/* -*- c++ -*- */
2
/*
3
* Copyright 2012 Free Software Foundation, Inc.
4
*
5
* This file is part of GNU Radio
6
*
7
* GNU Radio is free software; you can redistribute it and/or modify
8
* it under the terms of the GNU General Public License as published by
9
* the Free Software Foundation; either version 3, or (at your option)
10
* any later version.
11
*
12
* GNU Radio is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
* GNU General Public License for more details.
16
*
17
* You should have received a copy of the GNU General Public License
18
* along with GNU Radio; see the file COPYING. If not, write to
19
* the Free Software Foundation, Inc., 51 Franklin Street,
20
* Boston, MA 02110-1301, USA.
21
*/
22
23
#ifndef RPCCALLBACKREGISTER_BASE_H
24
#define RPCCALLBACKREGISTER_BASE_H
25
26
#include <
gnuradio/messages/msg_accepter.h
>
27
#include <
gnuradio/messages/msg_producer.h
>
28
29
typedef
uint32_t
DisplayType
;
30
31
// DisplayType Plotting types
32
const
uint32_t
DISPNULL
= 0x0000;
33
const
uint32_t
DISPTIME
= 0x0001;
34
const
uint32_t
DISPXY
= 0x0002;
35
const
uint32_t
DISPPSD
= 0x0004;
36
const
uint32_t
DISPSPEC
= 0x0008;
37
const
uint32_t
DISPRAST
= 0x0010;
38
39
// DisplayType Options
40
const
uint32_t
DISPOPTCPLX
= 0x0100;
41
const
uint32_t
DISPOPTLOG
= 0x0200;
42
const
uint32_t
DISPOPTSTEM
= 0x0400;
43
const
uint32_t
DISPOPTSTRIP
= 0x0800;
44
const
uint32_t
DISPOPTSCATTER
= 0x1000;
45
46
enum
priv_lvl_t
{
47
RPC_PRIVLVL_ALL
= 0,
48
RPC_PRIVLVL_MIN
= 9,
49
RPC_PRIVLVL_NONE
= 10
50
};
51
52
enum
KnobType
{
53
KNOBBOOL
,
KNOBCHAR
,
KNOBINT
,
KNOBFLOAT
,
54
KNOBDOUBLE
,
KNOBSTRING
,
KNOBLONG
,
KNOBVECBOOL
,
55
KNOBCOMPLEX
,
KNOBCOMPLEXD
,
56
KNOBVECCHAR
,
KNOBVECINT
,
KNOBVECFLOAT
,
KNOBVECDOUBLE
,
57
KNOBVECSTRING
,
KNOBVECLONG
58
};
59
60
struct
callbackregister_base
61
{
62
struct
callback_base_t
63
{
64
public
:
65
callback_base_t
(
const
priv_lvl_t
priv_,
const
std::string& units_,
66
const
DisplayType
display_,
const
std::string& desc_,
67
const
pmt::pmt_t
min_,
const
pmt::pmt_t
max_,
const
pmt::pmt_t
def)
68
:
priv
(priv_),
units
(units_),
description
(desc_),
69
min
(min_),
max
(max_),
defaultvalue
(def),
display
(display_)
70
{
71
}
72
73
priv_lvl_t
priv
;
74
std::string
units
,
description
;
75
pmt::pmt_t
min
,
max
,
defaultvalue
;
76
DisplayType
display
;
77
};
78
79
template
<
typename
T,
typename
Tsptr>
80
class
callback_t
:
public
callback_base_t
81
{
82
public
:
83
callback_t
(T* callback_,
priv_lvl_t
priv_,
84
const
std::string& units_,
const
DisplayType
display_, const:: std::string& desc_,
85
const
pmt::pmt_t
& min_,
const
pmt::pmt_t
& max_,
const
pmt::pmt_t
& def_) :
86
callback_base_t
(priv_, units_, display_, desc_, min_, max_, def_),
87
callback
(callback_)
88
{
89
}
90
91
Tsptr
callback
;
92
};
93
94
typedef
callback_t<gr::messages::msg_accepter, gr::messages::msg_accepter_sptr>
configureCallback_t
;
95
typedef
callback_t<gr::messages::msg_producer, gr::messages::msg_producer_sptr>
queryCallback_t
;
96
97
callbackregister_base
() {;}
98
virtual
~callbackregister_base
() {;}
99
100
virtual
void
registerConfigureCallback
(
const
std::string &
id
,
const
configureCallback_t
callback) = 0;
101
virtual
void
unregisterConfigureCallback
(
const
std::string &
id
) = 0;
102
virtual
void
registerQueryCallback
(
const
std::string &
id
,
const
queryCallback_t
callback) = 0;
103
virtual
void
unregisterQueryCallback
(
const
std::string &
id
) = 0;
104
};
105
106
#endif
/* RPCCALLBACKREGISTER_BASE_H */
gnuradio
gnuradio-runtime
include
gnuradio
rpccallbackregister_base.h
Generated by
1.8.3.1