OpenRTM-aist 2.0.2
Loading...
Searching...
No Matches
RTC::ConfigBase Class Referenceabstract

ConfigBase abstract class. More...

#include <ConfigAdmin.h>

Inheritance diagram for RTC::ConfigBase:
Collaboration diagram for RTC::ConfigBase:

Public Types

using CallbackFunc = void (ConfigAdmin::*)(const char *, const char*)
 

Public Member Functions

 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.
 
virtual bool update (const char *val)=0
 Pure virtual function to update configuration parameter values.
 

Public Attributes

const char * name
 Configuration name .
 
const char * default_value
 Default value in string format .
 

Protected Attributes

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. .
 

Detailed Description

ConfigBase abstract class.

This is the abstract interface class to hold various configuration information. Concrete configuration classes must implement the following pure virtual functions.

This class provides public interface as follows.

  • update(): update configuration parameter value
Since
0.4.0

Member Typedef Documentation

◆ CallbackFunc

using RTC::ConfigBase::CallbackFunc = void (ConfigAdmin::*)(const char *, const char*)

Constructor & Destructor Documentation

◆ ConfigBase()

RTC::ConfigBase::ConfigBase ( const char * name_,
const char * def_val )
inline

Constructer.

Constructer

Parameters
name_Configuration name
def_valDefault value in string format

◆ ~ConfigBase()

virtual RTC::ConfigBase::~ConfigBase ( )
virtualdefault

Virtual Destructor.

Virtual Destructor

Member Function Documentation

◆ notifyUpdate()

void RTC::ConfigBase::notifyUpdate ( const char * key,
const char * val )

Observer function to notify variable changed.

This function notifies variable has been changed.

◆ setCallback()

void RTC::ConfigBase::setCallback ( ConfigAdmin * cadmin,
CallbackFunc cbf )

Setting callback.

This member function sets callback function which is called when variable is changed.

Referenced by RTC::ConfigAdmin::bindParameter().

◆ update()

virtual bool RTC::ConfigBase::update ( const char * val)
pure virtual

Pure virtual function to update configuration parameter values.

Pure virtual function to update configuration parameter by the configuration value.

Parameters
valThe parameter values converted into character string format
Returns
Result of the setup

Implemented in RTC::Config< VarType, TransFunc >.

Member Data Documentation

◆ default_value

const char* RTC::ConfigBase::default_value

Default value in string format .

◆ m_admin

ConfigAdmin* RTC::ConfigBase::m_admin
protected

A pointer to the ConfigAdmin object .

◆ m_callback

CallbackFunc RTC::ConfigBase::m_callback
protected

A member function pointer to the callback function. .

◆ name

const char* RTC::ConfigBase::name

Configuration name .

◆ string_value

std::string RTC::ConfigBase::string_value
protected

Current value in string format .


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