Loading...
Searching...
No Matches
rpcregisterhelpers.h
Go to the documentation of this file.
/* -*- c++ -*- */
/*
* Copyright 2012,2014 Free Software Foundation, Inc.
*
* This file is part of GNU Radio
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
*/
#ifndef RPCREGISTERHELPERS_H
#define RPCREGISTERHELPERS_H
#include <gnuradio/rpcmanager.h>
#include <gnuradio/rpcserver_base.h>
#include <gnuradio/rpcserver_booter_base.h>
#include <gnuradio/rpcserver_selector.h>
#include <sstream>
// Fixes circular dependency issue before including block_registry.h
class rpcbasic_base;
typedef std::shared_ptr<rpcbasic_base> rpcbasic_sptr;
#include <gnuradio/block_registry.h>
/*********************************************************************
* RPC Extractor Base Classes
********************************************************************/
/*!
*\brief Base class for registering a ControlPort Extractor. Acts as
* a message acceptor.
*/
template <typename T, typename Tto>
class rpcextractor_base : public virtual gr::messages::msg_accepter
{
public:
rpcextractor_base(T* source, void (T::*func)(Tto)) : _source(source), _func(func)
{
;
}
~rpcextractor_base() override { ; }
void post(pmt::pmt_t which_port, pmt::pmt_t msg) override
{
(void)which_port;
(void)msg;
throw std::runtime_error(
"rpcextractor_base: no post defined for this data type.");
}
protected:
T* _source;
void (T::*_func)(Tto);
};
template <typename T>
class rpcextractor_base<T, void> : public virtual gr::messages::msg_accepter
{
public:
rpcextractor_base(T* source, void (T::*func)()) : _source(source), _func(func) { ; }
~rpcextractor_base() override { ; }
void post(pmt::pmt_t which_port, pmt::pmt_t msg) override
{
(void)which_port;
(void)msg;
throw std::runtime_error(
"rpcextractor_base: no post defined for this data type.");
}
protected:
T* _source;
void (T::*_func)();
};
/*!
* \brief Templated parent class for registering a ControlPort Extractor.
*/
template <typename T, typename Tto>
class rpcbasic_extractor : public virtual rpcextractor_base<T, Tto>
{
public:
rpcbasic_extractor(T* source, void (T::*func)(Tto))
: rpcextractor_base<T, Tto>(source, func)
{
;
}
};
/*********************************************************************
* RPC Inserter Base Classes
********************************************************************/
/*!
* \brief Base class for registering a ControlPort Inserter. Produces a
* message.
*/
template <typename T, typename Tfrom>
class rpcinserter_base : public virtual gr::messages::msg_producer
{
public:
rpcinserter_base(T* source, Tfrom (T::*func)()) : _source(source), _func(func) { ; }
rpcinserter_base() { ; }
pmt::pmt_t retrieve() override
{
assert(0);
return pmt::pmt_t();
}
protected:
T* _source;
Tfrom (T::*_func)();
};
/*!
* \brief Templated parent class for registering a ControlPort
* Inserter.
*/
template <typename T, typename Tfrom>
class rpcbasic_inserter : public virtual rpcinserter_base<T, Tfrom>
{
public:
rpcbasic_inserter(T* source, Tfrom (T::*func)() const)
: rpcinserter_base<T, Tfrom>(source, func)
{
;
}
rpcbasic_inserter(T* source, Tfrom (T::*func)())
: rpcinserter_base<T, Tfrom>(source, func)
{
;
}
pmt::pmt_t retrieve()
{
return pmt::mp(
(rpcinserter_base<T, Tfrom>::_source->*rpcinserter_base<T, Tfrom>::_func)());
}
};
/*********************************************************************
* RPC Handler Base Classes
********************************************************************/
/*!
*\brief Base class for registering a ControlPort Handler. Acts as
* a message acceptor.
*/
template <typename T>
class rpchandler_base : public virtual gr::messages::msg_accepter
{
public:
rpchandler_base(T* source, const char* handler) : _source(source), _handler(handler)
{
;
}
~rpchandler_base() override { ; }
void post(pmt::pmt_t which_port, pmt::pmt_t msg) override
{
_source->post(which_port, msg);
}
protected:
T* _source;
const char* _handler;
};
/*!
* \brief Templated parent class for registering a ControlPort Extractor.
*/
template <typename T>
class rpcbasic_handler : public virtual rpchandler_base<T>
{
public:
rpcbasic_handler(T* source, const char* handler) : rpchandler_base<T>(source, handler)
{
;
}
};
/*********************************************************************
* RPC Specialized Extractors
********************************************************************/
/*!
* \brief Specialized extractor class to make calls to functions that
* do not take data (enable, reset, start, etc.).
*/
template <typename T>
class rpcbasic_extractor<T, void> : public virtual rpcextractor_base<T, void>
{
public:
rpcbasic_extractor(T* source, void (T::*func)())
: rpcextractor_base<T, void>(source, func)
{
;
}
void post(pmt::pmt_t which_port, pmt::pmt_t msg)
{
(void)which_port;
(void)msg;
(rpcextractor_base<T, void>::_source->*rpcextractor_base<T, void>::_func)();
}
};
/*!
* \brief Specialized extractor class for char data.
*/
template <typename T>
class rpcbasic_extractor<T, char> : public virtual rpcextractor_base<T, char>
{
public:
rpcbasic_extractor(T* source, void (T::*func)(char))
: rpcextractor_base<T, char>(source, func)
{
;
}
void post(pmt::pmt_t which_port, pmt::pmt_t msg)
{
(void)which_port;
(rpcextractor_base<T, char>::_source->*rpcextractor_base<T, char>::_func)(
static_cast<char>(pmt::to_long(msg)));
}
};
/*!
* \brief Specialized extractor class for short data.
*/
template <typename T>
class rpcbasic_extractor<T, short> : public virtual rpcextractor_base<T, short>
{
public:
rpcbasic_extractor(T* source, void (T::*func)(short))
: rpcextractor_base<T, short>(source, func)
{
;
}
void post(pmt::pmt_t which_port, pmt::pmt_t msg)
{
(void)which_port;
(rpcextractor_base<T, short>::_source->*rpcextractor_base<T, short>::_func)(
static_cast<short>(pmt::to_long(msg)));
}
};
/*!
* \brief Specialized extractor class for double data.
*/
template <typename T>
class rpcbasic_extractor<T, double> : public virtual rpcextractor_base<T, double>
{
public:
rpcbasic_extractor(T* source, void (T::*func)(double))
: rpcextractor_base<T, double>(source, func)
{
;
}
void post(pmt::pmt_t which_port, pmt::pmt_t msg)
{
(void)which_port;
(rpcextractor_base<T, double>::_source->*rpcextractor_base<T, double>::_func)(
pmt::to_double(msg));
}
};
/*!
* \brief Specialized extractor class for float data.
*/
template <typename T>
class rpcbasic_extractor<T, float> : public virtual rpcextractor_base<T, float>
{
public:
rpcbasic_extractor(T* source, void (T::*func)(float))
: rpcextractor_base<T, float>(source, func)
{
;
}
void post(pmt::pmt_t which_port, pmt::pmt_t msg)
{
(void)which_port;
(rpcextractor_base<T, float>::_source->*rpcextractor_base<T, float>::_func)(
pmt::to_double(msg));
}
};
/*!
* \brief Specialized extractor class for long data.
*/
template <typename T>
class rpcbasic_extractor<T, long> : public virtual rpcextractor_base<T, long>
{
public:
rpcbasic_extractor(T* source, void (T::*func)(long))
: rpcextractor_base<T, long>(source, func)
{
;
}
void post(pmt::pmt_t which_port, pmt::pmt_t msg)
{
(void)which_port;
(rpcextractor_base<T, long>::_source->*rpcextractor_base<T, long>::_func)(
pmt::to_long(msg));
}
};
/*!
* \brief Specialized extractor class for int data.
*/
template <typename T>
class rpcbasic_extractor<T, int> : public virtual rpcextractor_base<T, int>
{
public:
rpcbasic_extractor(T* source, void (T::*func)(int))
: rpcextractor_base<T, int>(source, func)
{
;
}
void post(pmt::pmt_t which_port, pmt::pmt_t msg)
{
(void)which_port;
(rpcextractor_base<T, int>::_source->*rpcextractor_base<T, int>::_func)(
pmt::to_long(msg));
}
};
/*!
* \brief Specialized extractor class for bool data.
*/
template <typename T>
class rpcbasic_extractor<T, bool> : public virtual rpcextractor_base<T, bool>
{
public:
rpcbasic_extractor(T* source, void (T::*func)(bool))
: rpcextractor_base<T, bool>(source, func)
{
;
}
void post(pmt::pmt_t which_port, pmt::pmt_t msg)
{
(void)which_port;
(rpcextractor_base<T, bool>::_source->*rpcextractor_base<T, bool>::_func)(
pmt::to_bool(msg));
}
};
/*!
* \brief Specialized extractor class for complex (float) data.
*/
template <typename T>
class rpcbasic_extractor<T, std::complex<float>>
: public virtual rpcextractor_base<T, std::complex<float>>
{
public:
rpcbasic_extractor(T* source, void (T::*func)(std::complex<float>))
: rpcextractor_base<T, std::complex<float>>(source, func)
{
;
}
void post(pmt::pmt_t which_port, pmt::pmt_t msg)
{
(void)which_port;
std::complex<float> k = static_cast<std::complex<float>>(pmt::to_complex(msg));
(rpcextractor_base<T, std::complex<float>>::_source
->*rpcextractor_base<T, std::complex<float>>::_func)(k);
}
};
/*!
* \brief Specialized extractor class for complex (double) data.
*/
template <typename T>
class rpcbasic_extractor<T, std::complex<double>>
: public virtual rpcextractor_base<T, std::complex<double>>
{
public:
rpcbasic_extractor(T* source, void (T::*func)(std::complex<double>))
: rpcextractor_base<T, std::complex<double>>(source, func)
{
;
}
void post(pmt::pmt_t which_port, pmt::pmt_t msg)
{
(void)which_port;
(rpcextractor_base<T, std::complex<double>>::_source
->*rpcextractor_base<T, std::complex<double>>::_func)(pmt::to_complex(msg));
}
};
/*!
* \brief Specialized extractor class for string data.
*/
template <typename T>
class rpcbasic_extractor<T, std::string>
: public virtual rpcextractor_base<T, std::string>
{
public:
rpcbasic_extractor(T* source, void (T::*func)(std::string))
: rpcextractor_base<T, std::string>(source, func)
{
;
}
void post(pmt::pmt_t which_port, pmt::pmt_t msg)
{
(void)which_port;
(rpcextractor_base<T, std::string>::_source
->*rpcextractor_base<T, std::string>::_func)(pmt::symbol_to_string(msg));
}
};
/*********************************************************************
* RPC Specialized Inserters
********************************************************************/
/*!
* \brief Specialized inserter class for uint64_t data.
*/
template <typename T>
class rpcbasic_inserter<T, uint64_t> : public virtual rpcinserter_base<T, uint64_t>
{
public:
rpcbasic_inserter(T* source, uint64_t (T::*func)() const)
: rpcinserter_base<T, uint64_t>(source, func)
{
;
}
rpcbasic_inserter(T* source, uint64_t (T::*func)())
: rpcinserter_base<T, uint64_t>(source, func)
{
;
}
pmt::pmt_t retrieve()
{
return pmt::from_uint64((rpcinserter_base<T, uint64_t>::_source
->*rpcinserter_base<T, uint64_t>::_func)());
}
};
/*!
* \brief Specialized inserter class for vectors of signed char data.
*/
template <typename T>
class rpcbasic_inserter<T, std::vector<signed char>>
: public virtual rpcinserter_base<T, std::vector<signed char>>
{
public:
rpcbasic_inserter(T* source, std::vector<signed char> (T::*func)() const)
: rpcinserter_base<T, std::vector<signed char>>(source, func)
{
;
}
rpcbasic_inserter(T* source, std::vector<signed char> (T::*func)())
: rpcinserter_base<T, std::vector<signed char>>(source, func)
{
;
}
pmt::pmt_t retrieve()
{
std::vector<signed char> vec(
(rpcinserter_base<T, std::vector<signed char>>::_source
->*rpcinserter_base<T, std::vector<signed char>>::_func)());
return pmt::init_s8vector(vec.size(), &vec[0]);
}
};
/*!
* \brief Specialized inserter class for vectors of short data.
*/
template <typename T>
class rpcbasic_inserter<T, std::vector<short>>
: public virtual rpcinserter_base<T, std::vector<short>>
{
public:
rpcbasic_inserter(T* source, std::vector<short> (T::*func)() const)
: rpcinserter_base<T, std::vector<short>>(source, func)
{
;
}
rpcbasic_inserter(T* source, std::vector<short> (T::*func)())
: rpcinserter_base<T, std::vector<short>>(source, func)
{
;
}
pmt::pmt_t retrieve()
{
std::vector<short> vec((rpcinserter_base<T, std::vector<short>>::_source
->*rpcinserter_base<T, std::vector<short>>::_func)());
return pmt::init_s16vector(vec.size(), &vec[0]);
}
};
/*!
* \brief Specialized inserter class for vectors of int data.
*/
template <typename T>
class rpcbasic_inserter<T, std::vector<int>>
: public virtual rpcinserter_base<T, std::vector<int>>
{
public:
rpcbasic_inserter(T* source, std::vector<int> (T::*func)() const)
: rpcinserter_base<T, std::vector<int>>(source, func)
{
;
}
rpcbasic_inserter(T* source, std::vector<int> (T::*func)())
: rpcinserter_base<T, std::vector<int>>(source, func)
{
;
}
pmt::pmt_t retrieve()
{
std::vector<int> vec((rpcinserter_base<T, std::vector<int>>::_source
->*rpcinserter_base<T, std::vector<int>>::_func)());
return pmt::init_s32vector(vec.size(), &vec[0]);
}
};
/*!
* \brief Specialized inserter class for vectors of int64_t data.
*/
template <typename T>
class rpcbasic_inserter<T, std::vector<int64_t>>
: public virtual rpcinserter_base<T, std::vector<int64_t>>
{
public:
rpcbasic_inserter(T* source, std::vector<int64_t> (T::*func)() const)
: rpcinserter_base<T, std::vector<int64_t>>(source, func)
{
;
}
rpcbasic_inserter(T* source, std::vector<int64_t> (T::*func)())
: rpcinserter_base<T, std::vector<int64_t>>(source, func)
{
;
}
pmt::pmt_t retrieve()
{
std::vector<int64_t> vec(
(rpcinserter_base<T, std::vector<int64_t>>::_source
->*rpcinserter_base<T, std::vector<int64_t>>::_func)());
return pmt::init_s64vector(vec.size(), &vec[0]);
}
};
/*!
* \brief Specialized inserter class for vectors of complex (float) data.
*/
template <typename T>
class rpcbasic_inserter<T, std::vector<std::complex<float>>>
: public virtual rpcinserter_base<T, std::vector<std::complex<float>>>
{
public:
rpcbasic_inserter(T* source, std::vector<std::complex<float>> (T::*func)() const)
: rpcinserter_base<T, std::vector<std::complex<float>>>(source, func)
{
;
}
rpcbasic_inserter(T* source, std::vector<std::complex<float>> (T::*func)())
: rpcinserter_base<T, std::vector<std::complex<float>>>(source, func)
{
;
}
pmt::pmt_t retrieve()
{
std::vector<std::complex<float>> vec(
(rpcinserter_base<T, std::vector<std::complex<float>>>::_source
->*rpcinserter_base<T, std::vector<std::complex<float>>>::_func)());
return pmt::init_c32vector(vec.size(), &vec[0]);
}
};
/*!
* \brief Specialized inserter class for vectors of float data.
*/
template <typename T>
class rpcbasic_inserter<T, std::vector<float>>
: public virtual rpcinserter_base<T, std::vector<float>>
{
public:
rpcbasic_inserter(T* source, std::vector<float> (T::*func)() const)
: rpcinserter_base<T, std::vector<float>>(source, func)
{
;
}
rpcbasic_inserter(T* source, std::vector<float> (T::*func)())
: rpcinserter_base<T, std::vector<float>>(source, func)
{
;
}
pmt::pmt_t retrieve()
{
std::vector<float> vec((rpcinserter_base<T, std::vector<float>>::_source
->*rpcinserter_base<T, std::vector<float>>::_func)());
return pmt::init_f32vector(vec.size(), &vec[0]);
}
};
/*!
* \brief Specialized inserter class for vectors of uint8_t data.
*/
template <typename T>
class rpcbasic_inserter<T, std::vector<uint8_t>>
: public virtual rpcinserter_base<T, std::vector<uint8_t>>
{
public:
rpcbasic_inserter(T* source, std::vector<uint8_t> (T::*func)() const)
: rpcinserter_base<T, std::vector<uint8_t>>(source, func)
{
;
}
rpcbasic_inserter(T* source, std::vector<uint8_t> (T::*func)())
: rpcinserter_base<T, std::vector<uint8_t>>(source, func)
{
;
}
pmt::pmt_t retrieve()
{
std::vector<uint8_t> vec(
(rpcinserter_base<T, std::vector<uint8_t>>::_source
->*rpcinserter_base<T, std::vector<uint8_t>>::_func)());
return pmt::init_u8vector(vec.size(), &vec[0]);
}
};
/*!
* \brief Specialized inserter class for complex (float) data.
*/
template <typename T>
class rpcbasic_inserter<T, std::complex<float>>
: public virtual rpcinserter_base<T, std::complex<float>>
{
public:
rpcbasic_inserter(T* source, std::complex<float> (T::*func)() const)
: rpcinserter_base<T, std::complex<float>>(source, func)
{
;
}
rpcbasic_inserter(T* source, std::complex<float> (T::*func)())
: rpcinserter_base<T, std::complex<float>>(source, func)
{
;
}
pmt::pmt_t retrieve()
{
std::complex<float> k((rpcinserter_base<T, std::complex<float>>::_source
->*rpcinserter_base<T, std::complex<float>>::_func)());
return pmt::from_complex(k);
}
};
/*!
* \brief Specialized inserter class for complex (double) data.
*/
template <typename T>
class rpcbasic_inserter<T, std::complex<double>>
: public virtual rpcinserter_base<T, std::complex<double>>
{
public:
rpcbasic_inserter(T* source, std::complex<double> (T::*func)() const)
: rpcinserter_base<T, std::complex<double>>(source, func)
{
;
}
rpcbasic_inserter(T* source, std::complex<double> (T::*func)())
: rpcinserter_base<T, std::complex<double>>(source, func)
{
;
}
pmt::pmt_t retrieve()
{
std::complex<double> k(
(rpcinserter_base<T, std::complex<double>>::_source
->*rpcinserter_base<T, std::complex<double>>::_func)());
return pmt::from_complex(k);
}
};
/*!
* \brief Base class for registering a ControlPort function.
*/
template <typename T>
struct rpc_register_base {
rpc_register_base() { count++; }
protected:
static int count;
};
/*!
* Base class to inherit from and create universal shared pointers.
*/
class rpcbasic_base
{
public:
rpcbasic_base() {}
virtual ~rpcbasic_base(){};
};
/*********************************************************************
* RPC Register Set Classes
********************************************************************/
/*!
* \brief Registers a 'set' function to set a parameter over
* ControlPort.
*
* \details
*
* This class allows us to remotely set a value or parameter of the
* block over ControlPort. The set occurs by calling a setter accessor
* function of the class, usually set_[variable](), which is passed in
* as \p function.
*
* We can set the (expected) minimum (\p min), maximum (\p max), and
* default (\p def) of the variables being set. 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 being set, such as an appropriate unit (\p units_) as
* well as a description (\p desc_) about what the variable does.
*
* The privilege (\p minpriv_) level is the minimum privilege level a
* remote must identify with to be able to call this function.
*
* We also provide display hints (\p 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 \ref page_ctrlport for
* details.
*/
template <typename T, typename Tto>
struct rpcbasic_register_set : public rpcbasic_base {
/*!
* \brief Adds the ability to set the variable over ControlPort.
*
* \details
*
* This constructor is specifically for gr::block's to use to add
* settable variables 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.
*
* \param block_alias Block's alias; use alias() to get it from the block.
* \param functionbase The name of the function that we'll access over ControlPort
* \param function A function pointer to the real function accessed when called
* something like: &[block class]\::set_[variable]()
* \param min Expected minimum value the parameter can hold
* \param max Expected maximum value the parameter can hold
* \param def Expected default value the parameter can hold
* \param units_ A string to describe what units to represent the variable with
* \param desc_ A string to describing the variable.
* \param minpriv_ The required minimum privilege level
* \param display_ The display mask
*/
rpcbasic_register_set(const std::string& block_alias,
const char* functionbase,
void (T::*function)(Tto),
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)
{
d_min = min;
d_max = max;
d_def = def;
d_units = units_;
d_desc = desc_;
d_minpriv = minpriv_;
d_display = display_;
d_object = dynamic_cast<T*>(
global_block_registry.block_lookup(pmt::intern(block_alias)).get());
#ifdef GR_RPCSERVER_ENABLED
callbackregister_base::configureCallback_t extractor(
new rpcbasic_extractor<T, Tto>(d_object, function),
minpriv_,
std::string(units_),
display_,
std::string(desc_),
min,
max,
def);
std::ostringstream oss(std::ostringstream::out);
oss << block_alias << "::" << functionbase;
d_id = oss.str();
// std::cerr << "REGISTERING SET: " << d_id << " " << desc_ << std::endl;
rpcmanager::get()->i()->registerConfigureCallback(d_id, extractor);
#endif
}
/*!
* \brief Adds the ability to set the variable over ControlPort.
*
* \details
*
* Allows us to add non gr::block related objects to
* ControlPort. Instead of using the block's alias, we give it a \p
* name and the actual pointer to the object as \p obj. We just need
* to make sure that the pointer to this object is always valid.
*
* \param name Name of the object being set up for ControlPort access
* \param functionbase The name of the function that we'll access over ControlPort
* \param obj A pointer to the object itself
* \param function A function pointer to the real function accessed when called
* something like: &[block class]\::set_[variable]()
* \param min Expected minimum value the parameter can hold
* \param max Expected maximum value the parameter can hold
* \param def Expected default value the parameter can hold
* \param units_ A string to describe what units to represent the variable with
* \param desc_ A string to describing the variable.
* \param minpriv_ The required minimum privilege level
* \param display_ The display mask
*/
rpcbasic_register_set(const std::string& name,
const char* functionbase,
T* obj,
void (T::*function)(Tto),
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)
{
d_min = min;
d_max = max;
d_def = def;
d_units = units_;
d_desc = desc_;
d_minpriv = minpriv_;
d_display = display_;
d_object = obj;
#ifdef GR_RPCSERVER_ENABLED
callbackregister_base::configureCallback_t extractor(
new rpcbasic_extractor<T, Tto>(d_object, function),
minpriv_,
std::string(units_),
display_,
std::string(desc_),
min,
max,
def);
std::ostringstream oss(std::ostringstream::out);
oss << name << "::" << functionbase;
d_id = oss.str();
// std::cerr << "REGISTERING SET: " << d_id << " " << desc_ << std::endl;
rpcmanager::get()->i()->registerConfigureCallback(d_id, extractor);
#endif
}
~rpcbasic_register_set() override
{
#ifdef GR_RPCSERVER_ENABLED
rpcmanager::get()->i()->unregisterConfigureCallback(d_id);
#endif
}
pmt::pmt_t min() const { return d_min; }
pmt::pmt_t max() const { return d_max; }
pmt::pmt_t def() const { return d_def; }
std::string units() const { return d_units; }
std::string description() const { return d_desc; }
priv_lvl_t privilege_level() const { return d_minpriv; }
DisplayType default_display() const { return d_display; }
void set_min(pmt::pmt_t p) { d_min = p; }
void set_max(pmt::pmt_t p) { d_max = p; }
void set_def(pmt::pmt_t p) { d_def = p; }
void units(std::string u) { d_units = u; }
void description(std::string d) { d_desc = d; }
void privilege_level(priv_lvl_t p) { d_minpriv = p; }
void default_display(DisplayType d) { d_display = d; }
private:
std::string d_id;
pmt::pmt_t d_min, d_max, d_def;
std::string d_units, d_desc;
priv_lvl_t d_minpriv;
DisplayType d_display;
T* d_object;
};
/*********************************************************************
* RPC Register Trigger Classes
********************************************************************/
/*!
* \brief Registers a 'trigger' function to trigger an action over
* ControlPort.
*
* \details
*
* This class allows us to set up triggered events or function calls
* over ControlPort. When used from a ControlPort client, the \p
* 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 \p
* function, a ControlPort name (\p functionbase) for the triggered
* action, a description (\p desc_), and a privilege level (\p
* minpriv_).
*/
template <typename T>
struct rpcbasic_register_trigger : public rpcbasic_base {
/*!
* \brief Adds the ability to trigger a function over ControlPort.
*
* \details
*
* 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.
*
* \param block_alias Block's alias; use alias() to get it from the block.
* \param functionbase The name of the function that we'll access over ControlPort
* \param function A function pointer to the real function accessed when called
* something like: &[block class]\::set_[variable]
* \param desc_ A string to describing the variable.
* \param minpriv_ The required minimum privilege level
*/
rpcbasic_register_trigger(const std::string& block_alias,
const char* functionbase,
void (T::*function)(),
const char* desc_ = "",
priv_lvl_t minpriv_ = RPC_PRIVLVL_MIN)
{
d_desc = desc_;
d_minpriv = minpriv_;
d_object = dynamic_cast<T*>(
global_block_registry.block_lookup(pmt::intern(block_alias)).get());
#ifdef GR_RPCSERVER_ENABLED
callbackregister_base::configureCallback_t extractor(
new rpcbasic_extractor<T, void>(d_object, function),
minpriv_,
std::string(desc_));
std::ostringstream oss(std::ostringstream::out);
oss << block_alias << "::" << functionbase;
d_id = oss.str();
// std::cerr << "REGISTERING TRIGGER: " << d_id << " " << desc_ << std::endl;
rpcmanager::get()->i()->registerConfigureCallback(d_id, extractor);
#endif
}
/*!
* \brief Adds the ability to trigger a function over ControlPort.
*
* \details
*
* Allows us to add non gr::block related objects to
* ControlPort. Instead of using the block's alias, we give it a \p
* name and the actual pointer to the object as \p obj. We just need
* to make sure that the pointer to this object is always valid.
*
* \param name Name of the object being set up for ControlPort access
* \param functionbase The name of the function that we'll access over ControlPort
* \param obj A pointer to the object itself
* \param function A function pointer to the real function accessed when called
* something like: &[block class]\::set_[variable]
* \param desc_ A string to describing the variable.
* \param minpriv_ The required minimum privilege level
*/
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)
{
d_desc = desc_;
d_minpriv = minpriv_;
d_object = obj;
#ifdef GR_RPCSERVER_ENABLED
callbackregister_base::configureCallback_t extractor(
new rpcbasic_extractor<T, void>(d_object, function),
minpriv_,
std::string(desc_));
std::ostringstream oss(std::ostringstream::out);
oss << name << "::" << functionbase;
d_id = oss.str();
// std::cerr << "REGISTERING TRIGGER: " << d_id << " " << desc_ << std::endl;
rpcmanager::get()->i()->registerConfigureCallback(d_id, extractor);
#endif
}
~rpcbasic_register_trigger() override
{
#ifdef GR_RPCSERVER_ENABLED
rpcmanager::get()->i()->unregisterConfigureCallback(d_id);
#endif
}
std::string description() const { return d_desc; }
priv_lvl_t privilege_level() const { return d_minpriv; }
void description(std::string d) { d_desc = d; }
void privilege_level(priv_lvl_t p) { d_minpriv = p; }
private:
std::string d_id;
std::string d_desc;
priv_lvl_t d_minpriv;
T* d_object;
};
/*********************************************************************
* RPC Register Get Classes
********************************************************************/
/*!
* \brief Registers a 'get' function to get a parameter over
* ControlPort.
*
* \details
*
* This class allows us to remotely get a value or parameter of the
* block over ControlPort. The get occurs by calling a getter accessor
* function of the class, usually [variable](), which is passed in
* as \p function.
*
* We can set the (expected) minimum (\p min), maximum (\p max), and
* default (\p 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 (\p units_) as well as a
* description (\p desc_) about what the variable does.
*
* The privilege (\p minpriv_) level is the minimum privilege level a
* remote must identify with to be able to call this function.
*
* We also provide display hints (\p 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 \ref page_ctrlport for
* details.
*/
template <typename T, typename Tfrom>
class rpcbasic_register_get : public rpcbasic_base
{
public:
/*!
* \brief Adds the ability to get the variable over ControlPort.
*
* \details
*
* This constructor is specifically for gr::block's to use to add
* gettable variables 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.
*
* \param block_alias Block's alias; use alias() to get it from the block.
* \param functionbase The name of the function that we'll access over ControlPort
* \param function A function pointer to the real function accessed when called
* something like: &[block class]\::[variable]()
* \param min Expected minimum value the parameter can hold
* \param max Expected maximum value the parameter can hold
* \param def Expected default value the parameter can hold
* \param units_ A string to describe what units to represent the variable with
* \param desc_ A string to describing the variable.
* \param minpriv_ The required minimum privilege level
* \param display_ The display mask
*/
rpcbasic_register_get(const std::string& block_alias,
const char* functionbase,
Tfrom (T::*function)(),
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)
{
d_min = min;
d_max = max;
d_def = def;
d_units = units_;
d_desc = desc_;
d_minpriv = minpriv_;
d_display = display_;
d_object = dynamic_cast<T*>(
global_block_registry.block_lookup(pmt::intern(block_alias)).get());
#ifdef GR_RPCSERVER_ENABLED
callbackregister_base::queryCallback_t inserter(
new rpcbasic_inserter<T, Tfrom>(d_object, function),
minpriv_,
std::string(units_),
display_,
std::string(desc_),
min,
max,
def);
std::ostringstream oss(std::ostringstream::out);
oss << block_alias << "::" << functionbase;
d_id = oss.str();
// std::cerr << "REGISTERING GET: " << d_id << " " << desc_ << std::endl;
rpcmanager::get()->i()->registerQueryCallback(d_id, inserter);
#endif
}
/*!
* \brief Same as rpcbasic_register_get::rpcbasic_register_get that allows using
* '[variable]() const' getter functions.
*/
rpcbasic_register_get(const std::string& block_alias,
const char* functionbase,
Tfrom (T::*function)() const,
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)
{
d_min = min;
d_max = max;
d_def = def;
d_units = units_;
d_desc = desc_;
d_minpriv = minpriv_;
d_display = display_;
d_object = dynamic_cast<T*>(
global_block_registry.block_lookup(pmt::intern(block_alias)).get());
#ifdef GR_RPCSERVER_ENABLED
callbackregister_base::queryCallback_t inserter(
new rpcbasic_inserter<T, Tfrom>(d_object, (Tfrom(T::*)())function),
minpriv_,
std::string(units_),
display_,
std::string(desc_),
min,
max,
def);
std::ostringstream oss(std::ostringstream::out);
oss << block_alias << "::" << functionbase;
d_id = oss.str();
// std::cerr << "REGISTERING GET CONST: " << d_id << " " << desc_ << " " <<
// display_ << std::endl;
rpcmanager::get()->i()->registerQueryCallback(d_id, inserter);
#endif
}
/*!
* \brief Adds the ability to get the variable over ControlPort.
*
* \details
*
* Allows us to add non gr::block related objects to
* ControlPort. Instead of using the block's alias, we give it a \p
* name and the actual pointer to the object as \p obj. We just need
* to make sure that the pointer to this object is always valid.
*
* \param name Name of the object being set up for ControlPort access
* \param functionbase The name of the function that we'll access over ControlPort
* \param obj A pointer to the object itself
* \param function A function pointer to the real function accessed when called
* something like: &[block class]\::set_[variable]()
* \param min Expected minimum value the parameter can hold
* \param max Expected maximum value the parameter can hold
* \param def Expected default value the parameter can hold
* \param units_ A string to describe what units to represent the variable with
* \param desc_ A string to describing the variable.
* \param minpriv_ The required minimum privilege level
* \param display_ The display mask
*/
rpcbasic_register_get(const std::string& name,
const char* functionbase,
T* obj,
Tfrom (T::*function)(),
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)
{
d_min = min;
d_max = max;
d_def = def;
d_units = units_;
d_desc = desc_;
d_minpriv = minpriv_;
d_display = display_;
d_object = obj;
#ifdef GR_RPCSERVER_ENABLED
callbackregister_base::queryCallback_t inserter(
new rpcbasic_inserter<T, Tfrom>(d_object, function),
minpriv_,
std::string(units_),
display_,
std::string(desc_),
min,
max,
def);
std::ostringstream oss(std::ostringstream::out);
oss << name << "::" << functionbase;
d_id = oss.str();
// std::cerr << "REGISTERING GET: " << d_id << " " << desc_ << std::endl;
rpcmanager::get()->i()->registerQueryCallback(d_id, inserter);
#endif
}
/*!
* \brief Same as above that allows using '[variable]() const'
* getter functions.
*/
rpcbasic_register_get(const std::string& name,
const char* functionbase,
T* obj,
Tfrom (T::*function)() const,
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)
{
d_min = min;
d_max = max;
d_def = def;
d_units = units_;
d_desc = desc_;
d_minpriv = minpriv_;
d_display = display_;
d_object = obj;
#ifdef GR_RPCSERVER_ENABLED
callbackregister_base::queryCallback_t inserter(
new rpcbasic_inserter<T, Tfrom>(d_object, (Tfrom(T::*)())function),
minpriv_,
std::string(units_),
display_,
std::string(desc_),
min,
max,
def);
std::ostringstream oss(std::ostringstream::out);
oss << name << "::" << functionbase;
d_id = oss.str();
// std::cerr << "REGISTERING GET CONST: " << d_id << " " << desc_ << " " <<
// display_ << std::endl;
rpcmanager::get()->i()->registerQueryCallback(d_id, inserter);
#endif
}
~rpcbasic_register_get() override
{
#ifdef GR_RPCSERVER_ENABLED
rpcmanager::get()->i()->unregisterQueryCallback(d_id);
#endif
}
pmt::pmt_t min() const { return d_min; }
pmt::pmt_t max() const { return d_max; }
pmt::pmt_t def() const { return d_def; }
std::string units() const { return d_units; }
std::string description() const { return d_desc; }
priv_lvl_t privilege_level() const { return d_minpriv; }
DisplayType default_display() const { return d_display; }
void set_min(pmt::pmt_t p) { d_min = p; }
void set_max(pmt::pmt_t p) { d_max = p; }
void set_def(pmt::pmt_t p) { d_def = p; }
void units(std::string u) { d_units = u; }
void description(std::string d) { d_desc = d; }
void privilege_level(priv_lvl_t p) { d_minpriv = p; }
void default_display(DisplayType d) { d_display = d; }
private:
std::string d_id;
pmt::pmt_t d_min, d_max, d_def;
std::string d_units, d_desc;
priv_lvl_t d_minpriv;
DisplayType d_display;
T* d_object;
};
/*********************************************************************
* RPC Register Variable Classes
********************************************************************/
/*!
* \brief Registers a read-only function to get a parameter over ControlPort.
*
* \details
*
* 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 (\p min), maximum (\p max), and
* default (\p 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 (\p units_) as well as a
* description (\p desc_) about what the variable does.
*
* The privilege (\p minpriv_) level is the minimum privilege level a
* remote must identify with to be able to call this function.
*
* We also provide display hints (\p 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 \ref page_ctrlport for
* details.
*/
template <typename Tfrom>
class rpcbasic_register_variable : public rpcbasic_base
{
protected:
rpcbasic_register_get<rpcbasic_register_variable<Tfrom>, Tfrom> d_rpc_reg;
Tfrom* d_variable;
Tfrom get() { return *d_variable; }
public:
void setptr(Tfrom* _variable)
{
rpcbasic_register_variable<Tfrom>::d_variable = _variable;
}
/*! Empty constructor which should never be called but needs to
* exist for us in various STL data structures
*/
rpcbasic_register_variable()
: d_rpc_reg("FAIL",
"FAIL",
this,
&rpcbasic_register_variable::get,
pmt::PMT_NIL,
pmt::PMT_NIL,
pmt::PMT_NIL,
DISPNULL,
"FAIL",
"FAIL",
RPC_PRIVLVL_MIN),
d_variable(NULL)
{
throw std::runtime_error(
"ERROR: rpcbasic_register_variable called with no args. If this happens, "
"someone has tried to use rpcbasic_register_variable incorrectly.");
};
/*!
* \brief Adds the ability to get the variable over ControlPort.
*
* \details
*
* Creates a new getter accessor function to read \p variable.
*
* \param namebase Name of the object being set up for ControlPort access
* \param functionbase The name of the function that we'll access over ControlPort
* \param variable A pointer to the variable, possibly as a member of a class
* \param min Expected minimum value the parameter can hold
* \param max Expected maximum value the parameter can hold
* \param def Expected default value the parameter can hold
* \param units_ A string to describe what units to represent the variable with
* \param desc_ A string to describe the variable.
* \param minpriv_ The required minimum privilege level
* \param display_ The display mask
*/
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)
: d_rpc_reg(namebase,
functionbase,
this,
&rpcbasic_register_variable::get,
min,
max,
def,
units_,
desc_,
minpriv_,
display_),
d_variable(variable)
{
// std::cerr << "REGISTERING VAR: " << " " << desc_ << std::endl;
}
};
/*!
* \brief Registers a read/write function to get and set a parameter
* over ControlPort.
*
* \details
*
* This class allows us to remotely get and/or set 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 establishes both get and set functions and so provides
* read/write access to the variable.
*
* We can set the (expected) minimum (\p min), maximum (\p max), and
* default (\p 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 (\p units_) as well as a
* description (\p desc_) about what the variable does.
*
* The privilege (\p minpriv_) level is the minimum privilege level a
* remote must identify with to be able to call this function.
*
* We also provide display hints (\p 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 \ref page_ctrlport for
* details.
*/
template <typename Tfrom>
class rpcbasic_register_variable_rw : public rpcbasic_register_variable<Tfrom>
{
private:
rpcbasic_register_set<rpcbasic_register_variable_rw<Tfrom>, Tfrom> d_rpc_regset;
public:
/*! Empty constructor which should never be called but needs to
* exist for us in various STL data structures.
*/
rpcbasic_register_variable_rw()
: d_rpc_regset("FAIL",
"FAIL",
this,
&rpcbasic_register_variable<Tfrom>::get,
pmt::PMT_NIL,
pmt::PMT_NIL,
pmt::PMT_NIL,
DISPNULL,
"FAIL",
"FAIL",
RPC_PRIVLVL_MIN)
{
throw std::runtime_error(
"ERROR: rpcbasic_register_variable_rw called with no args. if this happens "
"someone used rpcbasic_register_variable_rw incorrectly.");
};
void set(Tfrom _variable)
{
*(rpcbasic_register_variable<Tfrom>::d_variable) = _variable;
}
/*!
* \brief Adds the ability to set and get the variable over ControlPort.
*
* \details
*
* Creates new getter and setter accessor functions to read and write \p variable.
*
* \param namebase Name of the object being set up for ControlPort access
* \param functionbase The name of the function that we'll access over ControlPort
* \param variable A pointer to the variable, possibly as a member of a class
* \param min Expected minimum value the parameter can hold
* \param max Expected maximum value the parameter can hold
* \param def Expected default value the parameter can hold
* \param units_ A string to describe what units to represent the variable with
* \param desc_ A string to describing the variable.
* \param minpriv The required minimum privilege level
* \param display_ The display mask
*/
rpcbasic_register_variable_rw(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)
: rpcbasic_register_variable<Tfrom>(
namebase, functionbase, variable, min, max, def, units_, desc_),
d_rpc_regset(namebase,
functionbase,
this,
&rpcbasic_register_variable_rw::set,
min,
max,
def,
units_,
desc_,
minpriv,
display_)
{
// no action
}
};
/*!
* \brief Registers a message handler function to post a message to a
* block's handler.
*/
template <typename T>
class rpcbasic_register_handler : public rpcbasic_base
{
public:
/*!
* \brief Adds the ability to pass a message over ControlPort.
*
* \details
* This makes any message handler function available over
* ControlPort. Since message handlers always take in a single PMT
* message input, this interface provides a very generic way of
* setting values in a block in a flowgraph.
*
* \param block_alias Alias of the block
* \param handler The name of the message port in the block
* \param units_ A string to describe what units to represent the variable with
* \param desc_ A string to describing the variable.
* \param minpriv_ The required minimum privilege level
* \param display_ The display mask
*/
rpcbasic_register_handler(const std::string& block_alias,
const char* handler,
const char* units_ = "",
const char* desc_ = "",
priv_lvl_t minpriv_ = RPC_PRIVLVL_MIN,
DisplayType display_ = DISPNULL)
{
d_units = units_;
d_desc = desc_;
d_minpriv = minpriv_;
d_display = display_;
d_object = dynamic_cast<T*>(
global_block_registry.block_lookup(pmt::intern(block_alias)).get());
#ifdef GR_RPCSERVER_ENABLED
callbackregister_base::handlerCallback_t inserter(
new rpcbasic_handler<T>(d_object, handler),
minpriv_,
std::string(units_),
display_,
std::string(desc_),
0,
0,
0);
std::ostringstream oss(std::ostringstream::out);
oss << block_alias << "::" << handler;
d_id = oss.str();
// std::cerr << "REGISTERING GET: " << d_id << " " << desc_ << std::endl;
rpcmanager::get()->i()->registerHandlerCallback(d_id, inserter);
#endif
}
~rpcbasic_register_handler() override
{
#ifdef GR_RPCSERVER_ENABLED
rpcmanager::get()->i()->unregisterHandlerCallback(d_id);
#endif
}
std::string units() const { return d_units; }
std::string description() const { return d_desc; }
priv_lvl_t privilege_level() const { return d_minpriv; }
DisplayType default_display() const { return d_display; }
void units(std::string u) { d_units = u; }
void description(std::string d) { d_desc = d; }
void privilege_level(priv_lvl_t p) { d_minpriv = p; }
void default_display(DisplayType d) { d_display = d; }
private:
std::string d_id;
std::string d_units, d_desc;
priv_lvl_t d_minpriv;
DisplayType d_display;
T* d_object;
};
#endif
block_registry.h
global_block_registry
GR_RUNTIME_API gr::block_registry global_block_registry
callbackregister_base::callback_t
Definition rpccallbackregister_base.h:83
gr::block_registry::block_lookup
basic_block_sptr block_lookup(pmt::pmt_t symbol)
gr::messages::msg_accepter
Virtual base class that accepts messages.
Definition messages/msg_accepter.h:25
gr::messages::msg_producer
Virtual base class that produces messages.
Definition msg_producer.h:25
rpcbasic_base
Definition rpcregisterhelpers.h:734
rpcbasic_base::rpcbasic_base
rpcbasic_base()
Definition rpcregisterhelpers.h:736
rpcbasic_base::~rpcbasic_base
virtual ~rpcbasic_base()
Definition rpcregisterhelpers.h:737
rpcbasic_extractor< T, bool >::rpcbasic_extractor
rpcbasic_extractor(T *source, void(T::*func)(bool))
Definition rpcregisterhelpers.h:350
rpcbasic_extractor< T, bool >::post
void post(pmt::pmt_t which_port, pmt::pmt_t msg)
send msg to msg_accepter on port which_port
Definition rpcregisterhelpers.h:356
rpcbasic_extractor< T, char >::rpcbasic_extractor
rpcbasic_extractor(T *source, void(T::*func)(char))
Definition rpcregisterhelpers.h:224
rpcbasic_extractor< T, char >::post
void post(pmt::pmt_t which_port, pmt::pmt_t msg)
send msg to msg_accepter on port which_port
Definition rpcregisterhelpers.h:230
rpcbasic_extractor< T, double >::post
void post(pmt::pmt_t which_port, pmt::pmt_t msg)
send msg to msg_accepter on port which_port
Definition rpcregisterhelpers.h:272
rpcbasic_extractor< T, double >::rpcbasic_extractor
rpcbasic_extractor(T *source, void(T::*func)(double))
Definition rpcregisterhelpers.h:266
rpcbasic_extractor< T, float >::rpcbasic_extractor
rpcbasic_extractor(T *source, void(T::*func)(float))
Definition rpcregisterhelpers.h:287
rpcbasic_extractor< T, float >::post
void post(pmt::pmt_t which_port, pmt::pmt_t msg)
send msg to msg_accepter on port which_port
Definition rpcregisterhelpers.h:293
rpcbasic_extractor< T, int >::rpcbasic_extractor
rpcbasic_extractor(T *source, void(T::*func)(int))
Definition rpcregisterhelpers.h:329
rpcbasic_extractor< T, int >::post
void post(pmt::pmt_t which_port, pmt::pmt_t msg)
send msg to msg_accepter on port which_port
Definition rpcregisterhelpers.h:335
rpcbasic_extractor< T, long >::post
void post(pmt::pmt_t which_port, pmt::pmt_t msg)
send msg to msg_accepter on port which_port
Definition rpcregisterhelpers.h:314
rpcbasic_extractor< T, long >::rpcbasic_extractor
rpcbasic_extractor(T *source, void(T::*func)(long))
Definition rpcregisterhelpers.h:308
rpcbasic_extractor< T, short >::post
void post(pmt::pmt_t which_port, pmt::pmt_t msg)
send msg to msg_accepter on port which_port
Definition rpcregisterhelpers.h:251
rpcbasic_extractor< T, short >::rpcbasic_extractor
rpcbasic_extractor(T *source, void(T::*func)(short))
Definition rpcregisterhelpers.h:245
rpcbasic_extractor< T, std::complex< double > >::post
void post(pmt::pmt_t which_port, pmt::pmt_t msg)
send msg to msg_accepter on port which_port
Definition rpcregisterhelpers.h:401
rpcbasic_extractor< T, std::complex< double > >::rpcbasic_extractor
rpcbasic_extractor(T *source, void(T::*func)(std::complex< double >))
Definition rpcregisterhelpers.h:395
rpcbasic_extractor< T, std::complex< float > >::rpcbasic_extractor
rpcbasic_extractor(T *source, void(T::*func)(std::complex< float >))
Definition rpcregisterhelpers.h:372
rpcbasic_extractor< T, std::complex< float > >::post
void post(pmt::pmt_t which_port, pmt::pmt_t msg)
send msg to msg_accepter on port which_port
Definition rpcregisterhelpers.h:378
rpcbasic_extractor< T, std::string >::post
void post(pmt::pmt_t which_port, pmt::pmt_t msg)
send msg to msg_accepter on port which_port
Definition rpcregisterhelpers.h:423
rpcbasic_extractor< T, std::string >::rpcbasic_extractor
rpcbasic_extractor(T *source, void(T::*func)(std::string))
Definition rpcregisterhelpers.h:417
rpcbasic_extractor< T, void >::rpcbasic_extractor
rpcbasic_extractor(T *source, void(T::*func)())
Definition rpcregisterhelpers.h:203
rpcbasic_extractor< T, void >::post
void post(pmt::pmt_t which_port, pmt::pmt_t msg)
send msg to msg_accepter on port which_port
Definition rpcregisterhelpers.h:209
rpcbasic_extractor
Templated parent class for registering a ControlPort Extractor.
Definition rpcregisterhelpers.h:83
rpcbasic_extractor::rpcbasic_extractor
rpcbasic_extractor(T *source, void(T::*func)(Tto))
Definition rpcregisterhelpers.h:85
rpcbasic_handler
Templated parent class for registering a ControlPort Extractor.
Definition rpcregisterhelpers.h:182
rpcbasic_handler::rpcbasic_handler
rpcbasic_handler(T *source, const char *handler)
Definition rpcregisterhelpers.h:184
rpcbasic_inserter< T, std::complex< double > >::retrieve
pmt::pmt_t retrieve()
send msg to msg_producer
Definition rpcregisterhelpers.h:710
rpcbasic_inserter< T, std::complex< double > >::rpcbasic_inserter
rpcbasic_inserter(T *source, std::complex< double >(T::*func)())
Definition rpcregisterhelpers.h:704
rpcbasic_inserter< T, std::complex< double > >::rpcbasic_inserter
rpcbasic_inserter(T *source, std::complex< double >(T::*func)() const)
Definition rpcregisterhelpers.h:698
rpcbasic_inserter< T, std::complex< float > >::retrieve
pmt::pmt_t retrieve()
send msg to msg_producer
Definition rpcregisterhelpers.h:682
rpcbasic_inserter< T, std::complex< float > >::rpcbasic_inserter
rpcbasic_inserter(T *source, std::complex< float >(T::*func)())
Definition rpcregisterhelpers.h:676
rpcbasic_inserter< T, std::complex< float > >::rpcbasic_inserter
rpcbasic_inserter(T *source, std::complex< float >(T::*func)() const)
Definition rpcregisterhelpers.h:670
rpcbasic_inserter< T, std::vector< float > >::rpcbasic_inserter
rpcbasic_inserter(T *source, std::vector< float >(T::*func)())
Definition rpcregisterhelpers.h:619
rpcbasic_inserter< T, std::vector< float > >::retrieve
pmt::pmt_t retrieve()
send msg to msg_producer
Definition rpcregisterhelpers.h:625
rpcbasic_inserter< T, std::vector< float > >::rpcbasic_inserter
rpcbasic_inserter(T *source, std::vector< float >(T::*func)() const)
Definition rpcregisterhelpers.h:613
rpcbasic_inserter< T, std::vector< int64_t > >::rpcbasic_inserter
rpcbasic_inserter(T *source, std::vector< int64_t >(T::*func)() const)
Definition rpcregisterhelpers.h:555
rpcbasic_inserter< T, std::vector< int64_t > >::rpcbasic_inserter
rpcbasic_inserter(T *source, std::vector< int64_t >(T::*func)())
Definition rpcregisterhelpers.h:561
rpcbasic_inserter< T, std::vector< int64_t > >::retrieve
pmt::pmt_t retrieve()
send msg to msg_producer
Definition rpcregisterhelpers.h:567
rpcbasic_inserter< T, std::vector< int > >::retrieve
pmt::pmt_t retrieve()
send msg to msg_producer
Definition rpcregisterhelpers.h:539
rpcbasic_inserter< T, std::vector< int > >::rpcbasic_inserter
rpcbasic_inserter(T *source, std::vector< int >(T::*func)())
Definition rpcregisterhelpers.h:533
rpcbasic_inserter< T, std::vector< int > >::rpcbasic_inserter
rpcbasic_inserter(T *source, std::vector< int >(T::*func)() const)
Definition rpcregisterhelpers.h:527
rpcbasic_inserter< T, std::vector< short > >::rpcbasic_inserter
rpcbasic_inserter(T *source, std::vector< short >(T::*func)() const)
Definition rpcregisterhelpers.h:499
rpcbasic_inserter< T, std::vector< short > >::rpcbasic_inserter
rpcbasic_inserter(T *source, std::vector< short >(T::*func)())
Definition rpcregisterhelpers.h:505
rpcbasic_inserter< T, std::vector< short > >::retrieve
pmt::pmt_t retrieve()
send msg to msg_producer
Definition rpcregisterhelpers.h:511
rpcbasic_inserter< T, std::vector< signed char > >::retrieve
pmt::pmt_t retrieve()
send msg to msg_producer
Definition rpcregisterhelpers.h:482
rpcbasic_inserter< T, std::vector< signed char > >::rpcbasic_inserter
rpcbasic_inserter(T *source, std::vector< signed char >(T::*func)() const)
Definition rpcregisterhelpers.h:470
rpcbasic_inserter< T, std::vector< signed char > >::rpcbasic_inserter
rpcbasic_inserter(T *source, std::vector< signed char >(T::*func)())
Definition rpcregisterhelpers.h:476
rpcbasic_inserter< T, std::vector< std::complex< float > > >::retrieve
pmt::pmt_t retrieve()
send msg to msg_producer
Definition rpcregisterhelpers.h:596
rpcbasic_inserter< T, std::vector< std::complex< float > > >::rpcbasic_inserter
rpcbasic_inserter(T *source, std::vector< std::complex< float > >(T::*func)())
Definition rpcregisterhelpers.h:590
rpcbasic_inserter< T, std::vector< std::complex< float > > >::rpcbasic_inserter
rpcbasic_inserter(T *source, std::vector< std::complex< float > >(T::*func)() const)
Definition rpcregisterhelpers.h:584
rpcbasic_inserter< T, std::vector< uint8_t > >::rpcbasic_inserter
rpcbasic_inserter(T *source, std::vector< uint8_t >(T::*func)() const)
Definition rpcregisterhelpers.h:641
rpcbasic_inserter< T, std::vector< uint8_t > >::retrieve
pmt::pmt_t retrieve()
send msg to msg_producer
Definition rpcregisterhelpers.h:653
rpcbasic_inserter< T, std::vector< uint8_t > >::rpcbasic_inserter
rpcbasic_inserter(T *source, std::vector< uint8_t >(T::*func)())
Definition rpcregisterhelpers.h:647
rpcbasic_inserter< T, uint64_t >::rpcbasic_inserter
rpcbasic_inserter(T *source, uint64_t(T::*func)() const)
Definition rpcregisterhelpers.h:443
rpcbasic_inserter< T, uint64_t >::rpcbasic_inserter
rpcbasic_inserter(T *source, uint64_t(T::*func)())
Definition rpcregisterhelpers.h:449
rpcbasic_inserter< T, uint64_t >::retrieve
pmt::pmt_t retrieve()
send msg to msg_producer
Definition rpcregisterhelpers.h:455
rpcbasic_inserter
Templated parent class for registering a ControlPort Inserter.
Definition rpcregisterhelpers.h:126
rpcbasic_inserter::rpcbasic_inserter
rpcbasic_inserter(T *source, Tfrom(T::*func)() const)
Definition rpcregisterhelpers.h:128
rpcbasic_inserter::rpcbasic_inserter
rpcbasic_inserter(T *source, Tfrom(T::*func)())
Definition rpcregisterhelpers.h:134
rpcbasic_inserter::retrieve
pmt::pmt_t retrieve()
send msg to msg_producer
Definition rpcregisterhelpers.h:140
rpcbasic_register_get
Registers a 'get' function to get a parameter over ControlPort.
Definition rpcregisterhelpers.h:1107
rpcbasic_register_get::units
std::string units() const
Definition rpcregisterhelpers.h:1333
rpcbasic_register_get::set_def
void set_def(pmt::pmt_t p)
Definition rpcregisterhelpers.h:1340
rpcbasic_register_get::rpcbasic_register_get
rpcbasic_register_get(const std::string &block_alias, const char *functionbase, Tfrom(T::*function)() const, 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)
Same as rpcbasic_register_get::rpcbasic_register_get that allows using '[variable]() const' getter fu...
Definition rpcregisterhelpers.h:1178
rpcbasic_register_get::def
pmt::pmt_t def() const
Definition rpcregisterhelpers.h:1332
rpcbasic_register_get::default_display
DisplayType default_display() const
Definition rpcregisterhelpers.h:1336
rpcbasic_register_get::description
void description(std::string d)
Definition rpcregisterhelpers.h:1342
rpcbasic_register_get::rpcbasic_register_get
rpcbasic_register_get(const std::string &name, const char *functionbase, T *obj, Tfrom(T::*function)() const, 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)
Same as above that allows using '[variable]() const' getter functions.
Definition rpcregisterhelpers.h:1284
rpcbasic_register_get::set_min
void set_min(pmt::pmt_t p)
Definition rpcregisterhelpers.h:1338
rpcbasic_register_get::~rpcbasic_register_get
~rpcbasic_register_get() override
Definition rpcregisterhelpers.h:1323
rpcbasic_register_get::description
std::string description() const
Definition rpcregisterhelpers.h:1334
rpcbasic_register_get::rpcbasic_register_get
rpcbasic_register_get(const std::string &block_alias, const char *functionbase, Tfrom(T::*function)(), 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.
Definition rpcregisterhelpers.h:1135
rpcbasic_register_get::default_display
void default_display(DisplayType d)
Definition rpcregisterhelpers.h:1344
rpcbasic_register_get::max
pmt::pmt_t max() const
Definition rpcregisterhelpers.h:1331
rpcbasic_register_get::privilege_level
priv_lvl_t privilege_level() const
Definition rpcregisterhelpers.h:1335
rpcbasic_register_get::units
void units(std::string u)
Definition rpcregisterhelpers.h:1341
rpcbasic_register_get::min
pmt::pmt_t min() const
Definition rpcregisterhelpers.h:1330
rpcbasic_register_get::set_max
void set_max(pmt::pmt_t p)
Definition rpcregisterhelpers.h:1339
rpcbasic_register_get::rpcbasic_register_get
rpcbasic_register_get(const std::string &name, const char *functionbase, T *obj, Tfrom(T::*function)(), 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.
Definition rpcregisterhelpers.h:1241
rpcbasic_register_get::privilege_level
void privilege_level(priv_lvl_t p)
Definition rpcregisterhelpers.h:1343
rpcbasic_register_handler
Registers a message handler function to post a message to a block's handler.
Definition rpcregisterhelpers.h:1596
rpcbasic_register_handler::description
void description(std::string d)
Definition rpcregisterhelpers.h:1658
rpcbasic_register_handler::description
std::string description() const
Definition rpcregisterhelpers.h:1653
rpcbasic_register_handler::privilege_level
void privilege_level(priv_lvl_t p)
Definition rpcregisterhelpers.h:1659
rpcbasic_register_handler::~rpcbasic_register_handler
~rpcbasic_register_handler() override
Definition rpcregisterhelpers.h:1645
rpcbasic_register_handler::rpcbasic_register_handler
rpcbasic_register_handler(const std::string &block_alias, const char *handler, const char *units_="", const char *desc_="", priv_lvl_t minpriv_=RPC_PRIVLVL_MIN, DisplayType display_=DISPNULL)
Adds the ability to pass a message over ControlPort.
Definition rpcregisterhelpers.h:1614
rpcbasic_register_handler::default_display
DisplayType default_display() const
Definition rpcregisterhelpers.h:1655
rpcbasic_register_handler::privilege_level
priv_lvl_t privilege_level() const
Definition rpcregisterhelpers.h:1654
rpcbasic_register_handler::units
void units(std::string u)
Definition rpcregisterhelpers.h:1657
rpcbasic_register_handler::units
std::string units() const
Definition rpcregisterhelpers.h:1652
rpcbasic_register_handler::default_display
void default_display(DisplayType d)
Definition rpcregisterhelpers.h:1660
rpcbasic_register_variable_rw
Registers a read/write function to get and set a parameter over ControlPort.
Definition rpcregisterhelpers.h:1512
rpcbasic_register_variable_rw::rpcbasic_register_variable_rw
rpcbasic_register_variable_rw(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 set and get the variable over ControlPort.
Definition rpcregisterhelpers.h:1561
rpcbasic_register_variable_rw::set
void set(Tfrom _variable)
Definition rpcregisterhelpers.h:1538
rpcbasic_register_variable_rw::rpcbasic_register_variable_rw
rpcbasic_register_variable_rw()
Definition rpcregisterhelpers.h:1520
rpcbasic_register_variable
Registers a read-only function to get a parameter over ControlPort.
Definition rpcregisterhelpers.h:1395
rpcbasic_register_variable::d_variable
Tfrom * d_variable
Definition rpcregisterhelpers.h:1398
rpcbasic_register_variable::get
Tfrom get()
Definition rpcregisterhelpers.h:1399
rpcbasic_register_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.
Definition rpcregisterhelpers.h:1447
rpcbasic_register_variable::setptr
void setptr(Tfrom *_variable)
Definition rpcregisterhelpers.h:1402
rpcbasic_register_variable::rpcbasic_register_variable
rpcbasic_register_variable()
Definition rpcregisterhelpers.h:1410
rpcbasic_register_variable::d_rpc_reg
rpcbasic_register_get< rpcbasic_register_variable< Tfrom >, Tfrom > d_rpc_reg
Definition rpcregisterhelpers.h:1397
rpcextractor_base< T, void >::post
void post(pmt::pmt_t which_port, pmt::pmt_t msg) override
send msg to msg_accepter on port which_port
Definition rpcregisterhelpers.h:65
rpcextractor_base< T, void >::rpcextractor_base
rpcextractor_base(T *source, void(T::*func)())
Definition rpcregisterhelpers.h:62
rpcextractor_base< T, void >::_source
T * _source
Definition rpcregisterhelpers.h:74
rpcextractor_base< T, void >::~rpcextractor_base
~rpcextractor_base() override
Definition rpcregisterhelpers.h:63
rpcextractor_base
Base class for registering a ControlPort Extractor. Acts as a message acceptor.
Definition rpcregisterhelpers.h:37
rpcextractor_base::_func
void(T::* _func)(Tto)
Definition rpcregisterhelpers.h:55
rpcextractor_base::~rpcextractor_base
~rpcextractor_base() override
Definition rpcregisterhelpers.h:43
rpcextractor_base::post
void post(pmt::pmt_t which_port, pmt::pmt_t msg) override
send msg to msg_accepter on port which_port
Definition rpcregisterhelpers.h:45
rpcextractor_base::rpcextractor_base
rpcextractor_base(T *source, void(T::*func)(Tto))
Definition rpcregisterhelpers.h:39
rpcextractor_base::_source
T * _source
Definition rpcregisterhelpers.h:54
rpchandler_base
Base class for registering a ControlPort Handler. Acts as a message acceptor.
Definition rpcregisterhelpers.h:158
rpchandler_base::_source
T * _source
Definition rpcregisterhelpers.h:172
rpchandler_base::rpchandler_base
rpchandler_base(T *source, const char *handler)
Definition rpcregisterhelpers.h:160
rpchandler_base::~rpchandler_base
~rpchandler_base() override
Definition rpcregisterhelpers.h:164
rpchandler_base::post
void post(pmt::pmt_t which_port, pmt::pmt_t msg) override
send msg to msg_accepter on port which_port
Definition rpcregisterhelpers.h:166
rpchandler_base::_handler
const char * _handler
Definition rpcregisterhelpers.h:173
rpcinserter_base
Base class for registering a ControlPort Inserter. Produces a message.
Definition rpcregisterhelpers.h:103
rpcinserter_base::_func
Tfrom(T::* _func)()
Definition rpcregisterhelpers.h:116
rpcinserter_base::retrieve
pmt::pmt_t retrieve() override
send msg to msg_producer
Definition rpcregisterhelpers.h:108
rpcinserter_base::rpcinserter_base
rpcinserter_base()
Definition rpcregisterhelpers.h:106
rpcinserter_base::_source
T * _source
Definition rpcregisterhelpers.h:115
rpcinserter_base::rpcinserter_base
rpcinserter_base(T *source, Tfrom(T::*func)())
Definition rpcregisterhelpers.h:105
rpcmanager::get
static rpcserver_booter_base * get()
rpcserver_base::unregisterHandlerCallback
void unregisterHandlerCallback(const std::string &id) override=0
rpcserver_base::registerQueryCallback
void registerQueryCallback(const std::string &id, const queryCallback_t callback) override=0
rpcserver_base::registerHandlerCallback
void registerHandlerCallback(const std::string &id, const handlerCallback_t callback) override=0
rpcserver_base::unregisterConfigureCallback
void unregisterConfigureCallback(const std::string &id) override=0
rpcserver_base::registerConfigureCallback
void registerConfigureCallback(const std::string &id, const configureCallback_t callback) override=0
rpcserver_base::unregisterQueryCallback
void unregisterQueryCallback(const std::string &id) override=0
rpcserver_booter_base::i
virtual rpcserver_base * i()=0
std::vector
STL class.
Definition vector_docstub.h:11
pmt
Definition pmt.h:38
pmt::to_double
PMT_API double to_double(pmt_t x)
Convert pmt to double if possible.
pmt::from_complex
PMT_API pmt_t from_complex(double re, double im)
Return a complex number constructed of the given real and imaginary parts.
pmt::init_s8vector
PMT_API pmt_t init_s8vector(size_t k, const int8_t *data)
pmt::to_complex
PMT_API std::complex< double > to_complex(pmt_t z)
pmt::init_s16vector
PMT_API pmt_t init_s16vector(size_t k, const int16_t *data)
pmt::intern
PMT_API pmt_t intern(const std::string &s)
Alias for pmt_string_to_symbol.
pmt::init_s32vector
PMT_API pmt_t init_s32vector(size_t k, const int32_t *data)
pmt::to_long
PMT_API long to_long(pmt_t x)
Convert pmt to long if possible.
pmt::init_f32vector
PMT_API pmt_t init_f32vector(size_t k, const float *data)
pmt::to_bool
PMT_API bool to_bool(pmt_t val)
Return true if val is pmt::True, return false when val is pmt::PMT_F,.
pmt::symbol_to_string
PMT_API const std::string symbol_to_string(const pmt_t &sym)
pmt::init_c32vector
PMT_API pmt_t init_c32vector(size_t k, const std::complex< float > *data)
pmt::mp
static pmt_t mp(const std::string &s)
Make pmt symbol.
Definition pmt_sugar.h:24
pmt::pmt_t
std::shared_ptr< pmt_base > pmt_t
typedef for shared pointer (transparent reference counting).
Definition pmt.h:83
pmt::init_u8vector
PMT_API pmt_t init_u8vector(size_t k, const uint8_t *data)
pmt::init_s64vector
PMT_API pmt_t init_s64vector(size_t k, const int64_t *data)
pmt::from_uint64
PMT_API pmt_t from_uint64(uint64_t x)
Return the pmt value that represents the uint64 x.
std
STL namespace.
PMT_NIL
#define PMT_NIL
Definition pmt.h:121
DISPNULL
constexpr uint32_t DISPNULL
DisplayType Plotting types.
Definition rpccallbackregister_base.h:20
priv_lvl_t
priv_lvl_t
Definition rpccallbackregister_base.h:34
RPC_PRIVLVL_MIN
@ RPC_PRIVLVL_MIN
Definition rpccallbackregister_base.h:34
DisplayType
uint32_t DisplayType
Definition rpccallbackregister_base.h:17
rpcmanager.h
rpcserver_base.h
rpcserver_booter_base.h
rpcserver_selector.h
rpc_register_base
Base class for registering a ControlPort function.
Definition rpcregisterhelpers.h:723
rpc_register_base::rpc_register_base
rpc_register_base()
Definition rpcregisterhelpers.h:724
rpc_register_base::count
static int count
Definition rpcregisterhelpers.h:727
rpcbasic_register_set
Registers a 'set' function to set a parameter over ControlPort.
Definition rpcregisterhelpers.h:777
rpcbasic_register_set::rpcbasic_register_set
rpcbasic_register_set(const std::string &name, const char *functionbase, T *obj, void(T::*function)(Tto), 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 set the variable over ControlPort.
Definition rpcregisterhelpers.h:865
rpcbasic_register_set::units
std::string units() const
Definition rpcregisterhelpers.h:914
rpcbasic_register_set::description
void description(std::string d)
Definition rpcregisterhelpers.h:923
rpcbasic_register_set::min
pmt::pmt_t min() const
Definition rpcregisterhelpers.h:911
rpcbasic_register_set::~rpcbasic_register_set
~rpcbasic_register_set() override
Definition rpcregisterhelpers.h:903
rpcbasic_register_set::rpcbasic_register_set
rpcbasic_register_set(const std::string &block_alias, const char *functionbase, void(T::*function)(Tto), 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 set the variable over ControlPort.
Definition rpcregisterhelpers.h:804
rpcbasic_register_set::set_max
void set_max(pmt::pmt_t p)
Definition rpcregisterhelpers.h:920
rpcbasic_register_set::description
std::string description() const
Definition rpcregisterhelpers.h:915
rpcbasic_register_set::privilege_level
void privilege_level(priv_lvl_t p)
Definition rpcregisterhelpers.h:924
rpcbasic_register_set::set_min
void set_min(pmt::pmt_t p)
Definition rpcregisterhelpers.h:919
rpcbasic_register_set::set_def
void set_def(pmt::pmt_t p)
Definition rpcregisterhelpers.h:921
rpcbasic_register_set::def
pmt::pmt_t def() const
Definition rpcregisterhelpers.h:913
rpcbasic_register_set::privilege_level
priv_lvl_t privilege_level() const
Definition rpcregisterhelpers.h:916
rpcbasic_register_set::default_display
void default_display(DisplayType d)
Definition rpcregisterhelpers.h:925
rpcbasic_register_set::default_display
DisplayType default_display() const
Definition rpcregisterhelpers.h:917
rpcbasic_register_set::max
pmt::pmt_t max() const
Definition rpcregisterhelpers.h:912
rpcbasic_register_set::units
void units(std::string u)
Definition rpcregisterhelpers.h:922
rpcbasic_register_trigger
Registers a 'trigger' function to trigger an action over ControlPort.
Definition rpcregisterhelpers.h:962
rpcbasic_register_trigger::description
void description(std::string d)
Definition rpcregisterhelpers.h:1059
rpcbasic_register_trigger::description
std::string description() const
Definition rpcregisterhelpers.h:1056
rpcbasic_register_trigger::privilege_level
priv_lvl_t privilege_level() const
Definition rpcregisterhelpers.h:1057
rpcbasic_register_trigger::privilege_level
void privilege_level(priv_lvl_t p)
Definition rpcregisterhelpers.h:1060
rpcbasic_register_trigger::rpcbasic_register_trigger
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.
Definition rpcregisterhelpers.h:1025
rpcbasic_register_trigger::~rpcbasic_register_trigger
~rpcbasic_register_trigger() override
Definition rpcregisterhelpers.h:1048
rpcbasic_register_trigger::rpcbasic_register_trigger
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.
Definition rpcregisterhelpers.h:984