An Attribute has a name and contains data which can be set and get. More...
#include <rtt/Attribute.hpp>
Public Member Functions | |
Attribute () | |
Create an Attribute with no name and no value. | |
Attribute (const std::string &name) | |
Create an Attribute with a given name and a default value. | |
Attribute (const std::string &name, T t) | |
Create an Attribute with a name and a given value t. | |
Attribute (const std::string &name, AssignableDataSource< T > *d) | |
Create an Attribute which uses a DataSource d. | |
Attribute (const Attribute< T > &a) | |
Copy constructor copies both name and deep copy of the data. | |
Attribute< T > & | operator= (const Attribute< T > &a) |
Assignment copies both name and deep copy of the data. | |
Attribute (AttributeBase *ab) | |
Create an Attribute which mirrors a AttributeBase ab. | |
Attribute< T > & | operator= (AttributeBase *ab) |
Initialise an Attribute which mirrors an AttributeBase ab. | |
T | get () const |
Get the value of this Attribute. | |
void | set (T t) |
Set the value of this Attribute. | |
AssignableDataSource< T > ::reference_t | set () |
Set the value of this Attribute. | |
DataSourceBase::shared_ptr | getDataSource () const |
Return a DataSource which contains the same contents. | |
AssignableDataSource< T > ::shared_ptr | getAssignableDataSource () const |
Attribute< T > * | clone () const |
Returns a clone of this AttributeBase. | |
Attribute< T > * | copy (std::map< const DataSourceBase *, DataSourceBase * > &replacements, bool instantiate) |
Returns a copy of this AttributeBase. | |
const std::string & | getName () const |
Get the name of this instance. | |
bool | ready () const |
Returns true if the Attribute was correctly initialised. | |
Protected Attributes | |
std::string | mname |
An Attribute has a name and contains data which can be set and get.
T | The type of data this attribute holds. |
Definition at line 53 of file Attribute.hpp.
RTT::Attribute< T >::Attribute | ( | const std::string & | name | ) | [inline] |
Create an Attribute with a given name and a default value.
name | The name of this instance. |
Definition at line 62 of file Attribute.hpp.
RTT::Attribute< T >::Attribute | ( | const std::string & | name, | |
T | t | |||
) | [inline, explicit] |
Create an Attribute with a name and a given value t.
name | The name of this instance. | |
t | The value for initialisation. |
Definition at line 73 of file Attribute.hpp.
RTT::Attribute< T >::Attribute | ( | const std::string & | name, | |
AssignableDataSource< T > * | d | |||
) | [inline] |
Create an Attribute which uses a DataSource d.
name | The name | |
d | The data source to read from and write to. |
Definition at line 85 of file Attribute.hpp.
RTT::Attribute< T >::Attribute | ( | AttributeBase * | ab | ) | [inline] |
Create an Attribute which mirrors a AttributeBase ab.
If successful, this attribute will always have the same value as ab and vice versa.
ab | The Attribute to mirror. |
Definition at line 120 of file Attribute.hpp.
Attribute<T>* RTT::Attribute< T >::copy | ( | std::map< const DataSourceBase *, DataSourceBase * > & | replacements, | |
bool | instantiate | |||
) | [inline, virtual] |
Returns a copy of this AttributeBase.
Uses the given replacements to copy held DataSources.
instantiate | Set to true to get a copy which will return itself on any future copy request. |
Implements RTT::AttributeBase.
Definition at line 186 of file Attribute.hpp.
const std::string& RTT::AttributeBase::getName | ( | ) | const [inherited] |
Get the name of this instance.
Attribute<T>& RTT::Attribute< T >::operator= | ( | AttributeBase * | ab | ) | [inline] |
Initialise an Attribute which mirrors an AttributeBase ab.
If successful, this attribute will always have the same value as ab and vice versa.
Definition at line 132 of file Attribute.hpp.