Orocos Real-Time Toolkit
2.9.0
|
An RTT::ConfigurationInterface for holding global variables. More...
#include <rtt/types/GlobalsRepository.hpp>
Public Types | |
typedef boost::shared_ptr< GlobalsRepository > | shared_ptr |
typedef std::vector< std::string > | AttributeNames |
A vector containing the names of all attribute objects in this repository. More... | |
typedef std::vector< base::AttributeBase * > | AttributeObjects |
A vector containing pointers to all attribute objects stored in this repository. More... | |
Public Member Functions | |
void | clear () |
Erases the whole repository. More... | |
bool | hasAttribute (const std::string &name) const |
Check if an attribute is present in this interface. More... | |
template<class T > | |
bool | addAttribute (const std::string &name, T &attr) |
Adds a variable of any type as read/write attribute to the configuration interface. More... | |
template<class T > | |
Attribute< T > & | addAttribute (const std::string &name, Attribute< T > &attr) |
Adds an existing attribute object to the configuration interface. More... | |
bool | addAttribute (base::AttributeBase &a) |
Add an base::AttributeBase which remains owned by the user. More... | |
template<class T > | |
bool | addConstant (const std::string &name, const T &cnst) |
Adds a variable of any type as read-only attribute to the configuration interface. More... | |
template<class T > | |
Constant< T > & | addConstant (const std::string &name, Constant< T > &cnst) |
Adds an existing constant object to the configuration interface. More... | |
bool | addConstant (base::AttributeBase &c) |
Add a Constant with a given value. More... | |
template<class T > | |
Property< T > & | addProperty (const std::string &name, T &prop) |
Adds a variable of any type as a property to the configuration interface. More... | |
template<class T > | |
Property< T > & | addProperty (const std::string &name, Property< T > &prop) |
Adds an existing property object to the configuration interface. More... | |
bool | addProperty (base::PropertyBase &pb) |
Add an base::PropertyBase as a property. More... | |
base::AttributeBase * | getAttribute (const std::string &name) const |
void | removeAttribute (const std::string &name) |
Remove an attribute from the repository. More... | |
base::AttributeBase * | getConstant (const std::string &name) const |
bool | hasProperty (const std::string &name) const |
Check if a property is present. More... | |
bool | removeProperty (base::PropertyBase &p) |
Remove a previously added Property and associated attribute. More... | |
base::PropertyBase * | getProperty (const std::string &name) const |
Get a Property with name name. More... | |
bool | setValue (base::AttributeBase *ab) |
Transfer the ownership of an attribute to the repository. More... | |
base::AttributeBase * | getValue (const std::string &name) const |
bool | removeValue (const std::string &name) |
Delete a value added with setValue from the repository. More... | |
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. More... | |
void | loadValues (AttributeObjects const &new_values) |
Adds these attributes to this repository. More... | |
AttributeObjects const & | getValues () const |
Returns all attributes in this repository. More... | |
AttributeNames | getAttributeNames () const |
Return the names of all attributes in this repository. More... | |
PropertyBag * | properties () |
Return a bag of all properties. More... | |
Static Public Member Functions | |
static shared_ptr | Instance () |
static void | Release () |
Frees all globals. More... | |
Protected Types | |
typedef std::vector< base::AttributeBase * > | map_t |
Protected Member Functions | |
bool | chkPtr (const std::string &where, const std::string &name, const void *ptr) |
Protected Attributes | |
map_t | values |
PropertyBag | bag |
An RTT::ConfigurationInterface for holding global variables.
The RTT uses this to export enumerations to scripting, but users may extend this as well for their own applications.
It is recommended to use the setValue() function to add globals, such that they become owned by the GlobalsRepository.
Definition at line 54 of file GlobalsRepository.hpp.
|
inherited |
A vector containing the names of all attribute objects in this repository.
Definition at line 74 of file ConfigurationInterface.hpp.
|
inherited |
A vector containing pointers to all attribute objects stored in this repository.
Definition at line 80 of file ConfigurationInterface.hpp.
|
protectedinherited |
Definition at line 336 of file ConfigurationInterface.hpp.
typedef boost::shared_ptr<GlobalsRepository> RTT::types::GlobalsRepository::shared_ptr |
Definition at line 58 of file GlobalsRepository.hpp.
|
inlineinherited |
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 ConfigurationInterface.hpp.
|
inlineinherited |
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 115 of file ConfigurationInterface.hpp.
References RTT::base::AttributeBase::ready(), and RTT::base::AttributeBase::setName().
|
inlineinherited |
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 204 of file ConfigurationInterface.hpp.
References RTT::base::AttributeBase::clone(), and RTT::base::AttributeBase::getDataSource().
|
inlineinherited |
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 135 of file ConfigurationInterface.hpp.
|
inlineinherited |
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 150 of file ConfigurationInterface.hpp.
References RTT::base::AttributeBase::ready(), and RTT::base::AttributeBase::setName().
|
inlineinherited |
Add a Constant with a given value.
Definition at line 232 of file ConfigurationInterface.hpp.
References RTT::base::AttributeBase::clone(), and RTT::base::AttributeBase::getDataSource().
|
inlineinherited |
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 171 of file ConfigurationInterface.hpp.
Referenced by RTT::scripting::ScriptingService::ScriptingService().
|
inlineinherited |
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 184 of file ConfigurationInterface.hpp.
References RTT::base::PropertyBase::ready(), and RTT::base::PropertyBase::setName().
|
inherited |
Add an base::PropertyBase as a property.
Definition at line 90 of file ConfigurationInterface.cpp.
References RTT::base::PropertyBase::getName().
|
protectedinherited |
Definition at line 156 of file ConfigurationInterface.cpp.
References RTT::Error.
|
inherited |
Erases the whole repository.
Definition at line 70 of file ConfigurationInterface.cpp.
References RTT::internal::values().
Referenced by RTT::Service::clear().
|
inherited |
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. |
Definition at line 60 of file ConfigurationInterface.cpp.
References RTT::ConfigurationInterface::setValue(), and RTT::internal::values().
Referenced by RTT::scripting::StateMachineService::copy().
|
inlineinherited |
Definition at line 218 of file ConfigurationInterface.hpp.
Referenced by RTT_corba_CConfigurationInterface_i::getAttributeDataSource().
|
inherited |
Return the names of all attributes in this repository.
Definition at line 138 of file ConfigurationInterface.cpp.
References RTT::base::AttributeBase::getName(), and RTT::internal::values().
Referenced by RTT_corba_CConfigurationInterface_i::getAttributeList().
|
inlineinherited |
Definition at line 245 of file ConfigurationInterface.hpp.
References RTT::removeProperty().
|
inlineinherited |
Get a Property with name name.
name | The name of the property to search for. |
Definition at line 275 of file ConfigurationInterface.hpp.
|
inherited |
Definition at line 111 of file ConfigurationInterface.cpp.
References RTT::base::AttributeBase::getName(), and RTT::internal::values().
Referenced by RTT_corba_CConfigurationInterface_i::getAttribute(), RTT_corba_CConfigurationInterface_i::isAttributeAssignable(), and RTT_corba_CConfigurationInterface_i::setAttribute().
|
inlineinherited |
Returns all attributes in this repository.
Definition at line 320 of file ConfigurationInterface.hpp.
References RTT::internal::values().
Referenced by RTT::scripting::StateMachineService::copy(), and RTT::scripting::ExpressionParser::getHandle().
|
inherited |
Check if an attribute is present in this interface.
Definition at line 118 of file ConfigurationInterface.cpp.
References RTT::base::AttributeBase::getName(), and RTT::internal::values().
Referenced by RTT_corba_CConfigurationInterface_i::getAttribute(), RTT_corba_CConfigurationInterface_i::hasAttribute(), and RTT_corba_CConfigurationInterface_i::setAttribute().
|
inherited |
Check if a property is present.
Definition at line 124 of file ConfigurationInterface.cpp.
|
static |
Definition at line 45 of file GlobalsRepository.cpp.
Referenced by RTT::types::RealTimeTypekitPlugin::loadGlobals(), and RTT::scripting::ValueParser::ValueParser().
|
inherited |
Adds these attributes to this repository.
Definition at line 145 of file ConfigurationInterface.cpp.
References RTT::internal::values().
|
inherited |
Return a bag of all properties.
Definition at line 150 of file ConfigurationInterface.cpp.
Referenced by RTT_corba_CConfigurationInterface_i::getProperty(), RTT_corba_CConfigurationInterface_i::getPropertyDataSource(), RTT_corba_CConfigurationInterface_i::getPropertyList(), RTT::marsh::PropertyLoader::load(), RTT_corba_CConfigurationInterface_i::setProperty(), and RTT::marsh::PropertyLoader::store().
|
static |
|
inherited |
Remove an attribute from the repository.
Definition at line 96 of file ConfigurationInterface.cpp.
Referenced by RTT::scripting::ExpressionParser::getHandle().
|
inherited |
Remove a previously added Property and associated attribute.
Definition at line 129 of file ConfigurationInterface.cpp.
References RTT::base::PropertyBase::getName().
|
inherited |
Delete a value added with setValue from the repository.
Definition at line 100 of file ConfigurationInterface.cpp.
References RTT::base::AttributeBase::getName(), and RTT::internal::values().
|
inherited |
Transfer the ownership of an attribute to the repository.
ab | The attribute which becomes owned by this repository. |
Definition at line 78 of file ConfigurationInterface.cpp.
References RTT::base::AttributeBase::getDataSource(), RTT::base::AttributeBase::getName(), and RTT::internal::values().
Referenced by RTT::ConfigurationInterface::copy(), and RTT::scripting::ExpressionParser::getHandle().
|
protectedinherited |
Definition at line 338 of file ConfigurationInterface.hpp.
|
protectedinherited |
Definition at line 337 of file ConfigurationInterface.hpp.
Referenced by RTT::scripting::StateMachineService::copy().