Loading...
Searching...
No Matches
rpccallbackregister_base.h
Go to the documentation of this file.
/* -*- c++ -*- */
/*
* Copyright 2012 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
#ifndef RPCCALLBACKREGISTER_BASE_H
#define RPCCALLBACKREGISTER_BASE_H
#include <gnuradio/messages/msg_accepter.h>
#include <gnuradio/messages/msg_producer.h>
typedef uint32_t DisplayType;
//! DisplayType Plotting types
constexpr uint32_t DISPNULL = 0x0000;
constexpr uint32_t DISPTIME = 0x0001;
constexpr uint32_t DISPXY = 0x0002;
constexpr uint32_t DISPPSD = 0x0004;
constexpr uint32_t DISPSPEC = 0x0008;
constexpr uint32_t DISPRAST = 0x0010;
//! DisplayType Options
constexpr uint32_t DISPOPTCPLX = 0x0100;
constexpr uint32_t DISPOPTLOG = 0x0200;
constexpr uint32_t DISPOPTSTEM = 0x0400;
constexpr uint32_t DISPOPTSTRIP = 0x0800;
constexpr uint32_t DISPOPTSCATTER = 0x1000;
enum priv_lvl_t { RPC_PRIVLVL_ALL = 0, RPC_PRIVLVL_MIN = 9, RPC_PRIVLVL_NONE = 10 };
enum KnobType {
KNOBBOOL,
KNOBCHAR,
KNOBINT,
KNOBFLOAT,
KNOBDOUBLE,
KNOBSTRING,
KNOBLONG,
KNOBVECBOOL,
KNOBCOMPLEX,
KNOBCOMPLEXD,
KNOBVECCHAR,
KNOBVECINT,
KNOBVECFLOAT,
KNOBVECDOUBLE,
KNOBVECSTRING,
KNOBVECLONG
};
struct callbackregister_base {
struct callback_base_t {
public:
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)
: priv(priv_),
units(units_),
description(desc_),
min(min_),
max(max_),
defaultvalue(def),
display(display_)
{
}
priv_lvl_t priv;
std::string units, description;
pmt::pmt_t min, max, defaultvalue;
DisplayType display;
};
template <typename T, typename Tsptr>
class callback_t : public callback_base_t
{
public:
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_)
: callback_base_t(priv_, units_, display_, desc_, min_, max_, def_),
callback(callback_)
{
}
callback_t(T* callback_, priv_lvl_t priv_, const ::std::string& desc_)
: callback_base_t(
priv_, "", 0, desc_, pmt::pmt_t(), pmt::pmt_t(), pmt::pmt_t()),
callback(callback_)
{
}
Tsptr callback;
};
typedef callback_t<gr::messages::msg_accepter, gr::messages::msg_accepter_sptr>
configureCallback_t;
typedef callback_t<gr::messages::msg_producer, gr::messages::msg_producer_sptr>
queryCallback_t;
typedef callback_t<gr::messages::msg_accepter, gr::messages::msg_accepter_sptr>
handlerCallback_t;
callbackregister_base() { ; }
virtual ~callbackregister_base() { ; }
virtual void registerConfigureCallback(const std::string& id,
const configureCallback_t callback) = 0;
virtual void unregisterConfigureCallback(const std::string& id) = 0;
virtual void registerQueryCallback(const std::string& id,
const queryCallback_t callback) = 0;
virtual void unregisterQueryCallback(const std::string& id) = 0;
virtual void registerHandlerCallback(const std::string& id,
const handlerCallback_t callback) = 0;
virtual void unregisterHandlerCallback(const std::string& id) = 0;
};
#endif /* RPCCALLBACKREGISTER_BASE_H */
callbackregister_base::callback_t
Definition rpccallbackregister_base.h:83
callbackregister_base::callback_t::callback
Tsptr callback
Definition rpccallbackregister_base.h:105
callbackregister_base::callback_t::callback_t
callback_t(T *callback_, priv_lvl_t priv_, const ::std::string &desc_)
Definition rpccallbackregister_base.h:98
callbackregister_base::callback_t::callback_t
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:85
msg_accepter.h
msg_producer.h
pmt
Definition pmt.h:38
pmt::pmt_t
std::shared_ptr< pmt_base > pmt_t
typedef for shared pointer (transparent reference counting).
Definition pmt.h:83
DISPNULL
constexpr uint32_t DISPNULL
DisplayType Plotting types.
Definition rpccallbackregister_base.h:20
DISPOPTSTRIP
constexpr uint32_t DISPOPTSTRIP
Definition rpccallbackregister_base.h:31
DISPTIME
constexpr uint32_t DISPTIME
Definition rpccallbackregister_base.h:21
DISPXY
constexpr uint32_t DISPXY
Definition rpccallbackregister_base.h:22
priv_lvl_t
priv_lvl_t
Definition rpccallbackregister_base.h:34
RPC_PRIVLVL_NONE
@ RPC_PRIVLVL_NONE
Definition rpccallbackregister_base.h:34
RPC_PRIVLVL_ALL
@ RPC_PRIVLVL_ALL
Definition rpccallbackregister_base.h:34
RPC_PRIVLVL_MIN
@ RPC_PRIVLVL_MIN
Definition rpccallbackregister_base.h:34
DISPOPTSCATTER
constexpr uint32_t DISPOPTSCATTER
Definition rpccallbackregister_base.h:32
KnobType
KnobType
Definition rpccallbackregister_base.h:36
KNOBSTRING
@ KNOBSTRING
Definition rpccallbackregister_base.h:42
KNOBVECINT
@ KNOBVECINT
Definition rpccallbackregister_base.h:48
KNOBVECSTRING
@ KNOBVECSTRING
Definition rpccallbackregister_base.h:51
KNOBLONG
@ KNOBLONG
Definition rpccallbackregister_base.h:43
KNOBCHAR
@ KNOBCHAR
Definition rpccallbackregister_base.h:38
KNOBVECBOOL
@ KNOBVECBOOL
Definition rpccallbackregister_base.h:44
KNOBVECFLOAT
@ KNOBVECFLOAT
Definition rpccallbackregister_base.h:49
KNOBCOMPLEX
@ KNOBCOMPLEX
Definition rpccallbackregister_base.h:45
KNOBFLOAT
@ KNOBFLOAT
Definition rpccallbackregister_base.h:40
KNOBDOUBLE
@ KNOBDOUBLE
Definition rpccallbackregister_base.h:41
KNOBVECCHAR
@ KNOBVECCHAR
Definition rpccallbackregister_base.h:47
KNOBVECDOUBLE
@ KNOBVECDOUBLE
Definition rpccallbackregister_base.h:50
KNOBBOOL
@ KNOBBOOL
Definition rpccallbackregister_base.h:37
KNOBCOMPLEXD
@ KNOBCOMPLEXD
Definition rpccallbackregister_base.h:46
KNOBVECLONG
@ KNOBVECLONG
Definition rpccallbackregister_base.h:52
KNOBINT
@ KNOBINT
Definition rpccallbackregister_base.h:39
DISPOPTSTEM
constexpr uint32_t DISPOPTSTEM
Definition rpccallbackregister_base.h:30
DISPOPTLOG
constexpr uint32_t DISPOPTLOG
Definition rpccallbackregister_base.h:29
DISPOPTCPLX
constexpr uint32_t DISPOPTCPLX
DisplayType Options.
Definition rpccallbackregister_base.h:28
DISPPSD
constexpr uint32_t DISPPSD
Definition rpccallbackregister_base.h:23
DisplayType
uint32_t DisplayType
Definition rpccallbackregister_base.h:17
DISPSPEC
constexpr uint32_t DISPSPEC
Definition rpccallbackregister_base.h:24
DISPRAST
constexpr uint32_t DISPRAST
Definition rpccallbackregister_base.h:25
callbackregister_base::callback_base_t::min
pmt::pmt_t min
Definition rpccallbackregister_base.h:77
callbackregister_base::callback_base_t::callback_base_t
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:58
callbackregister_base::callback_base_t::description
std::string description
Definition rpccallbackregister_base.h:76
callbackregister_base::callback_base_t::defaultvalue
pmt::pmt_t defaultvalue
Definition rpccallbackregister_base.h:77
callbackregister_base::callback_base_t::units
std::string units
Definition rpccallbackregister_base.h:76
callbackregister_base::callback_base_t::display
DisplayType display
Definition rpccallbackregister_base.h:78
callbackregister_base::callback_base_t::priv
priv_lvl_t priv
Definition rpccallbackregister_base.h:75
callbackregister_base::callback_base_t::max
pmt::pmt_t max
Definition rpccallbackregister_base.h:77
callbackregister_base::registerHandlerCallback
virtual void registerHandlerCallback(const std::string &id, const handlerCallback_t callback)=0
callbackregister_base::queryCallback_t
callback_t< gr::messages::msg_producer, gr::messages::msg_producer_sptr > queryCallback_t
Definition rpccallbackregister_base.h:111
callbackregister_base::callbackregister_base
callbackregister_base()
Definition rpccallbackregister_base.h:115
callbackregister_base::unregisterConfigureCallback
virtual void unregisterConfigureCallback(const std::string &id)=0
callbackregister_base::~callbackregister_base
virtual ~callbackregister_base()
Definition rpccallbackregister_base.h:116
callbackregister_base::unregisterQueryCallback
virtual void unregisterQueryCallback(const std::string &id)=0
callbackregister_base::handlerCallback_t
callback_t< gr::messages::msg_accepter, gr::messages::msg_accepter_sptr > handlerCallback_t
Definition rpccallbackregister_base.h:113
callbackregister_base::registerQueryCallback
virtual void registerQueryCallback(const std::string &id, const queryCallback_t callback)=0
callbackregister_base::configureCallback_t
callback_t< gr::messages::msg_accepter, gr::messages::msg_accepter_sptr > configureCallback_t
Definition rpccallbackregister_base.h:109
callbackregister_base::registerConfigureCallback
virtual void registerConfigureCallback(const std::string &id, const configureCallback_t callback)=0
callbackregister_base::unregisterHandlerCallback
virtual void unregisterHandlerCallback(const std::string &id)=0