Constant Class Template Reference

#include <rtt/Attribute.hpp>

Inheritance diagram for Constant:

AttributeBase

List of all members.


Detailed Description

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

As opposed to a Attribute, a Constant can not be assigned to a new value after creation.

Definition at line 215 of file Attribute.hpp.


Public Member Functions

 Constant (const std::string &name, T t)
 Create a constant with a fixed value t.
 Constant (const std::string &name, DataSource< T > *d)
 Create a constant wich holds a DataSource d.
 Constant (AttributeBase *ab)
 Create a constant which mirrors an Attribute.
Constant< T > & operator= (AttributeBase *ab)
 Initialise an Attribute which mirrors an AttributeBase.
get () const
 Get the value of this Constant.
DataSourceBase::shared_ptr getDataSource () const
 Return a DataSource which contains the same contents.
Constant< T > * clone () const
 Returns a clone of this AttributeBase.
Constant< 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.

Public Attributes

DataSource< T >::shared_ptr data

Protected Attributes

std::string mname

Constructor & Destructor Documentation

Constant ( AttributeBase ab  )  [inline]

Create a constant which mirrors an Attribute.

If successful, this constant will always have the same value as ab. In case ab is non constant, it is not accepted.

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

Definition at line 246 of file Attribute.hpp.

References Constant::getDataSource().


Member Function Documentation

Constant<T>& operator= ( AttributeBase ab  )  [inline]

Initialise an Attribute which mirrors an AttributeBase.

If successful, this constant will always have the same value as ab. In case ab is non constant, it is not accepted.

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

Definition at line 263 of file Attribute.hpp.

References Constant::getDataSource(), and AttributeBase::getName().

Constant<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 293 of file Attribute.hpp.

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


The documentation for this class was generated from the following file:

Generated on Mon Jan 19 16:53:56 2009 for OrocosReal-TimeToolkit by  doxygen 1.5.6