Registers a 'trigger' function to trigger an action over ControlPort. More...
#include <gnuradio/rpcregisterhelpers.h>
Public Member Functions | |
rpcbasic_register_trigger (const std::string &block_alias, const char *functionbase, void(T::*function)(), const char *desc_="", priv_lvl_t minpriv_=RPC_PRIVLVL_MIN) | |
Adds the ability to trigger a function over ControlPort. More... | |
rpcbasic_register_trigger (const std::string &name, const char *functionbase, T *obj, void(T::*function)(), const char *desc_="", priv_lvl_t minpriv_=RPC_PRIVLVL_MIN) | |
Adds the ability to trigger a function over ControlPort. More... | |
~rpcbasic_register_trigger () override | |
std::string | description () const |
priv_lvl_t | privilege_level () const |
void | description (std::string d) |
void | privilege_level (priv_lvl_t p) |
Public Member Functions inherited from rpcbasic_base | |
rpcbasic_base () | |
virtual | ~rpcbasic_base () |
Registers a 'trigger' function to trigger an action over ControlPort.
This class allows us to set up triggered events or function calls over ControlPort. When used from a ControlPort client, the function
established here will be activated. Generally, this is meant to enable some kind of trigger or action that a block or object will perform, such as a reset, start, stop, etc.
Simpler than the rpcbasic_register_set class, the constructor here only takes a few parameters, mostly because there is not actual variable associated with these function calls. It takes in the information to set up the pointer to the object that has the function
, a ControlPort name (functionbase
) for the triggered action, a description (desc_
), and a privilege level (minpriv_
).
|
inline |
Adds the ability to trigger a function over ControlPort.
This constructor is specifically for gr::block's to use to add trigger functions to ControlPort. Generally meant to be used in gr::block::setup_rpc.
Uses the block's alias to create the ControlPort interface. This alias is cross-referenced by the global_block_registry (static variable of type gr::block_registry) to get the pointer to the block.
block_alias | Block's alias; use alias() to get it from the block. |
functionbase | The name of the function that we'll access over ControlPort |
function | A function pointer to the real function accessed when called something like: &[block class]::set_[variable] |
desc_ | A string to describing the variable. |
minpriv_ | The required minimum privilege level |
References gr::block_registry::block_lookup(), rpcmanager::get(), global_block_registry, rpcserver_booter_base::i(), pmt::intern(), and rpcserver_base::registerConfigureCallback().
|
inline |
Adds the ability to trigger a function over ControlPort.
Allows us to add non gr::block related objects to ControlPort. Instead of using the block's alias, we give it a name
and the actual pointer to the object as obj
. We just need to make sure that the pointer to this object is always valid.
name | Name of the object being set up for ControlPort access |
functionbase | The name of the function that we'll access over ControlPort |
obj | A pointer to the object itself |
function | A function pointer to the real function accessed when called something like: &[block class]::set_[variable] |
desc_ | A string to describing the variable. |
minpriv_ | The required minimum privilege level |
References rpcmanager::get(), rpcserver_booter_base::i(), and rpcserver_base::registerConfigureCallback().
|
inlineoverride |
|
inline |
|
inline |
|
inline |
|
inline |