33 : m_configsets(configsets), m_activeId(
"default"),
34 m_active(true), m_changed(false)
47 for (
int i(0), len(
m_params.size()); i < len; ++i)
88 for (
int i(0), len(
m_params.size()); i < len; ++i)
108 if ((config_set == 0) || (config_param == 0)) {
return; }
110 std::string key(config_set);
111 key +=
"."; key += config_param;
113 std::vector<ConfigBase*>::iterator it;
134 std::vector<ConfigBase*>::iterator it;
182 std::string node(config_set.
getName());
183 if (node.empty()) {
return false; }
217 std::string node(config_set.
getName());
218 if (node.empty()) {
return false; }
240 if (strcmp(config_id,
"default") == 0)
return false;
244 std::vector<std::string>::iterator it;
249 if (p != NULL) {
delete p; }
267 if (config_id == NULL) {
return false; }
269 if (config_id[0] ==
'_') {
return false; }
284 std::cerr <<
"setOnUpdate function is obsolete." << std::endl;
285 std::cerr <<
"Use addConfigurationSetNameListener instead." << std::endl;
291 std::cerr <<
"setOnUpdateParam function is obsolete." << std::endl;
292 std::cerr <<
"Use addConfigurationParamListener instead." << std::endl;
298 std::cerr <<
"setOnSetConfigurationSet function is obsolete." << std::endl;
299 std::cerr <<
"Use addConfigurationSetListener instead." << std::endl;
305 std::cerr <<
"setOnAddConfigurationSet function is obsolete." << std::endl;
306 std::cerr <<
"Use addConfigurationSetListener instead." << std::endl;
313 std::cerr <<
"setOnRemoveConfigurationSet function is obsolete."<<std::endl;
314 std::cerr <<
"Use addConfigurationSetNameListener instead." << std::endl;
320 std::cerr <<
"setOnActivateSet function is obsolete." << std::endl;
321 std::cerr <<
"Use addConfigurationSetNameListener instead." << std::endl;
void removeConfigurationSetNameListener(ConfigurationSetNameListenerType type, ConfigurationSetNameListener *listener)
Removing ConfigurationSetNameListener.
void onUpdateParam(const char *config_set, const char *config_param)
When the configuration parameter is updated, it is called.
void onRemoveConfigurationSet(const char *config_id)
Called when the configuration set has been deleted.
void addConfigurationSetNameListener(ConfigurationSetNameListenerType type, ConfigurationSetNameListener *listener, bool autoclean=true)
Adding ConfigurationSetNameListener.
bool activateConfigurationSet(const char *config_id)
Activate the configuration set.
ConfigAdmin(coil::Properties &prop)
Constructor.
const std::vector< coil::Properties * > & getConfigurationSets(void)
Get all configuration sets.
void notify(const char *config_set_name, const char *config_param_name)
Notify listeners.
ConfigurationSetNameListenerHolder configsetname_[CONFIG_SET_NAME_LISTENER_NUM]
ConfigurationSetNameListenerType listener array The ConfigurationSetNameListenerType listener is stor...
ConfigurationSetListenerHolder configset_[CONFIG_SET_LISTENER_NUM]
ConfigurationSetType listener array The ConfigurationSetType listener is stored.
ConfigurationParamListenerHolder configparam_[CONFIG_PARAM_LISTENER_NUM]
ConfigurationParamType listener array The ConfigurationParamType listener is stored.
void setOnRemoveConfigurationSet(OnRemoveConfigurationSetCallback *cb)
ConfigurationSetListener class.
ConfigurationSetNameListener class.
ConfigurationParamListener class.
Configuration Administration classes.
ConfigurationSetNameListenerType
The types of ConfigurationSetNameListener.
const coil::Properties & getActiveConfigurationSet(void)
Get the active configuration set.
void onActivateSet(const char *config_id)
Called when the configuration set is made active.
void addConfigurationSetListener(ConfigurationSetListenerType type, ConfigurationSetListener *listener, bool autoclean=true)
Adding ConfigurationSetListener.
void setOnActivateSet(OnActivateSetCallback *cb)
void addListener(ConfigurationParamListener *listener, bool autoclean)
Add the listener.
void removeConfigurationSetListener(ConfigurationSetListenerType type, ConfigurationSetListener *listener)
Removing ConfigurationSetListener.
std::vector< std::string > m_newConfig
const coil::Properties & getConfigurationSet(const char *config_id)
Get a configuration set by specified ID.
bool isExist(const char *name)
Check the existence of configuration parameters.
void removeListener(ConfigurationSetNameListener *listener)
Remove the listener.
const char * getName(void) const
Get Names.
Properties * hasKey(const char *key) const
Check whether key exists in the children.
const std::vector< Properties * > & getLeaf(void) const
Get elements of leaf.
coil::Properties & m_configsets
void addListener(ConfigurationSetListener *listener, bool autoclean)
Add the listener.
coil::Properties m_emptyconf
void update(void)
Update the values of configuration parameters (Active configuration set)
void setOnUpdate(OnUpdateCallback *cb)
void setOnSetConfigurationSet(OnSetConfigurationSetCallback *cb)
bool addConfigurationSet(const coil::Properties &configuration_set)
Add the configuration value to configuration set.
CORBA::Long find(const CorbaSequence &seq, Functor f)
Return the index of CORBA sequence element that functor matches.
Properties *const findNode(const std::string &key) const
Get node of properties.
void addConfigurationParamListener(ConfigurationParamListenerType type, ConfigurationParamListener *listener, bool autoclean=true)
Adding ConfigurationParamListener.
Properties * removeNode(const char *leaf_name)
Remove node of Properties.
void removeListener(ConfigurationParamListener *listener)
Remove the listener.
~ConfigAdmin(void)
Virtual Destructor.
void removeListener(ConfigurationSetListener *listener)
Remove the listener.
prop
Organization::get_organization_property ();.
void onUpdate(const char *config_set)
When the configuration parameter is updated, it is called.
void notify(const coil::Properties &config_set)
Notify listeners.
Class represents a set of properties.
void notify(const char *config_set_name)
Notify listeners.
void onSetConfigurationSet(const coil::Properties &config_set)
Called when the property is added to the configuration set.
void addListener(ConfigurationSetNameListener *listener, bool autoclean)
Add the listener.
Properties & getNode(const std::string &key)
Get node of properties.
void onAddConfigurationSet(const coil::Properties &config_set)
Called when a set value is added to the configuration set.
void setOnAddConfigurationSet(OnAddConfigurationAddCallback *cb)
std::vector< ConfigBase * > m_params
ConfigurationSetListenerType
The types of ConfigurationSetListener.
ConfigurationListeners m_listeners
void removeConfigurationParamListener(ConfigurationParamListenerType type, ConfigurationParamListener *listener)
Removing ConfigurationParamListener.
bool setConfigurationSetValues(const coil::Properties &configuration_set)
Add to configuration set from specified property.
void setOnUpdateParam(OnUpdateParamCallback *cb)
bool removeConfigurationSet(const char *config_id)
Remove the configuration set.
ConfigurationParamListenerType
The types of ConnectorDataListener.