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 
28 
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 {
50 };
51 
52 enum KnobType {
58 };
59 
61 {
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 
74  std::string units, description;
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 
96 
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 */
Definition: rpccallbackregister_base.h:80
const uint32_t DISPTIME
Definition: rpccallbackregister_base.h:33
callbackregister_base()
Definition: rpccallbackregister_base.h:97
Definition: rpccallbackregister_base.h:54
Definition: rpccallbackregister_base.h:56
const uint32_t DISPOPTLOG
Definition: rpccallbackregister_base.h:41
const uint32_t DISPRAST
Definition: rpccallbackregister_base.h:37
Definition: rpccallbackregister_base.h:60
priv_lvl_t
Definition: rpccallbackregister_base.h:46
const uint32_t DISPOPTSCATTER
Definition: rpccallbackregister_base.h:44
Definition: rpccallbackregister_base.h:56
Definition: rpccallbackregister_base.h:56
Definition: rpccallbackregister_base.h:54
callback_t< gr::messages::msg_accepter, gr::messages::msg_accepter_sptr > configureCallback_t
Definition: rpccallbackregister_base.h:94
virtual ~callbackregister_base()
Definition: rpccallbackregister_base.h:98
Definition: rpccallbackregister_base.h:48
const uint32_t DISPXY
Definition: rpccallbackregister_base.h:34
pmt::pmt_t min
Definition: rpccallbackregister_base.h:75
Definition: rpccallbackregister_base.h:49
Definition: rpccallbackregister_base.h:47
Definition: rpccallbackregister_base.h:53
Definition: rpccallbackregister_base.h:53
Definition: rpccallbackregister_base.h:57
const uint32_t DISPSPEC
Definition: rpccallbackregister_base.h:36
unsigned int uint32_t
Definition: stdint.h:80
virtual void unregisterQueryCallback(const std::string &id)=0
KnobType
Definition: rpccallbackregister_base.h:52
Definition: rpccallbackregister_base.h:55
Definition: rpccallbackregister_base.h:53
const uint32_t DISPOPTCPLX
Definition: rpccallbackregister_base.h:40
virtual void registerQueryCallback(const std::string &id, const queryCallback_t callback)=0
const uint32_t DISPNULL
Definition: rpccallbackregister_base.h:32
Definition: rpccallbackregister_base.h:53
const uint32_t DISPOPTSTEM
Definition: rpccallbackregister_base.h:42
pmt::pmt_t defaultvalue
Definition: rpccallbackregister_base.h:75
virtual void registerConfigureCallback(const std::string &id, const configureCallback_t callback)=0
virtual void unregisterConfigureCallback(const std::string &id)=0
const uint32_t DISPOPTSTRIP
Definition: rpccallbackregister_base.h:43
Definition: rpccallbackregister_base.h:57
callback_t< gr::messages::msg_producer, gr::messages::msg_producer_sptr > queryCallback_t
Definition: rpccallbackregister_base.h:95
priv_lvl_t priv
Definition: rpccallbackregister_base.h:73
std::string units
Definition: rpccallbackregister_base.h:74
const uint32_t DISPPSD
Definition: rpccallbackregister_base.h:35
Definition: rpccallbackregister_base.h:54
std::string description
Definition: rpccallbackregister_base.h:74
Definition: rpccallbackregister_base.h:62
Definition: rpccallbackregister_base.h:54
DisplayType display
Definition: rpccallbackregister_base.h:76
boost::intrusive_ptr< pmt_base > pmt_t
typedef for shared pointer (transparent reference counting). See http://www.boost.org/libs/smart_ptr/smart_ptr.htm
Definition: pmt.h:56
pmt::pmt_t max
Definition: rpccallbackregister_base.h:75
Definition: rpccallbackregister_base.h:56
callback_t(T *callback_, priv_lvl_t priv_, const std::string &units_, const DisplayType display_, const ::std::string &desc_, const pmt::pmt_t &min_, const pmt::pmt_t &max_, const pmt::pmt_t &def_)
Definition: rpccallbackregister_base.h:83
Tsptr callback
Definition: rpccallbackregister_base.h:91
Definition: rpccallbackregister_base.h:55
uint32_t DisplayType
Definition: rpccallbackregister_base.h:29
callback_base_t(const priv_lvl_t priv_, const std::string &units_, const DisplayType display_, const std::string &desc_, const pmt::pmt_t min_, const pmt::pmt_t max_, const pmt::pmt_t def)
Definition: rpccallbackregister_base.h:65