template<typename T>
struct rpcbasic_register_trigger< T >
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_
).
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.
- Parameters
-
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 rpcmanager::get(), global_block_registry, rpcserver_booter_base::i(), pmt::intern(), rpcserver_base::registerConfigureCallback(), and RPC_PRIVLVL_MIN.