Classes | Public Member Functions | Private Attributes | List of all members
OpenRTM_aist.ConfigAdmin.ConfigAdmin Class Reference

ConfigAdmin class. More...

Classes

class  find_conf
 

Public Member Functions

def __del__ (self)
 Destructor. More...
 
def __init__ (self, configsets)
 Constructor. More...
 
def activateConfigurationSet (self, config_id)
 Activate the configuration set. More...
 
def addConfigurationParamListener (self, type, listener, autoclean=True)
 Adding ConfigurationParamListener. More...
 
def addConfigurationSet (self, configset)
 Add the configuration value to configuration set. More...
 
def addConfigurationSetListener (self, type, listener, autoclean=True)
 Adding ConfigurationSetListener. More...
 
def addConfigurationSetNameListener (self, type, listener, autoclean=True)
 Adding ConfigurationSetNameListener. More...
 
def bindParameter (self, param_name, var, def_val, trans=None)
 Setup for configuration parameters. More...
 
def getActiveConfigurationSet (self)
 Get the active configuration set. More...
 
def getActiveId (self)
 Get ID of active configuration set. More...
 
def getConfigurationSet (self, config_id)
 Get a configuration set by specified ID. More...
 
def getConfigurationSets (self)
 Get all configuration sets. More...
 
def haveConfig (self, config_id)
 Check the existence of configuration set. More...
 
def isActive (self)
 Confirm to activate configuration set. More...
 
def isChanged (self)
 Confirm to change configuration parameters. More...
 
def isExist (self, param_name)
 Check the existence of configuration parameters. More...
 
def onActivateSet (self, config_id)
 Called when the configuration set is made active. More...
 
def onAddConfigurationSet (self, config_set)
 Called when a set value is added to the configuration set. More...
 
def onRemoveConfigurationSet (self, config_id)
 Called when the configuration set has been deleted. More...
 
def onSetConfigurationSet (self, config_set)
 Called when the property is added to the configuration set. More...
 
def onUpdate (self, config_set)
 When the configuration parameter is updated, it is called. More...
 
def onUpdateParam (self, config_set, config_param)
 When the configuration parameter is updated, it is called. More...
 
def removeConfigurationParamListener (self, type, listener)
 Removing ConfigurationParamListener. More...
 
def removeConfigurationSet (self, config_id)
 Remove the configuration set. More...
 
def removeConfigurationSetListener (self, type, listener)
 Removing ConfigurationSetListener. More...
 
def removeConfigurationSetNameListener (self, type, listener)
 Removing ConfigurationSetNameListener. More...
 
def setConfigurationSetValues (self, config_set)
 Add to configuration set from specified property. More...
 
def setOnActivateSet (self, cb)
 Set callback that is called by OnActivateSet. More...
 
def setOnAddConfigurationSet (self, cb)
 Set callback that is called by OnSetConfiguration. More...
 
def setOnRemoveConfigurationSet (self, cb)
 Set callback that is called by OnRemoveConfigurationSet. More...
 
def setOnSetConfigurationSet (self, cb)
 Set callback that is called by OnSetConfiguration. More...
 
def setOnUpdate (self, cb)
 Set callback that is called by OnUpdate. More...
 
def setOnUpdateParam (self, cb)
 Set callback that is called by OnUpdateParam. More...
 
def update (self, config_set=None, config_param=None)
 void update(void); More...
 

Private Attributes

 _active
 
 _activeId
 
 _changed
 
 _configsets
 
 _emptyconf
 
 _listeners
 
 _newConfig
 
 _params
 

Detailed Description

ConfigAdmin class.

Class to manage various configuration information. Now terms for this class are defined as follows.

The following two configuration informations are stored in this class.

  1. A list of configuration-set
  2. A list of configuration parameter variables

Basically, the purpose of this class is to set one of the configuration-set in the list of (1) into parameter variables of (2). Usually, configuration parameter variables manipulation is performed with two-phases of configuration-set setting and parameter variables setting.

The configuration-set manipulations are performed by the following functions.

Modification, addition, deletion, acquisition and activation of configuration-set are performed by these functions. In order to reflect configuration-set, which is manipulated by these functions, on parameter variables that are used from RTC activities, the following update() functions are used .

Callback functors can be given to hook configuration operation. Operations to be hooked are as follows.

Since
0.4.0

Definition at line 318 of file ConfigAdmin.py.

