OpenRTM-aist 2.0.2
Loading...
Searching...
No Matches
RTC::Config< VarType, TransFunc > Class Template Reference

Config class. More...

#include <ConfigAdmin.h>

Inheritance diagram for RTC::Config< VarType, TransFunc >:
Collaboration diagram for RTC::Config< VarType, TransFunc >:

Public Member Functions

 Config (const char *conf_name, VarType &var, const char *def_val, TransFunc trans=coil::stringTo)
 Constructor.
 
 ~Config () override=default
 Virtual Destructor.
 
bool update (const char *val) override
 Update a bind parameter value.
 
- Public Member Functions inherited from RTC::ConfigBase
 ConfigBase (const char *name_, const char *def_val)
 Constructer.
 
virtual ~ConfigBase ()=default
 Virtual Destructor.
 
void setCallback (ConfigAdmin *cadmin, CallbackFunc cbf)
 Setting callback.
 
void notifyUpdate (const char *key, const char *val)
 Observer function to notify variable changed.
 

Protected Attributes

VarType & m_var
 Configuration parameter variable .
 
TransFunc m_trans
 Transformation function to convert configuration parameter type into string format. .
 
- Protected Attributes inherited from RTC::ConfigBase
std::string string_value
 Current value in string format .
 
ConfigAdminm_admin
 A pointer to the ConfigAdmin object .
 
CallbackFunc m_callback
 A member function pointer to the callback function. .
 

Additional Inherited Members

- Public Types inherited from RTC::ConfigBase
using CallbackFunc = void (ConfigAdmin::*)(const char *, const char*)
 
- Public Attributes inherited from RTC::ConfigBase
const char * name
 Configuration name .
 
const char * default_value
 Default value in string format .
 

Detailed Description

template<typename VarType, typename TransFunc = bool (*)(VarType&, const char*)>
class RTC::Config< VarType, TransFunc >

Config class.

Class to hold the configuration parameter information. Specify the data type of the configuration as <VarType> Specify transformation function to convert data type set as <TransFunc> into string format.

Parameters
VarTypeCariable to hold configuration parameter
TransFuncTransformation function to transform the stored data type into string format.
Since
0.4.0

Constructor & Destructor Documentation

◆ Config()

template<typename VarType , typename TransFunc = bool (*)(VarType&, const char*)>
RTC::Config< VarType, TransFunc >::Config ( const char * conf_name,
VarType & var,
const char * def_val,
TransFunc trans = coil::stringTo )
inline

Constructor.

Constructor

Parameters
nameConfiguration parameter name
varConfiguration parameter variable
def_valDefault value in string format
transFunction to transform into string format

◆ ~Config()

template<typename VarType , typename TransFunc = bool (*)(VarType&, const char*)>
RTC::Config< VarType, TransFunc >::~Config ( )
overridedefault

Virtual Destructor.

Virtual Destructor.

Member Function Documentation

◆ update()

template<typename VarType , typename TransFunc = bool (*)(VarType&, const char*)>
bool RTC::Config< VarType, TransFunc >::update ( const char * val)
inlineoverridevirtual

Update a bind parameter value.

Update configuration paramater by the configuration value.

Parameters
valThe parameter values converted into character string format
Returns
Update result (Successful:true, Failed:false)

Implements RTC::ConfigBase.

Member Data Documentation

◆ m_trans

template<typename VarType , typename TransFunc = bool (*)(VarType&, const char*)>
TransFunc RTC::Config< VarType, TransFunc >::m_trans
protected

Transformation function to convert configuration parameter type into string format. .

◆ m_var

template<typename VarType , typename TransFunc = bool (*)(VarType&, const char*)>
VarType& RTC::Config< VarType, TransFunc >::m_var
protected

Configuration parameter variable .


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