RTT::Attribute< T > Class Template Reference

#include <Attribute.hpp>

Inheritance diagram for RTT::Attribute< T >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 Attribute (base::AttributeBase *ab)
 Attribute (const Attribute< T > &a)
 Attribute (const std::string &name, internal::AssignableDataSource< T > *d)
template<class Owner >
 Attribute (const std::string &name, T t, Owner o)
 Attribute (const std::string &name, T t)
 Attribute (const std::string &name)
 Attribute ()
 Attribute (base::AttributeBase *ab)
 Attribute (const Attribute< T > &a)
 Attribute (const std::string &name, internal::AssignableDataSource< T > *d)
template<class Owner >
 Attribute (const std::string &name, T t, Owner o)
 Attribute (const std::string &name, T t)
 Attribute (const std::string &name)
 Attribute ()
Attribute< T > * clone () const
Attribute< T > * clone () const
Attribute< T > * copy (std::map< const base::DataSourceBase *, base::DataSourceBase * > &replacements, bool instantiate)
Attribute< T > * copy (std::map< const base::DataSourceBase *, base::DataSourceBase * > &replacements, bool instantiate)
T const & get () const
T const & get () const
internal::AssignableDataSource
< T >::shared_ptr 
getAssignableDataSource () const
internal::AssignableDataSource
< T >::shared_ptr 
getAssignableDataSource () const
base::DataSourceBase::shared_ptr getDataSource () const
base::DataSourceBase::shared_ptr getDataSource () const
Attribute< T > & operator= (base::AttributeBase *ab)
Attribute< T > & operator= (const Attribute< T > &a)
Attribute< T > & operator= (base::AttributeBase *ab)
Attribute< T > & operator= (const Attribute< T > &a)
internal::AssignableDataSource
< T >::reference_t 
set ()
void set (T const &t)
internal::AssignableDataSource
< T >::reference_t 
set ()
void set (T const &t)

Private Attributes

internal::AssignableDataSource
< T >::shared_ptr 
data

Detailed Description

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

An Attribute has a name and contains data which can be set and get. Accessing an attribute (reading/writing) is not thread-safe. It is used to expose a C/C++ variable to the interface of a TaskContext in order to allow plugins or external tools to read and write it.

Parameters:
T The type of data this attribute holds.

Definition at line 54 of file install/include/rtt/Attribute.hpp.


Constructor & Destructor Documentation

template<typename T>
RTT::Attribute< T >::Attribute (  )  [inline]

Create an Attribute with no name and no value.

Definition at line 52 of file install/include/rtt/Attribute.hpp.

template<typename T>
RTT::Attribute< T >::Attribute ( const std::string &  name  )  [inline, explicit]

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

Parameters:
name The name of this instance.

Definition at line 61 of file install/include/rtt/Attribute.hpp.

template<typename T>
RTT::Attribute< T >::Attribute ( const std::string &  name,
t 
) [inline]

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 72 of file install/include/rtt/Attribute.hpp.

template<typename T>
template<class Owner >
RTT::Attribute< T >::Attribute ( const std::string &  name,
t,
Owner  o 
) [inline]

Create an Attribute with a name, a given value t and an owner. The owner is used to register this attribute to and is supposed to be a pointer (or shared pointer).

Parameters:
name The name of this instance.
t The value for initialisation.
o The owner, which has a function 'addAttribute(AttributeBase*)'.

Definition at line 88 of file install/include/rtt/Attribute.hpp.

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

Create an Attribute which uses a internal::DataSource d.

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

Definition at line 101 of file install/include/rtt/Attribute.hpp.

template<typename T>
RTT::Attribute< T >::Attribute ( const Attribute< T > &  a  )  [inline]

Copy constructor copies both name and deep copy of the data.

Definition at line 110 of file install/include/rtt/Attribute.hpp.

template<typename T>
RTT::Attribute< T >::Attribute ( base::AttributeBase ab  )  [inline]

Create an Attribute which mirrors a base::AttributeBase ab. If successful, this attribute will always have the same value as ab and vice versa.

Parameters:
ab The Attribute to mirror. If null, this will clear this attribute and clear its name.
See also:
ready() to check if ab was accepted.

Definition at line 137 of file install/include/rtt/Attribute.hpp.

template<typename T>
RTT::Attribute< T >::Attribute (  )  [inline]

Create an Attribute with no name and no value.

Definition at line 65 of file rtt/Attribute.hpp.

template<typename T>
RTT::Attribute< T >::Attribute ( const std::string &  name  )  [inline, explicit]

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

Parameters:
name The name of this instance.

Definition at line 74 of file rtt/Attribute.hpp.

template<typename T>
RTT::Attribute< T >::Attribute ( const std::string &  name,
t 
) [inline]

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 85 of file rtt/Attribute.hpp.

template<typename T>
template<class Owner >
RTT::Attribute< T >::Attribute ( const std::string &  name,
t,
Owner  o 
) [inline]

Create an Attribute with a name, a given value t and an owner. The owner is used to register this attribute to and is supposed to be a pointer (or shared pointer).

Parameters:
name The name of this instance.
t The value for initialisation.
o The owner, which has a function 'addAttribute(AttributeBase*)'.

Definition at line 101 of file rtt/Attribute.hpp.

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

Create an Attribute which uses a internal::DataSource d.

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

Definition at line 114 of file rtt/Attribute.hpp.

template<typename T>
RTT::Attribute< T >::Attribute ( const Attribute< T > &  a  )  [inline]

Copy constructor copies both name and deep copy of the data.

Definition at line 123 of file rtt/Attribute.hpp.

