#include <ConfigAdmin.h>
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 Properties & | getConfigurationSet (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 Properties & | getActiveConfigurationSet () |
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 |
Class to manage various configuration information.
RTC::ConfigAdmin::ConfigAdmin | ( | RTC::Properties & | prop | ) |
Constructor.
Constructor
prop | The target property name for setup |
RTC::ConfigAdmin::~ConfigAdmin | ( | ) |
Virtual Destructor.
Virtual Destructor
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>.
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 |
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.
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.
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.
name | Configuration parameter name |
bool RTC::ConfigAdmin::isChanged | ( | ) | [inline] |
Confirm to change configuration parameters.
Confirm that configuration parameters have changed.
const char* RTC::ConfigAdmin::getActiveId | ( | ) | [inline] |
Get ID of active configuration set.
Get ID of the current active configuration set.
bool RTC::ConfigAdmin::haveConfig | ( | const char * | config_id | ) | [inline] |
Check the existence of configuration set.
Check the existence of specified configuration set.
config_id | ID of target configuration set for confirmation |
bool RTC::ConfigAdmin::isActive | ( | ) | [inline] |
Confirm to activate configuration set.
Confirm that configuration set has been activated.
const std::vector<Properties*>& RTC::ConfigAdmin::getConfigurationSets | ( | ) |
Get all configuration sets.
Get all specified 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.
config_id | ID of the target configuration set for getting |
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.
config_id | ID of the target configuration set for add | |
configuration_set | Property to add |
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.
bool RTC::ConfigAdmin::addConfigurationSet | ( | const Properties & | configuration_set | ) |
Add the configuration value to configuration set.
Add the configuration value to configuration set
configuration_set | Property to add |
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.
config_id | ID of the target configuration set for remove |
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.
config_id | ID of the target configuration set for remove |