Orocos Real-Time Toolkit  2.9.0
Public Member Functions | Protected Attributes | List of all members
RTT::Alias Class Reference

This class is the most basic Attribute implementation (only suitable for reading a internal::DataSource), does not allow any assignment, just stores a internal::DataSourceBase, and returns it. More...

#include <rtt/Attribute.hpp>

Inheritance diagram for RTT::Alias:
RTT::base::AttributeBase

Public Member Functions

 Alias (const std::string &name, base::DataSourceBase::shared_ptr d)
 
template<class Owner >
 Alias (const std::string &name, base::DataSourceBase::shared_ptr d, Owner owner)
 Create an alias from a datasource with an owner. More...
 
base::DataSourceBase::shared_ptr getDataSource () const
 Return a internal::DataSource which contains the same contents. More...
 
Aliasclone () const
 Returns a clone of this AttributeBase. More...
 
Aliascopy (std::map< const base::DataSourceBase *, base::DataSourceBase * > &replacements, bool)
 Returns a copy of this AttributeBase. More...
 
const std::string & getName () const
 Get the name of this instance. More...
 
void setName (std::string const &new_name)
 Get the name of this instance. More...
 
bool ready () const
 Returns true if the Attribute was correctly initialised. More...
 

Protected Attributes

std::string mname
 

Detailed Description

This class is the most basic Attribute implementation (only suitable for reading a internal::DataSource), does not allow any assignment, just stores a internal::DataSourceBase, and returns it.

This also makes it useful as an alias of temporary expressions like literal values, and rhs expressions.

Definition at line 375 of file Attribute.hpp.

Constructor & Destructor Documentation

RTT::Alias::Alias ( const std::string &  name,
base::DataSourceBase::shared_ptr  d 
)

Definition at line 69 of file Attribute.cpp.

Referenced by clone(), and copy().

template<class Owner >
RTT::Alias::Alias ( const std::string &  name,
base::DataSourceBase::shared_ptr  d,
Owner  owner 
)
inline

Create an alias from a datasource with an owner.

The owner is used to register this attribute to and is supposed to be a pointer (or shared pointer).

Parameters
nameThe name of this instance.
dThe aliased data source.
oThe owner, which has a function 'addAttribute(AttributeBase*)'.

Definition at line 392 of file Attribute.hpp.

References RTT::Attribute< T >::clone(), RTT::Attribute< T >::copy(), and RTT::Attribute< T >::getDataSource().

Member Function Documentation

Alias * RTT::Alias::clone ( ) const
virtual

Returns a clone of this AttributeBase.

Implements RTT::base::AttributeBase.

Definition at line 80 of file Attribute.cpp.

References Alias(), and RTT::base::AttributeBase::mname.

Alias * RTT::Alias::copy ( std::map< const base::DataSourceBase *, base::DataSourceBase * > &  replacements,
bool  instantiate 
)
virtual

Returns a copy of this AttributeBase.

Uses the given replacements to copy held DataSources.

Parameters
instantiateSet to true to get a copy which will return itself on any future copy request.

Implements RTT::base::AttributeBase.

Definition at line 84 of file Attribute.cpp.

References Alias(), and RTT::base::AttributeBase::mname.

base::DataSourceBase::shared_ptr RTT::Alias::getDataSource ( ) const
virtual

Return a internal::DataSource which contains the same contents.

Implements RTT::base::AttributeBase.

Definition at line 75 of file Attribute.cpp.

const std::string & RTT::AttributeBase::getName ( ) const
inherited
bool RTT::base::AttributeBase::ready ( ) const
inlineinherited

Returns true if the Attribute was correctly initialised.

Definition at line 89 of file AttributeBase.hpp.

Referenced by RTT::ConfigurationInterface::addAttribute(), and RTT::ConfigurationInterface::addConstant().

void RTT::AttributeBase::setName ( std::string const &  new_name)
inherited

Member Data Documentation

std::string RTT::base::AttributeBase::mname
protectedinherited

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