#include <rtt/AttributeRepository.hpp>
Definition at line 58 of file AttributeRepository.hpp.
Public Types | |
|
typedef std::vector < std::string > | AttributeNames |
| A vector containing the names of all attribute objects in this repository. | |
|
typedef std::vector < AttributeBase * > | AttributeObjects |
| A vector containing pointers to all attribute objects stored in this repository. | |
Public Member Functions | |
| AttributeRepository () | |
| Create an empty AttributeRepository. | |
| ~AttributeRepository () | |
| void | clear () |
| Erases the whole repository. | |
| bool | hasAttribute (const std::string &name) const |
| Check if an attribute is present in this interface. | |
| bool | addAttribute (AttributeBase *a) |
| Add an AttributeBase which remains owned by the user. | |
| template<class T> | |
| Attribute< T > * | getAttribute (const std::string &name) const |
| void | removeAttribute (const std::string &name) |
| Remove an attribute from the repository. | |
| bool | addConstant (AttributeBase *c) |
| Add a Constant with a given value. | |
| template<class T> | |
| Constant< T > * | getConstant (const std::string &name) const |
| bool | hasProperty (const std::string &name) const |
| Check if a property is present. | |
| bool | addProperty (PropertyBase *pb) |
| Add an PropertyBase as a property. | |
| bool | removeProperty (PropertyBase *p) |
| Remove a previously added Property and associated attribute. | |
| bool | setValue (AttributeBase *ab) |
| Transfer the ownership of an attribute to the repository. | |
| AttributeBase * | getValue (const std::string &name) const |
| bool | removeValue (const std::string &name) |
| Delete a value added with setValue from the repository. | |
| template<class T> | |
| bool | addDataObject (DataObjectInterface< T > *doi) |
| Add a DataObject as an Attribute. | |
| AttributeRepository * | copy (std::map< const DataSourceBase *, DataSourceBase * > &repl, bool instantiate) const |
| Return a new copy of this repository with the copy operation semantics. | |
| AttributeNames | names () const |
| Return the names of all attributes. | |
| AttributeNames | getAttributes () const |
| Return the names of all attributes in this repository. | |
| PropertyBag * | properties () const |
| Return a bag of all properties. | |
| bool addAttribute | ( | AttributeBase * | a | ) | [inline] |
Add an AttributeBase which remains owned by the user.
| a | remains owned by the user, and becomes served by the repository. |
Definition at line 103 of file AttributeRepository.hpp.
References AttributeBase::clone(), AttributeBase::getDataSource(), and AttributeRepository::setValue().
| bool addConstant | ( | AttributeBase * | c | ) | [inline] |
Add a Constant with a given value.
Definition at line 133 of file AttributeRepository.hpp.
References AttributeBase::clone(), AttributeBase::getDataSource(), and AttributeRepository::setValue().
| bool addProperty | ( | PropertyBase * | pb | ) |
Add an PropertyBase as a property.
Definition at line 90 of file AttributeRepository.cpp.
References PropertyBag::add(), PropertyBag::find(), and PropertyBase::getName().
Referenced by ControlTaskProxy::synchronize().
| bool removeProperty | ( | PropertyBase * | p | ) |
Remove a previously added Property and associated attribute.
Definition at line 128 of file AttributeRepository.cpp.
References PropertyBag::find(), PropertyBase::getName(), PropertyBag::remove(), and AttributeRepository::removeValue().
| bool setValue | ( | AttributeBase * | ab | ) |
Transfer the ownership of an attribute to the repository.
| ab | The attribute which becomes owned by this repository. |
Definition at line 81 of file AttributeRepository.cpp.
Referenced by AttributeRepository::addAttribute(), AttributeRepository::addConstant(), AttributeRepository::addDataObject(), AttributeRepository::copy(), ControlTaskProxy::fetchObjects(), ValueChangeParser::store(), and ControlTaskProxy::synchronize().
| bool addDataObject | ( | DataObjectInterface< T > * | doi | ) | [inline] |
Add a DataObject as an Attribute.
This is especially useful to add the thread-safe DataObjects as thread-safe attributes. You can retrieve it through getValue().
| doi | The DataObject, which remains owned by the user. |
Definition at line 201 of file AttributeRepository.hpp.
References DataObjectInterface::getName(), and AttributeRepository::setValue().
| AttributeRepository * copy | ( | std::map< const DataSourceBase *, 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. |
Definition at line 62 of file AttributeRepository.cpp.
References AttributeRepository::AttributeRepository(), and AttributeRepository::setValue().
Referenced by StateMachineTask::copy().
| std::vector< std::string > names | ( | ) | const |
Return the names of all attributes.
Definition at line 138 of file AttributeRepository.cpp.
References AttributeRepository::getAttributes().
Referenced by RTT::detail::DumpObject().
| PropertyBag * properties | ( | ) | const |
Return a bag of all properties.
Definition at line 147 of file AttributeRepository.cpp.
Referenced by TaskContext::properties().
1.5.3