RTC::ConfigAdmin Class Reference

ConfigAdmin class. More...

#include <ConfigAdmin.h>

List of all members.

Public Member Functions

 ConfigAdmin (RTC::Properties &prop)
 Constructor.
 ~ConfigAdmin ()
 Virtual Destructor.
template<typename VarType>
bool bindParameter (const char *param_name, VarType &var, const char *def_val, bool(*trans)(VarType &, const char *)=::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 ()
 Update the values of configuration parameters (Active configuration set).
bool isExist (const char *name)
 Check the existence of configuration parameters.
bool isChanged ()
 Confirm to change configuration parameters.
const char * getActiveId ()
 Get ID of active configuration set.
bool haveConfig (const char *config_id)
 Check the existence of configuration set.
bool isActive ()
 Confirm to activate configuration set.
const std::vector
< Properties * > & 
getConfigurationSets ()
 Get all configuration sets.
const PropertiesgetConfigurationSet (const char *config_id)
 Get a configuration set by specified ID.
bool setConfigurationSetValues (const char *config_id, const RTC::Properties &configuration_set)
 Add to configuration set from specified property.
const PropertiesgetActiveConfigurationSet ()
 Get the active configuration set.
bool addConfigurationSet (const 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.

Classes

struct  find_conf


Detailed Description

ConfigAdmin class.

Class to manage various configuration information.

Since:
0.4.0

Constructor & Destructor Documentation

RTC::ConfigAdmin::ConfigAdmin ( RTC::Properties prop  ) 

Constructor.

Constructor

Parameters:
prop The target property name for setup

RTC::ConfigAdmin::~ConfigAdmin (  ) 

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 = ::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 (  ) 

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 (  )  [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 (  )  [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 (  )  [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<Properties*>& RTC::ConfigAdmin::getConfigurationSets (  ) 

Get all configuration sets.

Get all specified configuration sets

Returns:
All configuration sets

const 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 char *  config_id,
const RTC::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 Properties& RTC::ConfigAdmin::getActiveConfigurationSet (  ) 

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


Generated on Thu May 29 15:03:33 2008 for OpenRTM by  doxygen 1.5.3