Orocos Real-Time Toolkit
2.6.0
|
As opposed to a Attribute, a Constant can not be assigned to a new value after creation. More...
#include <rtt/Attribute.hpp>
Public Member Functions | |
Constant () | |
Create a Constant with no name and no value. | |
Constant (const std::string &name, T t) | |
Create a constant with a fixed value t. | |
template<class Owner > | |
Constant (const std::string &name, T t, Owner owner) | |
Create a constant with a fixed value t and an owner. | |
Constant (const std::string &name, internal::DataSource< T > *d) | |
Create a constant wich holds a internal::DataSource d. | |
Constant (base::AttributeBase *ab) | |
Create a constant which mirrors an Attribute. | |
Constant< T > & | operator= (base::AttributeBase *ab) |
Initialise an Attribute which mirrors an AttributeBase. | |
T | get () const |
Get the value of this Constant. | |
base::DataSourceBase::shared_ptr | getDataSource () const |
Return a internal::DataSource which contains the same contents. | |
Constant< T > * | clone () const |
Returns a clone of this AttributeBase. | |
Constant< T > * | copy (std::map< const base::DataSourceBase *, base::DataSourceBase * > &replacements, bool instantiate) |
Returns a copy of this AttributeBase. | |
const std::string & | getName () const |
Get the name of this instance. | |
void | setName (std::string const &new_name) |
Get the name of this instance. | |
bool | ready () const |
Returns true if the Attribute was correctly initialised. | |
Public Attributes | |
internal::DataSource< T > ::shared_ptr | data |
Protected Attributes | |
std::string | mname |
As opposed to a Attribute, a Constant can not be assigned to a new value after creation.
Definition at line 249 of file Attribute.hpp.
RTT::Constant< T >::Constant | ( | const std::string & | name, |
T | t | ||
) | [inline] |
Create a constant with a fixed value t.
name | The name of this instance. |
t | The value for initialisation. |
Definition at line 267 of file Attribute.hpp.
RTT::Constant< T >::Constant | ( | const std::string & | name, |
T | t, | ||
Owner | owner | ||
) | [inline] |
Create a constant with a fixed value t and an owner.
The owner is used to register this attribute to and is supposed to be a pointer (or shared pointer).
name | The name of this instance. |
t | The value for initialisation. |
o | The owner, which has a function 'addAttribute(AttributeBase*)'. |
Definition at line 283 of file Attribute.hpp.
RTT::Constant< T >::Constant | ( | base::AttributeBase * | ab | ) | [inline] |
Create a constant which mirrors an Attribute.
If successful, this constant will always have the same value as ab.
ab | The attribute to mirror. If null, this will clear this attribute and clear its name. |
Definition at line 307 of file Attribute.hpp.
Constant<T>* RTT::Constant< T >::copy | ( | std::map< const base::DataSourceBase *, base::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::base::AttributeBase.
Definition at line 359 of file Attribute.hpp.
const std::string & RTT::AttributeBase::getName | ( | ) | const [inherited] |
Get the name of this instance.
Definition at line 59 of file Attribute.cpp.
Referenced by RTT::ConfigurationInterface::getAttributeNames(), RTT::ConfigurationInterface::hasAttribute(), RTT::Attribute< T >::operator=(), RTT::Constant< T >::operator=(), RTT::ConfigurationInterface::removeValue(), and RTT::ConfigurationInterface::setValue().
Constant<T>& RTT::Constant< T >::operator= | ( | base::AttributeBase * | ab | ) | [inline] |
Initialise an Attribute which mirrors an AttributeBase.
If successful, this constant will always have the same value as ab.
ab | The attribute to mirror. If null, this will clear this attribute and clear its name. |
Definition at line 321 of file Attribute.hpp.
References RTT::base::AttributeBase::getDataSource(), and RTT::base::AttributeBase::getName().
void RTT::AttributeBase::setName | ( | std::string const & | new_name | ) | [inherited] |
Get the name of this instance.
Definition at line 64 of file Attribute.cpp.
Referenced by RTT::ConfigurationInterface::addAttribute(), and RTT::ConfigurationInterface::addConstant().