A class for keeping track of Attribute, Constant and Property objects of a TaskContext. It allows plugins and remote components to browse the attributes and properties of a TaskContext. More...
#include <ConfigurationInterface.hpp>
Public Types | |
typedef std::vector< std::string > | AttributeNames |
typedef std::vector< std::string > | AttributeNames |
typedef std::vector < base::AttributeBase * > | AttributeObjects |
typedef std::vector < base::AttributeBase * > | AttributeObjects |
Public Member Functions | |
bool | addAttribute (base::AttributeBase &a) |
template<class T > | |
Attribute< T > & | addAttribute (const std::string &name, Attribute< T > &attr) |
template<class T > | |
bool | addAttribute (const std::string &name, T &attr) |
bool | addAttribute (base::AttributeBase &a) |
template<class T > | |
Attribute< T > & | addAttribute (const std::string &name, Attribute< T > &attr) |
template<class T > | |
bool | addAttribute (const std::string &name, T &attr) |
bool | addConstant (base::AttributeBase &c) |
template<class T > | |
Constant< T > & | addConstant (const std::string &name, Constant< T > &cnst) |
template<class T > | |
bool | addConstant (const std::string &name, const T &cnst) |
bool | addConstant (base::AttributeBase &c) |
template<class T > | |
Constant< T > & | addConstant (const std::string &name, Constant< T > &cnst) |
template<class T > | |
bool | addConstant (const std::string &name, const T &cnst) |
bool | addProperty (base::PropertyBase &pb) |
template<class T > | |
Property< T > & | addProperty (const std::string &name, Property< T > &prop) |
template<class T > | |
Property< T > & | addProperty (const std::string &name, T &prop) |
bool | addProperty (base::PropertyBase &pb) |
template<class T > | |
Property< T > & | addProperty (const std::string &name, Property< T > &prop) |
template<class T > | |
Property< T > & | addProperty (const std::string &name, T &prop) |
void | clear () |
void | clear () |
ConfigurationInterface () | |
ConfigurationInterface () | |
ConfigurationInterface * | copy (std::map< const base::DataSourceBase *, base::DataSourceBase * > &repl, bool instantiate) const |
ConfigurationInterface * | copy (std::map< const base::DataSourceBase *, base::DataSourceBase * > &repl, bool instantiate) const |
base::AttributeBase * | getAttribute (const std::string &name) const |
base::AttributeBase * | getAttribute (const std::string &name) const |
AttributeNames | getAttributeNames () const |
AttributeNames | getAttributeNames () const |
base::AttributeBase * | getConstant (const std::string &name) const |
base::AttributeBase * | getConstant (const std::string &name) const |
base::PropertyBase * | getProperty (const std::string &name) const |
base::PropertyBase * | getProperty (const std::string &name) const |
base::AttributeBase * | getValue (const std::string &name) const |
base::AttributeBase * | getValue (const std::string &name) const |
AttributeObjects const & | getValues () const |
AttributeObjects const & | getValues () const |
bool | hasAttribute (const std::string &name) const |
bool | hasAttribute (const std::string &name) const |
bool | hasProperty (const std::string &name) const |
bool | hasProperty (const std::string &name) const |
void | loadValues (AttributeObjects const &new_values) |
void | loadValues (AttributeObjects const &new_values) |
PropertyBag * | properties () |
PropertyBag * | properties () |
void | removeAttribute (const std::string &name) |
void | removeAttribute (const std::string &name) |
bool | removeProperty (base::PropertyBase &p) |
bool | removeProperty (base::PropertyBase &p) |
bool | removeValue (const std::string &name) |
bool | removeValue (const std::string &name) |
bool | setValue (base::AttributeBase *ab) |
bool | setValue (base::AttributeBase *ab) |
~ConfigurationInterface () | |
~ConfigurationInterface () | |
Protected Types | |
typedef std::vector < base::AttributeBase * > | map_t |
typedef std::vector < base::AttributeBase * > | map_t |
Protected Attributes | |
PropertyBag | bag |
map_t | values |
A class for keeping track of Attribute, Constant and Property objects of a TaskContext. It allows plugins and remote components to browse the attributes and properties of a TaskContext.
Definition at line 54 of file install/include/rtt/ConfigurationInterface.hpp.
typedef std::vector<std::string> RTT::ConfigurationInterface::AttributeNames |
A vector containing the names of all attribute objects in this repository.
Definition at line 74 of file rtt/ConfigurationInterface.hpp.
typedef std::vector<std::string> RTT::ConfigurationInterface::AttributeNames |
A vector containing the names of all attribute objects in this repository.
Definition at line 58 of file install/include/rtt/ConfigurationInterface.hpp.
typedef std::vector<base::AttributeBase*> RTT::ConfigurationInterface::AttributeObjects |
A vector containing pointers to all attribute objects stored in this repository.
Definition at line 80 of file rtt/ConfigurationInterface.hpp.
typedef std::vector<base::AttributeBase*> RTT::ConfigurationInterface::AttributeObjects |
A vector containing pointers to all attribute objects stored in this repository.
Definition at line 64 of file install/include/rtt/ConfigurationInterface.hpp.
typedef std::vector<base::AttributeBase*> RTT::ConfigurationInterface::map_t [protected] |
Definition at line 328 of file rtt/ConfigurationInterface.hpp.
typedef std::vector<base::AttributeBase*> RTT::ConfigurationInterface::map_t [protected] |
Definition at line 312 of file install/include/rtt/ConfigurationInterface.hpp.
RTT::ConfigurationInterface::ConfigurationInterface | ( | ) |
Create an empty ConfigurationInterface.
Definition at line 47 of file ConfigurationInterface.cpp.
RTT::ConfigurationInterface::~ConfigurationInterface | ( | ) |
Definition at line 51 of file ConfigurationInterface.cpp.
RTT::ConfigurationInterface::ConfigurationInterface | ( | ) |
Create an empty ConfigurationInterface.
RTT::ConfigurationInterface::~ConfigurationInterface | ( | ) |
bool RTT::ConfigurationInterface::addAttribute | ( | base::AttributeBase & | a | ) | [inline] |
Add an base::AttributeBase which remains owned by the user. This is a low-level function that can be used if you already created an Attribute object that does not belong yet to a service.
a | remains owned by the user, and becomes served by the repository. |
Definition at line 198 of file rtt/ConfigurationInterface.hpp.
Attribute<T>& RTT::ConfigurationInterface::addAttribute | ( | const std::string & | name, | |
Attribute< T > & | attr | |||
) | [inline] |
Adds an existing attribute object to the configuration interface.
name | The name of this attribute. attr will be initialized with this name. | |
attr | The attribute to add |
Definition at line 114 of file rtt/ConfigurationInterface.hpp.
bool RTT::ConfigurationInterface::addAttribute | ( | const std::string & | name, | |
T & | attr | |||
) | [inline] |
Adds a variable of any type as read/write attribute to the configuration interface. An Alias is created which causes contents of the attr variable always to be in sync with the contents of the attribute object in the interface.
name | The name of this attribute | |
attr | The variable that will be aliased. |
Definition at line 101 of file rtt/ConfigurationInterface.hpp.
bool RTT::ConfigurationInterface::addAttribute | ( | base::AttributeBase & | a | ) | [inline] |
Add an base::AttributeBase which remains owned by the user. This is a low-level function that can be used if you already created an Attribute object that does not belong yet to a service.
a | remains owned by the user, and becomes served by the repository. |
Definition at line 182 of file install/include/rtt/ConfigurationInterface.hpp.
Attribute<T>& RTT::ConfigurationInterface::addAttribute | ( | const std::string & | name, | |
Attribute< T > & | attr | |||
) | [inline] |
Adds an existing attribute object to the configuration interface.
name | The name of this attribute. attr will be initialized with this name. | |
attr | The attribute to add |
Definition at line 98 of file install/include/rtt/ConfigurationInterface.hpp.
bool RTT::ConfigurationInterface::addAttribute | ( | const std::string & | name, | |
T & | attr | |||
) | [inline] |
Adds a variable of any type as read/write attribute to the configuration interface. An Alias is created which causes contents of the attr variable always to be in sync with the contents of the attribute object in the interface.
name | The name of this attribute | |
attr | The variable that will be aliased. |
Definition at line 85 of file install/include/rtt/ConfigurationInterface.hpp.
bool RTT::ConfigurationInterface::addConstant | ( | base::AttributeBase & | c | ) | [inline] |
Add a Constant with a given value.
Definition at line 225 of file rtt/ConfigurationInterface.hpp.
Constant<T>& RTT::ConfigurationInterface::addConstant | ( | const std::string & | name, | |
Constant< T > & | cnst | |||
) | [inline] |
Adds an existing constant object to the configuration interface.
name | The name of this constant. cnst will be initialized with this name. | |
cnst | The constant to add. If cnst has not been initialized, it will be initialized to T(). You can change it later-on using the Constant's API. |
Definition at line 147 of file rtt/ConfigurationInterface.hpp.
bool RTT::ConfigurationInterface::addConstant | ( | const std::string & | name, | |
const T & | cnst | |||
) | [inline] |
Adds a variable of any type as read-only attribute to the configuration interface. An Alias is created which causes contents of the attribute always to be in sync with the contents of cnst, but it can only be read through the interface.
name | The name of this attribute | |
cnst | The variable that will be aliased. |
Definition at line 133 of file rtt/ConfigurationInterface.hpp.
bool RTT::ConfigurationInterface::addConstant | ( | base::AttributeBase & | c | ) | [inline] |
Add a Constant with a given value.
Definition at line 209 of file install/include/rtt/ConfigurationInterface.hpp.
Constant<T>& RTT::ConfigurationInterface::addConstant | ( | const std::string & | name, | |
Constant< T > & | cnst | |||
) | [inline] |
Adds an existing constant object to the configuration interface.
name | The name of this constant. cnst will be initialized with this name. | |
cnst | The constant to add. If cnst has not been initialized, it will be initialized to T(). You can change it later-on using the Constant's API. |
Definition at line 131 of file install/include/rtt/ConfigurationInterface.hpp.
bool RTT::ConfigurationInterface::addConstant | ( | const std::string & | name, | |
const T & | cnst | |||
) | [inline] |
Adds a variable of any type as read-only attribute to the configuration interface. An Alias is created which causes contents of the attribute always to be in sync with the contents of cnst, but it can only be read through the interface.
name | The name of this attribute | |
cnst | The variable that will be aliased. |
Definition at line 117 of file install/include/rtt/ConfigurationInterface.hpp.
bool RTT::ConfigurationInterface::addProperty | ( | base::PropertyBase & | pb | ) |
Add an base::PropertyBase as a property.
Property<T>& RTT::ConfigurationInterface::addProperty | ( | const std::string & | name, | |
Property< T > & | prop | |||
) | [inline] |
Adds an existing property object to the configuration interface.
name | The name of this property. prop will be initialized with this name. | |
prop | The property to add |
Definition at line 179 of file rtt/ConfigurationInterface.hpp.
Property<T>& RTT::ConfigurationInterface::addProperty | ( | const std::string & | name, | |
T & | prop | |||
) | [inline] |
Adds a variable of any type as a property to the configuration interface. A Property is created which causes contents of the property always to be in sync with the contents of prop.
name | The name of this property | |
prop | The variable that will be aliased. |
Definition at line 167 of file rtt/ConfigurationInterface.hpp.
bool RTT::ConfigurationInterface::addProperty | ( | base::PropertyBase & | pb | ) |
Add an base::PropertyBase as a property.
Definition at line 87 of file ConfigurationInterface.cpp.
Property<T>& RTT::ConfigurationInterface::addProperty | ( | const std::string & | name, | |
Property< T > & | prop | |||
) | [inline] |
Adds an existing property object to the configuration interface.
name | The name of this property. prop will be initialized with this name. | |
prop | The property to add |
Definition at line 163 of file install/include/rtt/ConfigurationInterface.hpp.
Property<T>& RTT::ConfigurationInterface::addProperty | ( | const std::string & | name, | |
T & | prop | |||
) | [inline] |
Adds a variable of any type as a property to the configuration interface. A Property is created which causes contents of the property always to be in sync with the contents of prop.
name | The name of this property | |
prop | The variable that will be aliased. |
Definition at line 151 of file install/include/rtt/ConfigurationInterface.hpp.
void RTT::ConfigurationInterface::clear | ( | ) |
Erases the whole repository.
Reimplemented in RTT::scripting::ScriptingService, RTT::Service, RTT::scripting::ScriptingService, and RTT::Service.
void RTT::ConfigurationInterface::clear | ( | ) |
Erases the whole repository.
Reimplemented in RTT::scripting::ScriptingService, RTT::Service, RTT::scripting::ScriptingService, and RTT::Service.
Definition at line 67 of file ConfigurationInterface.cpp.
ConfigurationInterface* RTT::ConfigurationInterface::copy | ( | std::map< const base::DataSourceBase *, base::DataSourceBase * > & | repl, | |
bool | instantiate | |||
) | const |
Return a new copy of this repository with the copy operation semantics.
instantiate | set to true if you want a copy which will upon any future copy return the same DataSources, thus 'fixating' or 'instantiating' the DataSources. |
ConfigurationInterface* RTT::ConfigurationInterface::copy | ( | std::map< const base::DataSourceBase *, base::DataSourceBase * > & | repl, | |
bool | instantiate | |||
) | const |
Return a new copy of this repository with the copy operation semantics.
instantiate | set to true if you want a copy which will upon any future copy return the same DataSources, thus 'fixating' or 'instantiating' the DataSources. |
base::AttributeBase* RTT::ConfigurationInterface::getAttribute | ( | const std::string & | name | ) | const [inline] |
Definition at line 211 of file rtt/ConfigurationInterface.hpp.
base::AttributeBase* RTT::ConfigurationInterface::getAttribute | ( | const std::string & | name | ) | const [inline] |
Definition at line 195 of file install/include/rtt/ConfigurationInterface.hpp.
AttributeNames RTT::ConfigurationInterface::getAttributeNames | ( | ) | const |
Return the names of all attributes in this repository.
std::vector< std::string > RTT::ConfigurationInterface::getAttributeNames | ( | ) | const |
Return the names of all attributes in this repository.
Definition at line 135 of file ConfigurationInterface.cpp.
base::AttributeBase* RTT::ConfigurationInterface::getConstant | ( | const std::string & | name | ) | const [inline] |
Definition at line 238 of file rtt/ConfigurationInterface.hpp.
base::AttributeBase* RTT::ConfigurationInterface::getConstant | ( | const std::string & | name | ) | const [inline] |
Definition at line 222 of file install/include/rtt/ConfigurationInterface.hpp.
base::PropertyBase* RTT::ConfigurationInterface::getProperty | ( | const std::string & | name | ) | const [inline] |
Get a Property with name name.
name | The name of the property to search for. |
Definition at line 268 of file rtt/ConfigurationInterface.hpp.
base::PropertyBase* RTT::ConfigurationInterface::getProperty | ( | const std::string & | name | ) | const [inline] |
Get a Property with name name.
name | The name of the property to search for. |
Definition at line 252 of file install/include/rtt/ConfigurationInterface.hpp.
base::AttributeBase* RTT::ConfigurationInterface::getValue | ( | const std::string & | name | ) | const |
AttributeBase * RTT::ConfigurationInterface::getValue | ( | const std::string & | name | ) | const |
Definition at line 108 of file ConfigurationInterface.cpp.
AttributeObjects const& RTT::ConfigurationInterface::getValues | ( | ) | const [inline] |
Returns all attributes in this repository.
Definition at line 313 of file rtt/ConfigurationInterface.hpp.
AttributeObjects const& RTT::ConfigurationInterface::getValues | ( | ) | const [inline] |
Returns all attributes in this repository.
Definition at line 297 of file install/include/rtt/ConfigurationInterface.hpp.
bool RTT::ConfigurationInterface::hasAttribute | ( | const std::string & | name | ) | const |
Check if an attribute is present in this interface.
bool RTT::ConfigurationInterface::hasAttribute | ( | const std::string & | name | ) | const |
Check if an attribute is present in this interface.
Definition at line 115 of file ConfigurationInterface.cpp.
bool RTT::ConfigurationInterface::hasProperty | ( | const std::string & | name | ) | const |
Check if a property is present.
bool RTT::ConfigurationInterface::hasProperty | ( | const std::string & | name | ) | const |
Check if a property is present.
Definition at line 121 of file ConfigurationInterface.cpp.
void RTT::ConfigurationInterface::loadValues | ( | AttributeObjects const & | new_values | ) |
Adds these attributes to this repository.
void RTT::ConfigurationInterface::loadValues | ( | AttributeObjects const & | new_values | ) |
Adds these attributes to this repository.
Definition at line 142 of file ConfigurationInterface.cpp.
PropertyBag* RTT::ConfigurationInterface::properties | ( | ) |
Return a bag of all properties.
PropertyBag * RTT::ConfigurationInterface::properties | ( | ) |
Return a bag of all properties.
Definition at line 147 of file ConfigurationInterface.cpp.
void RTT::ConfigurationInterface::removeAttribute | ( | const std::string & | name | ) |
Remove an attribute from the repository.
void RTT::ConfigurationInterface::removeAttribute | ( | const std::string & | name | ) |
Remove an attribute from the repository.
Definition at line 93 of file ConfigurationInterface.cpp.
bool RTT::ConfigurationInterface::removeProperty | ( | base::PropertyBase & | p | ) |
Remove a previously added Property and associated attribute.
bool RTT::ConfigurationInterface::removeProperty | ( | base::PropertyBase & | p | ) |
Remove a previously added Property and associated attribute.
Definition at line 126 of file ConfigurationInterface.cpp.
bool RTT::ConfigurationInterface::removeValue | ( | const std::string & | name | ) |
Delete a value added with setValue from the repository.
bool RTT::ConfigurationInterface::removeValue | ( | const std::string & | name | ) |
Delete a value added with setValue from the repository.
Definition at line 97 of file ConfigurationInterface.cpp.
bool RTT::ConfigurationInterface::setValue | ( | base::AttributeBase * | ab | ) |
Transfer the ownership of an attribute to the repository.
ab | The attribute which becomes owned by this repository. |
bool RTT::ConfigurationInterface::setValue | ( | base::AttributeBase * | ab | ) |
Transfer the ownership of an attribute to the repository.
ab | The attribute which becomes owned by this repository. |
Definition at line 75 of file ConfigurationInterface.cpp.
PropertyBag RTT::ConfigurationInterface::bag [protected] |
Definition at line 314 of file install/include/rtt/ConfigurationInterface.hpp.
map_t RTT::ConfigurationInterface::values [protected] |
Definition at line 313 of file install/include/rtt/ConfigurationInterface.hpp.