#include <OffsetPartDataSource.hpp>
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.
T | The data type of an element. |
Definition at line 139 of file OffsetPartDataSource.hpp.
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.
RTT::internal::OffsetPartDataSource< T >::~OffsetPartDataSource | ( | ) |
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.
ref | Reference to the first element of the sequence |
index | Datasource pointing to the index for use in operator[] |
parent | Parent data source for sending updated() messages. This should not be a part itself, but a ValueDataSource. May not be null. |
offset | The offset to the requested element, relative to ref, to use in calls to set() and get(). |
Definition at line 163 of file OffsetPartDataSource.hpp.
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.
virtual OffsetPartDataSource<T>* RTT::internal::OffsetPartDataSource< T >::copy | ( | std::map< const base::DataSourceBase *, base::DataSourceBase * > & | replace | ) | const [inline, virtual] |
Implements RTT::internal::AssignableDataSource< T >.
Definition at line 219 of file OffsetPartDataSource.hpp.
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.
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.
Reimplemented from RTT::base::DataSourceBase.
Definition at line 210 of file OffsetPartDataSource.hpp.
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.
Implements RTT::internal::DataSource< T >.
Definition at line 194 of file OffsetPartDataSource.hpp.
void RTT::internal::OffsetPartDataSource< T >::set | ( | typename AssignableDataSource< T >::param_t | t | ) | [inline] |
Definition at line 182 of file OffsetPartDataSource.hpp.
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.
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.
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.
DataSource<unsigned int>::shared_ptr RTT::internal::OffsetPartDataSource< T >::mindex [private] |
Definition at line 145 of file OffsetPartDataSource.hpp.
DataSource<unsigned int>::shared_ptr RTT::internal::OffsetPartDataSource< T >::moffset [private] |
Definition at line 149 of file OffsetPartDataSource.hpp.
base::DataSourceBase::shared_ptr RTT::internal::OffsetPartDataSource< T >::mparent [private] |
Definition at line 147 of file OffsetPartDataSource.hpp.
AssignableDataSource<T>::value_t* RTT::internal::OffsetPartDataSource< T >::mref [private] |
Definition at line 143 of file OffsetPartDataSource.hpp.