template<typename T>
RTT::Attribute< T >::Attribute ( base::AttributeBase ab  )  [inline]

Create an Attribute which mirrors a base::AttributeBase ab. If successful, this attribute will always have the same value as ab and vice versa.

Parameters:
ab The Attribute to mirror. If null, this will clear this attribute and clear its name.
See also:
ready() to check if ab was accepted.

Definition at line 150 of file rtt/Attribute.hpp.


Member Function Documentation

template<typename T>
Attribute<T>* RTT::Attribute< T >::clone (  )  const [inline, virtual]

Returns a clone of this AttributeBase.

Implements RTT::base::AttributeBase.

Definition at line 224 of file rtt/Attribute.hpp.

template<typename T>
Attribute<T>* RTT::Attribute< T >::clone (  )  const [inline, virtual]

Returns a clone of this AttributeBase.

Implements RTT::base::AttributeBase.

Definition at line 211 of file install/include/rtt/Attribute.hpp.

template<typename T>
Attribute<T>* RTT::Attribute< T >::copy ( std::map< const base::DataSourceBase *, base::DataSourceBase * > &  replacements,
bool  instantiate 
) [inline]

Definition at line 229 of file rtt/Attribute.hpp.

template<typename T>
Attribute<T>* RTT::Attribute< T >::copy ( std::map< const base::DataSourceBase *, base::DataSourceBase * > &  replacements,
bool  instantiate 
) [inline]

Definition at line 216 of file install/include/rtt/Attribute.hpp.

template<typename T>
T const& RTT::Attribute< T >::get (  )  const [inline]

Get the value of this Attribute.

Definition at line 188 of file rtt/Attribute.hpp.

template<typename T>
T const& RTT::Attribute< T >::get (  )  const [inline]

Get the value of this Attribute.

Definition at line 175 of file install/include/rtt/Attribute.hpp.

template<typename T>
internal::AssignableDataSource<T>::shared_ptr RTT::Attribute< T >::getAssignableDataSource (  )  const [inline]

Definition at line 219 of file rtt/Attribute.hpp.

template<typename T>
internal::AssignableDataSource<T>::shared_ptr RTT::Attribute< T >::getAssignableDataSource (  )  const [inline]

Definition at line 206 of file install/include/rtt/Attribute.hpp.

template<typename T>
base::DataSourceBase::shared_ptr RTT::Attribute< T >::getDataSource (  )  const [inline, virtual]

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

Implements RTT::base::AttributeBase.

Definition at line 214 of file rtt/Attribute.hpp.

template<typename T>
base::DataSourceBase::shared_ptr RTT::Attribute< T >::getDataSource (  )  const [inline, virtual]

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

Implements RTT::base::AttributeBase.

Definition at line 201 of file install/include/rtt/Attribute.hpp.

template<typename T>
Attribute<T>& RTT::Attribute< T >::operator= ( base::AttributeBase ab  )  [inline]

Initialise an Attribute which mirrors an base::AttributeBase ab. If successful, this attribute will always have the same value as ab and vice versa.

Parameters:
ab The attribute to mirror. If null, this will clear this attribute and clear its name.
See also:
ready() to check if ab was accepted.

Definition at line 164 of file rtt/Attribute.hpp.

template<typename T>
Attribute<T>& RTT::Attribute< T >::operator= ( const Attribute< T > &  a  )  [inline]

Assignment copies both name and deep copy of the data.

Definition at line 132 of file rtt/Attribute.hpp.

template<typename T>
Attribute<T>& RTT::Attribute< T >::operator= ( base::AttributeBase ab  )  [inline]

Initialise an Attribute which mirrors an base::AttributeBase ab. If successful, this attribute will always have the same value as ab and vice versa.

Parameters:
ab The attribute to mirror. If null, this will clear this attribute and clear its name.
See also:
ready() to check if ab was accepted.

Definition at line 151 of file install/include/rtt/Attribute.hpp.

template<typename T>
Attribute<T>& RTT::Attribute< T >::operator= ( const Attribute< T > &  a  )  [inline]

Assignment copies both name and deep copy of the data.

Definition at line 119 of file install/include/rtt/Attribute.hpp.

template<typename T>
internal::AssignableDataSource<T>::reference_t RTT::Attribute< T >::set (  )  [inline]

Allow to set the value of this Attribute by reference. Don't use this function to set attributes of remote components, since set() will return in that case a copy of the data and the remote side will not be updated.

Definition at line 210 of file rtt/Attribute.hpp.

template<typename T>
void RTT::Attribute< T >::set ( T const &  t  )  [inline]

Set the value of this Attribute. In case the attribute is owned by a remote component, the value will be transfered.

Definition at line 199 of file rtt/Attribute.hpp.

template<typename T>
internal::AssignableDataSource<T>::reference_t RTT::Attribute< T >::set (  )  [inline]

Allow to set the value of this Attribute by reference. Don't use this function to set attributes of remote components, since set() will return in that case a copy of the data and the remote side will not be updated.

Definition at line 197 of file install/include/rtt/Attribute.hpp.

template<typename T>
void RTT::Attribute< T >::set ( T const &  t  )  [inline]

Set the value of this Attribute. In case the attribute is owned by a remote component, the value will be transfered.

Definition at line 186 of file install/include/rtt/Attribute.hpp.


Member Data Documentation

template<typename T>
internal::AssignableDataSource< T >::shared_ptr RTT::Attribute< T >::data [private]

Definition at line 46 of file install/include/rtt/Attribute.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines


rtt
Author(s): RTT Developers
autogenerated on Fri Jan 11 09:49:46 2013