RTT::Constant< T > Class Template Reference

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

#include <rtt/Attribute.hpp>

Inheritance diagram for RTT::Constant< T >:
RTT::AttributeBase

List of all members.

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

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


Constructor & Destructor Documentation

template<typename T>
RTT::Constant< T >::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 247 of file Attribute.hpp.


Member Function Documentation

template<typename T>
Constant<T>* RTT::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 RTT::AttributeBase.

Definition at line 294 of file Attribute.hpp.

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

Get the name of this instance.

Returns:
the name
template<typename T>
Constant<T>& RTT::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 264 of file Attribute.hpp.


The documentation for this class was generated from the following file:
Generated on Thu Dec 23 13:22:39 2010 for Orocos Real-Time Toolkit by  doxygen 1.6.3