RTC::ConfigAdmin Class Reference

ConfigAdmin class. More...

#include <ConfigAdmin.h>

List of all members.

Public Member Functions

 ConfigAdmin (coil::Properties &prop)
 Constructor.
 ~ConfigAdmin (void)
 Virtual Destructor.
template<typename VarType>
bool bindParameter (const char *param_name, VarType &var, const char *def_val, bool(*trans)(VarType &, const char *)=coil::stringTo)
 Setup for configuration parameters.
void update (const char *config_set)
 Update configuration parameter (By ID).
void update (const char *config_set, const char *config_param)
 Update the values of configuration parameters (By name).
void update (void)
 Update the values of configuration parameters (Active configuration set).
bool isExist (const char *name)
 Check the existence of configuration parameters.
bool isChanged (void)
 Confirm to change configuration parameters.
const char * getActiveId (void)
 Get ID of active configuration set.
bool haveConfig (const char *config_id)
 Check the existence of configuration set.
bool isActive (void)
 Confirm to activate configuration set.
const std::vector
< coil::Properties * > & 
getConfigurationSets (void)
 Get all configuration sets.
const coil::Properties & getConfigurationSet (const char *config_id)
 Get a configuration set by specified ID.
bool setConfigurationSetValues (const coil::Properties &configuration_set)
 Add to configuration set from specified property.
const coil::Properties & getActiveConfigurationSet (void)
 Get the active configuration set.
bool addConfigurationSet (const coil::Properties &configuration_set)
 Add the configuration value to configuration set.
bool removeConfigurationSet (const char *config_id)
 Remove the configuration set.
bool activateConfigurationSet (const char *config_id)
 Activate the configuration set.
void setOnUpdate (OnUpdateCallback *cb)
void setOnUpdateParam (OnUpdateParamCallback *cb)
void setOnSetConfigurationSet (OnSetConfigurationSetCallback *cb)
void setOnAddConfigurationSet (OnAddConfigurationAddCallback *cb)
void setOnRemoveConfigurationSet (OnRemoveConfigurationSetCallback *cb)
void setOnActivateSet (OnActivateSetCallback *cb)

Protected Member Functions

void onUpdate (const char *config_set)
void onUpdateParam (const char *config_set, const char *config_param)
void onSetConfigurationSet (const coil::Properties &config_set)
void onAddConfigurationSet (const coil::Properties &config_set)
void onRemoveConfigurationSet (const char *config_id)
void onActivateSet (const char *config_id)

Classes

struct  find_conf


Detailed Description

ConfigAdmin class.

Class to manage various configuration information.

Since:
0.4.0

Constructor & Destructor Documentation

RTC::ConfigAdmin::ConfigAdmin ( coil::Properties &  prop  ) 

Constructor.

Constructor

Parameters:
prop The target property name for setup

RTC::ConfigAdmin::~ConfigAdmin ( void   ) 

Virtual Destructor.

Virtual Destructor


Member Function Documentation

template<typename VarType>
bool RTC::ConfigAdmin::bindParameter ( const char *  param_name,
VarType &  var,
const char *  def_val,
bool(*)(VarType &, const char *)  trans = coil::stringTo 
) [inline]

Setup for configuration parameters.

Bind configuration parameter to its variable. Return false, if configuration parameter of specified name has already existed. Specify the data type of the configuration as <VarType>.

Parameters:
param_name Configuration parameter name
var Configuration parameter variable
def_val Default value of configuration parameter
trans Function to transform configuration parameter type into string format
Returns:
Setup result (Successful:true, Failed:false)

void RTC::ConfigAdmin::update ( const char *  config_set  ) 

Update configuration parameter (By ID).

Update comfiguration parameter value by the value that set to a configuration set of specified ID. Exit without doing anthing if a configuration set of specified ID does not exist.

Parameters:
config_set The target configuration set's ID to setup

void RTC::ConfigAdmin::update ( const char *  config_set,
const char *  config_param 
)

Update the values of configuration parameters (By name).

Update the configuration value by the value that set to a configuration set value of specified name.

Parameters:
config_set configuration name. Name that each separates by each comma(.) and excludes the last element.
config_param Last element name of configuration set

void RTC::ConfigAdmin::update ( void   ) 

Update the values of configuration parameters (Active configuration set).

When configuration set is updated, update the configuration parameter value to the value that is set to the current active configuration. This update will be executed, only when an active configuration set exists and the content of the configuration set has been updated from the last update.

bool RTC::ConfigAdmin::isExist ( const char *  name  ) 

Check the existence of configuration parameters.

Check the existence of configuration parameters of specified name.

