GNU Radio C++ API Reference: rpcbasic_register_variable< Tfrom > Class Template Reference

| GNU Radio C++ API Reference 3.10.12.0 The Free & Open Software Radio Ecosystem |

Loading...
Searching...
No Matches
rpcbasic_register_variable< Tfrom > Class Template Reference

Registers a read-only function to get a parameter over ControlPort. More...

`#include <gnuradio/rpcregisterhelpers.h>`

## Public Member Functions
void | setptr (Tfrom *_variable)
| rpcbasic_register_variable ()
| rpcbasic_register_variable (const std::string &namebase, const char *functionbase, Tfrom *variable, const pmt::pmt_t &min, const pmt::pmt_t &max, const pmt::pmt_t &def, const char *units_="", const char *desc_="", priv_lvl_t minpriv_=RPC_PRIVLVL_MIN, DisplayType display_=DISPNULL)
| Adds the ability to get the variable over ControlPort.
Public Member Functions inherited from rpcbasic_base
| rpcbasic_base ()
virtual | ~rpcbasic_base ()

## Protected Member Functions
Tfrom | get ()

## Protected Attributes
rpcbasic_register_get< rpcbasic_register_variable< Tfrom >, Tfrom > | d_rpc_reg
Tfrom * | d_variable

## Detailed Description

template<typename Tfrom>
class rpcbasic_register_variable< Tfrom >

Registers a read-only function to get a parameter over ControlPort.

This class allows us to remotely get a value or parameter of the block over ControlPort. Unlike the rpcbasic_register_get class, this version is passed the variable directly and establishes a getter for us, so there is no need to have a getter function already in the object.

This version is for read-only get access.

We can set the (expected) minimum (`min`), maximum (`max`), and default (`def`) of the variables we will get. These values are not enforced, however, but can be useful for setting up graphs and other ways of bounding the data.

This class also allows us to provide information to the user about the variable, such as an appropriate unit (`units_`) as well as a description (`desc_`) about what the variable does.

The privilege (`minpriv_`) level is the minimum privilege level a remote must identify with to be able to call this function.

We also provide display hints (`display_`), which can be used by the ControlPort client application to know how to best display or even print the data. This is a mask of options for variables set in rpccallbackregister_base.h. The mask is defined by one of the "DisplayType Plotting Types" and or'd with any of the "DisplayType Options" features. See "Display Options" in ControlPort for details.

## Constructor & Destructor Documentation

## ◆ rpcbasic_register_variable() [1/2]

template<typename Tfrom>

rpcbasic_register_variable< Tfrom >::rpcbasic_register_variable | ( |  | ) |
| inline

Empty constructor which should never be called but needs to exist for us in various STL data structures

References d_rpc_reg, d_variable, DISPNULL, get(), PMT_NIL, RPC_PRIVLVL_MIN, and rpcbasic_register_variable().

Referenced by rpcbasic_register_variable(), rpcbasic_register_variable(), rpcbasic_register_variable_rw< Tfrom >::rpcbasic_register_variable_rw(), and rpcbasic_register_variable_rw< Tfrom >::rpcbasic_register_variable_rw().

## ◆ rpcbasic_register_variable() [2/2]

template<typename Tfrom>

rpcbasic_register_variable< Tfrom >::rpcbasic_register_variable | ( | const std::string & | namebase,
|  | const char * | functionbase,
|  | Tfrom * | variable,
|  | const pmt::pmt_t & | min,
|  | const pmt::pmt_t & | max,
|  | const pmt::pmt_t & | def,
|  | const char * | units_ = "",
|  | const char * | desc_ = "",
|  | priv_lvl_t | minpriv_ = RPC_PRIVLVL_MIN,
|  | DisplayType | display_ = DISPNULL )
| inline

Adds the ability to get the variable over ControlPort.

Creates a new getter accessor function to read `variable`.

Parameters

  namebase | Name of the object being set up for ControlPort access
  functionbase | The name of the function that we'll access over ControlPort
  variable | A pointer to the variable, possibly as a member of a class
  min | Expected minimum value the parameter can hold
  max | Expected maximum value the parameter can hold
  def | Expected default value the parameter can hold
  units_ | A string to describe what units to represent the variable with
  desc_ | A string to describe the variable.
  minpriv_ | The required minimum privilege level
  display_ | The display mask

References d_rpc_reg, d_variable, DISPNULL, get(), RPC_PRIVLVL_MIN, and rpcbasic_register_variable().

## Member Function Documentation

## ◆ get()

template<typename Tfrom>

Tfrom rpcbasic_register_variable< Tfrom >::get | ( |  | ) |
| inlineprotected

References d_variable.

Referenced by rpcbasic_register_variable(), rpcbasic_register_variable(), and rpcbasic_register_variable_rw< Tfrom >::rpcbasic_register_variable_rw().

## ◆ setptr()

template<typename Tfrom>

void rpcbasic_register_variable< Tfrom >::setptr | ( | Tfrom * | _variable | ) |
| inline

References d_variable.

## Member Data Documentation

## ◆ d_rpc_reg

template<typename Tfrom>

rpcbasic_register_get<rpcbasic_register_variable<Tfrom>, Tfrom> rpcbasic_register_variable< Tfrom >::d_rpc_reg
| protected

Referenced by rpcbasic_register_variable(), and rpcbasic_register_variable().

## ◆ d_variable

template<typename Tfrom>

Tfrom* rpcbasic_register_variable< Tfrom >::d_variable
| protected

Referenced by get(), rpcbasic_register_variable(), rpcbasic_register_variable(), rpcbasic_register_variable_rw< Tfrom >::set(), and setptr().

The documentation for this class was generated from the following file:

- rpcregisterhelpers.h