Constructor & Destructor Documentation

◆ __init__()

def OpenRTM_aist.ConfigAdmin.ConfigAdmin.__init__ (   self,
  configsets 
)

Constructor.

Parameters
self
propThe target property name for setup

ConfigAdmin(coil::Properties& prop);

Definition at line 341 of file ConfigAdmin.py.

◆ __del__()

def OpenRTM_aist.ConfigAdmin.ConfigAdmin.__del__ (   self)

Destructor.

Parameters
self

Definition at line 368 of file ConfigAdmin.py.

Member Function Documentation

◆ activateConfigurationSet()

def OpenRTM_aist.ConfigAdmin.ConfigAdmin.activateConfigurationSet (   self,
  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
self
config_idID of the target configuration set for remove
Returns
Activate result (Remove success:trueĦ˘Remove failure:false)

bool activateConfigurationSet(const char* config_id);

Definition at line 1010 of file ConfigAdmin.py.

◆ addConfigurationParamListener()

def OpenRTM_aist.ConfigAdmin.ConfigAdmin.addConfigurationParamListener (   self,
  type,
  listener,
  autoclean = True 
)

Adding ConfigurationParamListener.

This function adds a listener object which is called when update(const char* config_set, const char* config_param) is called. In the type argument, currently only ON_UPDATE_CONFIG_PARAM is allowed.

Parameters
typeConfigurationParamListenerType value ON_UPDATE_CONFIG_PARAM is only allowed.
listenerConfigurationParamListener listener object.
autocleana flag whether if the listener object autocleaned.

void addConfigurationParamListener(ConfigurationParamListenerType type, ConfigurationParamListener* listener, bool autoclean = true);

Definition at line 1231 of file ConfigAdmin.py.

◆ addConfigurationSet()

def OpenRTM_aist.ConfigAdmin.ConfigAdmin.addConfigurationSet (   self,
  configset 
)

Add the configuration value to configuration set.

Add the configuration value to configuration set

Parameters
self
configuration_setProperty to add
Returns
Add Result (Successful:true, Failed:false)

bool addConfigurationSet(const coil::Properties& configuration_set);

Definition at line 873 of file ConfigAdmin.py.

◆ addConfigurationSetListener()

def OpenRTM_aist.ConfigAdmin.ConfigAdmin.addConfigurationSetListener (   self,
  type,
  listener,
  autoclean = True 
)

Adding ConfigurationSetListener.

This function add a listener object which is called when ConfigurationSet is updated. Available events are the followings.

Parameters
typeConfigurationSetListenerType value
listenerConfigurationSetListener listener object.
autocleana flag whether if the listener object autocleaned.

void addConfigurationSetListener(ConfigurationSetListenerType type, ConfigurationSetListener* listener, bool autoclean = true);

Definition at line 1301 of file ConfigAdmin.py.

◆ addConfigurationSetNameListener()

def OpenRTM_aist.ConfigAdmin.ConfigAdmin.addConfigurationSetNameListener (   self,
  type,
  listener,
  autoclean = True 
)

Adding ConfigurationSetNameListener.

This function add a listener object which is called when ConfigurationSetName is updated. Available events are the followings.

  • ON_UPDATE_CONFIG_SET: A ConfigurationSet has been updated.
  • ON_REMOVE_CONFIG_SET: A ConfigurationSet has been deleted.
  • ON_ACTIVATE_CONFIG_SET: A ConfigurationSet has been activated.
Parameters
typeConfigurationSetNameListenerType value
listenerConfigurationSetNameListener listener object.
autocleana flag whether if the listener object autocleaned.

void addConfigurationSetNameListener(ConfigurationSetNameListenerType type, ConfigurationSetNameListener* listener, bool autoclean = true);

Definition at line 1371 of file ConfigAdmin.py.

◆ bindParameter()

def OpenRTM_aist.ConfigAdmin.ConfigAdmin.bindParameter (   self,
  param_name,
  var,
  def_val,
  trans = None 
)

Setup for configuration parameters.

Bind configuration parameter to its variable. Return false, if configuration parameter of specified name has already existed.

Parameters
self
param_nameConfiguration parameter name
varConfiguration parameter variable
def_valDefault value of configuration parameter
transFunction to transform configuration parameter type into string format
Returns
Setup result (Successful:true, Failed:false)

template <typename vartype>=""> bool bindParameter(const char* param_name, VarType& var, const char* def_val, bool (trans)(VarType&, const char) = coil::stringTo)

Definition at line 413 of file ConfigAdmin.py.

◆ getActiveConfigurationSet()

def OpenRTM_aist.ConfigAdmin.ConfigAdmin.getActiveConfigurationSet (   self)

Get the active configuration set.

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

Parameters
self
Returns
The active configuration set

const coil::Properties& getActiveConfigurationSet(void);

Definition at line 840 of file ConfigAdmin.py.

◆ getActiveId()

def OpenRTM_aist.ConfigAdmin.ConfigAdmin.getActiveId (   self)

Get ID of active configuration set.

Get ID of the current active configuration set.

Parameters
self
Returns
The active configuration set ID

const char* getActiveId(void);

Definition at line 645 of file ConfigAdmin.py.

◆ getConfigurationSet()

def OpenRTM_aist.ConfigAdmin.ConfigAdmin.getConfigurationSet (   self,
  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
self
config_idID of the target configuration set for getting
Returns
The configuration set

const coil::Properties& getConfigurationSet(const char* config_id);

Definition at line 764 of file ConfigAdmin.py.

◆ getConfigurationSets()

def OpenRTM_aist.ConfigAdmin.ConfigAdmin.getConfigurationSets (   self)

Get all configuration sets.

Get all specified configuration sets

Parameters
self
Returns
All configuration sets

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

Definition at line 731 of file ConfigAdmin.py.

◆ haveConfig()

def OpenRTM_aist.ConfigAdmin.ConfigAdmin.haveConfig (   self,
  config_id 
)

Check the existence of configuration set.

Check the existence of specified configuration set.

Parameters
self
config_idID of target configuration set for confirmation
Returns
Result of existence confirmation (Specified ConfigSet exists:true, else:false) bool haveConfig(const char* config_id);

Definition at line 673 of file ConfigAdmin.py.

◆ isActive()

def OpenRTM_aist.ConfigAdmin.ConfigAdmin.isActive (   self)

Confirm to activate configuration set.

Confirm that configuration set has been activated.

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

bool isActive(void);

Definition at line 704 of file ConfigAdmin.py.

◆ isChanged()

def OpenRTM_aist.ConfigAdmin.ConfigAdmin.isChanged (   self)

Confirm to change configuration parameters.

Confirm that configuration parameters have changed.

Parameters
self
Returns
Result of change confirmation (There is a change:trueĦ˘No change:false)

bool isChanged(void) {return m_changed;}

Definition at line 618 of file ConfigAdmin.py.

◆ isExist()

def OpenRTM_aist.ConfigAdmin.ConfigAdmin.isExist (   self,
  param_name 
)

Check the existence of configuration parameters.

Check the existence of configuration parameters of specified name.

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

bool isExist(const char* name);

Definition at line 583 of file ConfigAdmin.py.

◆ onActivateSet()

def OpenRTM_aist.ConfigAdmin.ConfigAdmin.onActivateSet (   self,
  config_id 
)

Called when the configuration set is made active.

Call the set callback object.

Parameters
self
config_idproperty

void onActivateSet(const char* config_id);

Definition at line 1569 of file ConfigAdmin.py.

◆ onAddConfigurationSet()

def OpenRTM_aist.ConfigAdmin.ConfigAdmin.onAddConfigurationSet (   self,
  config_set 
)

Called when a set value is added to the configuration set.

Call the set callback object.

Parameters
self
configuration_setproperty

void onAddConfigurationSet(const coil::Properties& config_set);

Definition at line 1515 of file ConfigAdmin.py.

◆ onRemoveConfigurationSet()

def OpenRTM_aist.ConfigAdmin.ConfigAdmin.onRemoveConfigurationSet (   self,
  config_id 
)

Called when the configuration set has been deleted.

Call the set callback object.

Parameters
self
config_idproperty

void onRemoveConfigurationSet(const char* config_id);

Definition at line 1542 of file ConfigAdmin.py.

◆ onSetConfigurationSet()

def OpenRTM_aist.ConfigAdmin.ConfigAdmin.onSetConfigurationSet (   self,
  config_set 
)

Called when the property is added to the configuration set.

Call the set callback object.

Parameters
self
configuration_setproperty

void onSetConfigurationSet(const coil::Properties& config_set);

Definition at line 1488 of file ConfigAdmin.py.

◆ onUpdate()

def OpenRTM_aist.ConfigAdmin.ConfigAdmin.onUpdate (   self,
  config_set 
)

When the configuration parameter is updated, it is called.

Call the set callback object.

Parameters
self
config_setThe target configuration set's ID to setup

void onUpdate(const char* config_set);

Definition at line 1431 of file ConfigAdmin.py.

◆ onUpdateParam()

def OpenRTM_aist.ConfigAdmin.ConfigAdmin.onUpdateParam (   self,
  config_set,
  config_param 
)

When the configuration parameter is updated, it is called.

Call the set callback object.

Parameters
self
config_setconfiguration-set ID.
config_paramconfiguration parameter name.

void onUpdateParam(const char* config_set, const char* config_param);

Definition at line 1460 of file ConfigAdmin.py.

◆ removeConfigurationParamListener()

def OpenRTM_aist.ConfigAdmin.ConfigAdmin.removeConfigurationParamListener (   self,
  type,
  listener 
)

Removing ConfigurationParamListener.

This function removes a listener object which is added by addConfigurationParamListener() function.

Parameters
typeConfigurationParamListenerType value ON_UPDATE_CONFIG_PARAM is only allowed.
listenera pointer to ConfigurationParamListener listener object.

void removeConfigurationParamListener(ConfigurationParamListenerType type, ConfigurationParamListener* listener);

Definition at line 1262 of file ConfigAdmin.py.

◆ removeConfigurationSet()

def OpenRTM_aist.ConfigAdmin.ConfigAdmin.removeConfigurationSet (   self,
  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.

The configuration-sets that can be removed by this function are only configuration-sets newly added by the addConfigurationSet() function. The configuration that can be removed by this function is only newly added configuration-set by addConfigurationSet() function. The "default" configuration-set and configurationi-sets that is loaded from configuration file cannot be removed.

If the specified configuration is active currently, any configurations are not deleted.

Callback functions that are set by addOnRemovedConfigurationSet() will be called if a configuration-set is deleted actually by this function.

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

bool removeConfigurationSet(const char* config_id);

Definition at line 951 of file ConfigAdmin.py.

◆ removeConfigurationSetListener()

def OpenRTM_aist.ConfigAdmin.ConfigAdmin.removeConfigurationSetListener (   self,
  type,
  listener 
)

Removing ConfigurationSetListener.

This function removes a listener object which is added by addConfigurationSetListener() function.

Parameters
typeConfigurationSetListenerType value
listenera pointer to ConfigurationSetListener listener object.

void removeConfigurationSetListener(ConfigurationSetListenerType type, ConfigurationSetListener* listener);

Definition at line 1329 of file ConfigAdmin.py.

◆ removeConfigurationSetNameListener()

def OpenRTM_aist.ConfigAdmin.ConfigAdmin.removeConfigurationSetNameListener (   self,
  type,
  listener 
)

Removing ConfigurationSetNameListener.

This function removes a listener object which is added by addConfigurationSetNameListener() function.

Parameters
typeConfigurationSetNameListenerType value ON_UPDATE_CONFIG_PARAM is only allowed.
listenera pointer to ConfigurationSetNameListener listener object.

void removeConfigurationSetNameListener(ConfigurationSetNameListenerType type, ConfigurationSetNameListener* listener);

Definition at line 1404 of file ConfigAdmin.py.

◆ setConfigurationSetValues()

def OpenRTM_aist.ConfigAdmin.ConfigAdmin.setConfigurationSetValues (   self,
  config_set 
)

Add to configuration set from specified property.

Add specified property to configuration set.

Parameters
self
configuration_setProperty to add
Returns
Add result (Successful:true, Failed:false)

bool setConfigurationSetValues(const coil::Properties& config_set)

Definition at line 796 of file ConfigAdmin.py.

◆ setOnActivateSet()

def OpenRTM_aist.ConfigAdmin.ConfigAdmin.setOnActivateSet (   self,
  cb 
)

Set callback that is called by OnActivateSet.

Parameters
self
cbOnActivateSetCallback type object

void setOnActivateSet(OnActivateSetCallback* cb);

Definition at line 1186 of file ConfigAdmin.py.

◆ setOnAddConfigurationSet()

def OpenRTM_aist.ConfigAdmin.ConfigAdmin.setOnAddConfigurationSet (   self,
  cb 
)

Set callback that is called by OnSetConfiguration.

Parameters
self
cbOnSetConfigurationSetCallback type object

void setOnAddConfigurationSet(OnAddConfigurationAddCallback* cb);

Definition at line 1132 of file ConfigAdmin.py.

◆ setOnRemoveConfigurationSet()

def OpenRTM_aist.ConfigAdmin.ConfigAdmin.setOnRemoveConfigurationSet (   self,
  cb 
)

Set callback that is called by OnRemoveConfigurationSet.

Parameters
self
cbOnRemoveConfigurationSetCallback type object

void setOnRemoveConfigurationSet(OnRemoveConfigurationSetCallback* cb);

Definition at line 1159 of file ConfigAdmin.py.

◆ setOnSetConfigurationSet()

def OpenRTM_aist.ConfigAdmin.ConfigAdmin.setOnSetConfigurationSet (   self,
  cb 
)

Set callback that is called by OnSetConfiguration.

Parameters
self
cbOnSetConfigurationSetCallback type object

void setOnSetConfigurationSet(OnSetConfigurationSetCallback* cb);

Definition at line 1105 of file ConfigAdmin.py.

◆ setOnUpdate()

def OpenRTM_aist.ConfigAdmin.ConfigAdmin.setOnUpdate (   self,
  cb 
)

Set callback that is called by OnUpdate.

Parameters
self
cbOnUpdateCallback type object

void setOnUpdate(OnUpdateCallback* cb);

Definition at line 1051 of file ConfigAdmin.py.

◆ setOnUpdateParam()

def OpenRTM_aist.ConfigAdmin.ConfigAdmin.setOnUpdateParam (   self,
  cb 
)

Set callback that is called by OnUpdateParam.

Parameters
self
cbOnUpdateParamCallback type object

void setOnUpdateParam(OnUpdateParamCallback* cb);

Definition at line 1078 of file ConfigAdmin.py.

◆ update()

def OpenRTM_aist.ConfigAdmin.ConfigAdmin.update (   self,
  config_set = None,
  config_param = None 
)

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

void update(const char* config_set);

Update configuration parameter (By ID)

This operation updates configuration variables by the configuration-set with specified ID. This operation does not change current active configuration-set. Since this operation causes inconsistency between current active configuration set and actual values of configuration variables, user should carefully use it.

This operation ends without doing anything, if the configuration-set does not exist.

Parameters
config_setThe target configuration set's ID to setup

void update(const char* config_set, const char* config_param);

Update the values of configuration parameters (By name)

This operation updates a configuration variable by the specified configuration parameter in the configuration-set. This operation does not change current active configuration-set. Since this operation causes inconsistency between current active configuration set and actual values of configuration variables, user should carefully use it.

This operation ends without doing anything, if the configuration-set or the configuration parameter do not exist.

Parameters
config_setconfiguration-set ID.
config_paramconfiguration parameter name.

Definition at line 528 of file ConfigAdmin.py.

Member Data Documentation

◆ _active

OpenRTM_aist.ConfigAdmin.ConfigAdmin._active
private

Definition at line 344 of file ConfigAdmin.py.

◆ _activeId

OpenRTM_aist.ConfigAdmin.ConfigAdmin._activeId
private

Definition at line 343 of file ConfigAdmin.py.

◆ _changed

OpenRTM_aist.ConfigAdmin.ConfigAdmin._changed
private

Definition at line 345 of file ConfigAdmin.py.

◆ _configsets

OpenRTM_aist.ConfigAdmin.ConfigAdmin._configsets
private

Definition at line 342 of file ConfigAdmin.py.

◆ _emptyconf

OpenRTM_aist.ConfigAdmin.ConfigAdmin._emptyconf
private

Definition at line 347 of file ConfigAdmin.py.

◆ _listeners

OpenRTM_aist.ConfigAdmin.ConfigAdmin._listeners
private

Definition at line 349 of file ConfigAdmin.py.

◆ _newConfig

OpenRTM_aist.ConfigAdmin.ConfigAdmin._newConfig
private

Definition at line 348 of file ConfigAdmin.py.

◆ _params

OpenRTM_aist.ConfigAdmin.ConfigAdmin._params
private

Definition at line 346 of file ConfigAdmin.py.


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


openrtm_aist_python
Author(s): Shinji Kurihara
autogenerated on Mon Feb 28 2022 23:01:07