Parameters:
name Configuration parameter name
Returns:
Result of existance confirmation (Parameters exist:true, else:false)

bool RTC::ConfigAdmin::isChanged ( void   )  [inline]

Confirm to change configuration parameters.

Confirm that configuration parameters have changed.

Returns:
Result of change confirmation (There is a change:true、No change:false)

const char* RTC::ConfigAdmin::getActiveId ( void   )  [inline]

Get ID of active configuration set.

Get ID of the current active configuration set.

Returns:
The active configuration set ID

bool RTC::ConfigAdmin::haveConfig ( const char *  config_id  )  [inline]

Check the existence of configuration set.

Check the existence of specified configuration set.

Parameters:
config_id ID of target configuration set for confirmation
Returns:
Result of existence confirmation (Specified ConfigSet exists:true, else:false)

bool RTC::ConfigAdmin::isActive ( void   )  [inline]

Confirm to activate configuration set.

Confirm that configuration set has been activated.

Returns:
Result of state confirmation (Active state:true, Inactive state:false)

const std::vector<coil::Properties*>& RTC::ConfigAdmin::getConfigurationSets ( void   ) 

Get all configuration sets.

Get all specified configuration sets

Returns:
All configuration sets

const coil::Properties& RTC::ConfigAdmin::getConfigurationSet ( const char *  config_id  ) 

Get a configuration set by specified ID.

Get a configuration set that was specified by ID Return empty configuration set, if a configuration set of specified ID doesn't exist.

Parameters:
config_id ID of the target configuration set for getting
Returns:
The configuration set

bool RTC::ConfigAdmin::setConfigurationSetValues ( const coil::Properties &  configuration_set  ) 

Add to configuration set from specified property.

Add specified property to configuration set that was specified by ID. Return false if configuration set, that matches specified ID, doesn't exist.

Parameters:
config_id ID of the target configuration set for add
configuration_set Property to add
Returns:
Add result (Successful:true, Failed:false)

const coil::Properties& RTC::ConfigAdmin::getActiveConfigurationSet ( void   ) 

Get the active configuration set.

Get the current active configuration set. Return empty configuration set, if an active configuration set doesn't exist.

Returns:
The active configuration set

bool RTC::ConfigAdmin::addConfigurationSet ( const coil::Properties &  configuration_set  ) 

Add the configuration value to configuration set.

Add the configuration value to configuration set

Parameters:
configuration_set Property to add
Returns:
Add Result (Successful:true, Failed:false)

bool RTC::ConfigAdmin::removeConfigurationSet ( const char *  config_id  ) 

Remove the configuration set.

Remove the configuration set of specified ID Return empty configuration set, if a configuration set of specified ID doesn't exist.

Parameters:
config_id ID of the target configuration set for remove
Returns:
Remove result (Successful:true, Failed:false)

bool RTC::ConfigAdmin::activateConfigurationSet ( const char *  config_id  ) 

Activate the configuration set.

Activate the configuration set of specified ID Return empty configuration set, if a configuration set of specified ID doesn't exist.

Parameters:
config_id ID of the target configuration set for remove
Returns:
Activate result (Remove success:true、Remove failure:false)

void RTC::ConfigAdmin::setOnUpdate ( OnUpdateCallback cb  ) 

void RTC::ConfigAdmin::setOnUpdateParam ( OnUpdateParamCallback cb  ) 

void RTC::ConfigAdmin::setOnSetConfigurationSet ( OnSetConfigurationSetCallback cb  ) 

void RTC::ConfigAdmin::setOnAddConfigurationSet ( OnAddConfigurationAddCallback cb  ) 

void RTC::ConfigAdmin::setOnRemoveConfigurationSet ( OnRemoveConfigurationSetCallback cb  ) 

void RTC::ConfigAdmin::setOnActivateSet ( OnActivateSetCallback cb  ) 

void RTC::ConfigAdmin::onUpdate ( const char *  config_set  )  [protected]

void RTC::ConfigAdmin::onUpdateParam ( const char *  config_set,
const char *  config_param 
) [protected]

void RTC::ConfigAdmin::onSetConfigurationSet ( const coil::Properties &  config_set  )  [protected]

void RTC::ConfigAdmin::onAddConfigurationSet ( const coil::Properties &  config_set  )  [protected]

void RTC::ConfigAdmin::onRemoveConfigurationSet ( const char *  config_id  )  [protected]

void RTC::ConfigAdmin::onActivateSet ( const char *  config_id  )  [protected]


Generated on Sun May 24 14:08:45 2009 for OpenRTM by  doxygen 1.5.3