Attribute Class Template Reference

#include <rtt/Attribute.hpp>

Inheritance diagram for Attribute:

AttributeBase

List of all members.


Detailed Description

template<typename T>
class RTT::Attribute< T >

An Attribute has a name and contains data which can be set and get.

Parameters:
T The type of data this attribute holds.

Definition at line 55 of file 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.
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

Constructor & Destructor Documentation

Attribute ( const std::string &  name  )  [inline]

Create an Attribute with a given name and a default value.

Parameters:
name The name of this instance.

Definition at line 73 of file Attribute.hpp.

Attribute ( const std::string &  name,
t 
) [inline, explicit]

Create an Attribute with a name and a given value t.

Parameters:
name The name of this instance.
t The value for initialisation.

Definition at line 84 of file Attribute.hpp.

Attribute ( const std::string &  name,
AssignableDataSource< T > *  d 
) [inline]

Create an Attribute which uses a DataSource d.

Parameters:
name The name
d The data source to read from and write to.

Definition at line 96 of file Attribute.hpp.

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.

Parameters:
ab The Attribute to mirror.
See also:
ready() to check if ab was accepted.

Definition at line 131 of file Attribute.hpp.


Member Function Documentation

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.

See also:
ready() to check if ab was accepted.

Definition at line 143 of file Attribute.hpp.

References Attribute::getAssignableDataSource(), AttributeBase::getName(), and AttributeBase::mname.

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.

Parameters:
instantiate Set to true to get a copy which will return itself on any future copy request.

Implements AttributeBase.

Definition at line 194 of file Attribute.hpp.

References AttributeBase::mname.

const std::string & getName (  )  const [inherited]

Get the name of this instance.

Returns:
the name

Definition at line 56 of file Attribute.cpp.

References AttributeBase::mname.

Referenced by AttributeRepository::getAttributes(), AttributeRepository::getValue(), AttributeRepository::hasAttribute(), Constant::operator=(), Attribute::operator=(), and AttributeRepository::removeValue().


The documentation for this class was generated from the following file:
Generated on Tue Mar 25 17:41:53 2008 for OrocosReal-TimeToolkit by  doxygen 1.5.3