Public Types | Public Member Functions | Private Attributes
RTT::internal::OffsetPartDataSource< T > Class Template Reference

#include <OffsetPartDataSource.hpp>

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

List of all members.

Public Types

typedef boost::intrusive_ptr
< OffsetPartDataSource< T > > 
shared_ptr

Public Member Functions

virtual OffsetPartDataSource< T > * clone () const
virtual OffsetPartDataSource< T > * copy (std::map< const base::DataSourceBase *, base::DataSourceBase * > &replace) const
DataSource< T >::result_t get () const
virtual shared_ptr getParent ()
 OffsetPartDataSource (typename AssignableDataSource< T >::reference_t ref, DataSource< unsigned int >::shared_ptr index, base::DataSourceBase::shared_ptr parent, DataSource< unsigned int >::shared_ptr offset)
AssignableDataSource< T >
::const_reference_t 
rvalue () const
void set (typename AssignableDataSource< T >::param_t t)
AssignableDataSource< T >
::reference_t 
set ()
void updated ()
DataSource< T >::result_t value () const
 ~OffsetPartDataSource ()

Private Attributes

DataSource< unsigned int >
::shared_ptr 
mindex
DataSource< unsigned int >
::shared_ptr 
moffset
base::DataSourceBase::shared_ptr mparent
AssignableDataSource< T >
::value_t
mref

Detailed Description

template<typename T>
class RTT::internal::OffsetPartDataSource< T >

A DataSource which is used to manipulate a reference to a part of a data source holding a sequence of elements.

It supports referencing to elements of sequences in sequences.

It requires to know which 'top level' element it is reading parts of, this is called the parent. It also requires proper offset calculation which takes into account a shift in memory location in case the one of the higher level elements is also a sequence. The offset calculation is done by an OffsetDataSource.

Parameters:
TThe data type of an element.

Definition at line 139 of file OffsetPartDataSource.hpp.


Member Typedef Documentation

template<typename T>
typedef boost::intrusive_ptr<OffsetPartDataSource<T> > RTT::internal::OffsetPartDataSource< T >::shared_ptr

Use this type to store a pointer to an AssignableDataSource.

Reimplemented from RTT::internal::AssignableDataSource< T >.

Definition at line 153 of file OffsetPartDataSource.hpp.


Constructor & Destructor Documentation

template<typename T>
RTT::internal::OffsetPartDataSource< T >::OffsetPartDataSource ( typename AssignableDataSource< T >::reference_t  ref,
DataSource< unsigned int >::shared_ptr  index,
base::DataSourceBase::shared_ptr  parent,
DataSource< unsigned int >::shared_ptr  offset 
) [inline]

The part is constructed from a reference to an existing array of elements and an index for accessing the n'th element.

Parameters:
refReference to the first element of the sequence
indexDatasource pointing to the index for use in operator[]
parentParent data source for sending updated() messages. This should not be a part itself, but a ValueDataSource. May not be null.
offsetThe offset to the requested element, relative to ref, to use in calls to set() and get().

Definition at line 163 of file OffsetPartDataSource.hpp.


Member Function Documentation

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

Return a shallow clone of this DataSource. This method returns a duplicate of this instance which re-uses the DataSources this internal::DataSource holds reference to. The clone() function is thus a non-deep copy.

Implements RTT::internal::AssignableDataSource< T >.

Definition at line 215 of file OffsetPartDataSource.hpp.

template<typename T>
virtual OffsetPartDataSource<T>* RTT::internal::OffsetPartDataSource< T >::copy ( std::map< const base::DataSourceBase *, base::DataSourceBase * > &  replace) const [inline, virtual]
template<typename T>
DataSource<T>::result_t RTT::internal::OffsetPartDataSource< T >::get ( ) const [inline, virtual]

Return the data as type T.

Implements RTT::internal::DataSource< T >.

Definition at line 171 of file OffsetPartDataSource.hpp.

template<typename T>
virtual shared_ptr RTT::internal::OffsetPartDataSource< T >::getParent ( ) [inline, virtual]

Overloaded to pass on our own parent to the type system, such that offsets can be correctly calculated.

Returns:
The parent object that holds all data.

Reimplemented from RTT::base::DataSourceBase.

Definition at line 210 of file OffsetPartDataSource.hpp.

template<typename T>
AssignableDataSource<T>::const_reference_t RTT::internal::OffsetPartDataSource< T >::rvalue ( ) const [inline, virtual]

Get a const reference to the value of this DataSource. You must call evaluate() prior to calling this function in order to get the most recent value of this attribute.

Note:
Getting a reference to an internal data structure is not thread-safe.

Implements RTT::internal::DataSource< T >.

Definition at line 194 of file OffsetPartDataSource.hpp.

template<typename T>
void RTT::internal::OffsetPartDataSource< T >::set ( typename AssignableDataSource< T >::param_t  t) [inline]

Definition at line 182 of file OffsetPartDataSource.hpp.

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

Get a reference to the value of this DataSource. Getting a reference to an internal data structure is not thread-safe.

Implements RTT::internal::AssignableDataSource< T >.

Definition at line 188 of file OffsetPartDataSource.hpp.

template<typename T>
void RTT::internal::OffsetPartDataSource< T >::updated ( ) [inline, virtual]

In case the internal::DataSource returns a 'reference' type, call this method to notify it that the data was updated in the course of an invocation of get().

Reimplemented from RTT::base::DataSourceBase.

Definition at line 200 of file OffsetPartDataSource.hpp.

template<typename T>
DataSource<T>::result_t RTT::internal::OffsetPartDataSource< T >::value ( ) const [inline, virtual]

Return the result of the last evaluate() function. You must call evaluate() prior to calling this function in order to get the most recent value of this attribute.

Implements RTT::internal::DataSource< T >.

Definition at line 177 of file OffsetPartDataSource.hpp.


Member Data Documentation

template<typename T>
DataSource<unsigned int>::shared_ptr RTT::internal::OffsetPartDataSource< T >::mindex [private]

Definition at line 145 of file OffsetPartDataSource.hpp.

template<typename T>
DataSource<unsigned int>::shared_ptr RTT::internal::OffsetPartDataSource< T >::moffset [private]

Definition at line 149 of file OffsetPartDataSource.hpp.

Definition at line 147 of file OffsetPartDataSource.hpp.

template<typename T>
AssignableDataSource<T>::value_t* RTT::internal::OffsetPartDataSource< T >::mref [private]

Definition at line 143 of file OffsetPartDataSource.hpp.


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


rtt
Author(s): RTT Developers
autogenerated on Mon Oct 6 2014 03:13:59