Orocos Real-Time Toolkit  2.9.0
Public Types | Public Member Functions | List of all members
RTT::base::DataObjectInterface< T > Class Template Referenceabstract

A DataObjectInterface implements multi-threaded read/write solutions. More...

#include <rtt/base/DataObjectInterface.hpp>

Inheritance diagram for RTT::base::DataObjectInterface< T >:
RTT::base::DataObjectBase RTT::base::DataObjectLocked< T > RTT::base::DataObjectLockFree< T > RTT::base::DataObjectUnSync< T > RTT::base::DataObject< T >

Public Types

typedef T value_t
 
typedef boost::call_traits< T >::param_type param_t
 
typedef boost::call_traits< T >::reference reference_t
 
typedef boost::shared_ptr< DataObjectInterface< T > > shared_ptr
 Used for shared_ptr management. More...
 

Public Member Functions

 DataObjectInterface ()
 Create a DataObject which is initially not reference counted. More...
 
virtual ~DataObjectInterface ()
 Destructor. More...
 
virtual FlowStatus Get (reference_t pull, bool copy_old_data=true) const =0
 Get a copy of the Data of this data object. More...
 
virtual value_t Get () const =0
 Get a copy of the data of this data object. More...
 
virtual bool Set (param_t push)=0
 Set the data to a certain value. More...
 
virtual bool data_sample (param_t sample, bool reset=true)=0
 Provides a data sample to initialize this data object. More...
 
virtual value_t data_sample () const =0
 Reads back a data sample. More...
 
virtual void clear ()=0
 Clears any data stored by this data object, so that any subsequent Get() without a new Set() will return NoData. More...
 

Detailed Description

template<class T>
class RTT::base::DataObjectInterface< T >

A DataObjectInterface implements multi-threaded read/write solutions.

See also
DataObject
Parameters
TThe DataType which can be Get() or Set() with this DataObject.

Definition at line 58 of file DataObjectInterface.hpp.

Member Typedef Documentation

template<class T>
typedef boost::call_traits<T>::param_type RTT::base::DataObjectInterface< T >::param_t

Definition at line 62 of file DataObjectInterface.hpp.

template<class T>
typedef boost::call_traits<T>::reference RTT::base::DataObjectInterface< T >::reference_t

Definition at line 63 of file DataObjectInterface.hpp.

template<class T>
typedef boost::shared_ptr<DataObjectInterface<T> > RTT::base::DataObjectInterface< T >::shared_ptr

Used for shared_ptr management.

Definition at line 68 of file DataObjectInterface.hpp.

template<class T>
typedef T RTT::base::DataObjectInterface< T >::value_t

Definition at line 61 of file DataObjectInterface.hpp.

Constructor & Destructor Documentation

template<class T>
RTT::base::DataObjectInterface< T >::DataObjectInterface ( )
inline

Create a DataObject which is initially not reference counted.

Definition at line 73 of file DataObjectInterface.hpp.

template<class T>
virtual RTT::base::DataObjectInterface< T >::~DataObjectInterface ( )
inlinevirtual

Member Function Documentation

template<class T>
virtual void RTT::base::DataObjectInterface< T >::clear ( )
pure virtual

Clears any data stored by this data object, so that any subsequent Get() without a new Set() will return NoData.

Implements RTT::base::DataObjectBase.

Implemented in RTT::base::DataObjectLockFree< T >, RTT::base::DataObjectLocked< T >, and RTT::base::DataObjectUnSync< T >.

Referenced by RTT::internal::ChannelDataElement< T >::clear(), and RTT::base::DataObjectInterface< T >::~DataObjectInterface().

template<class T>
virtual bool RTT::base::DataObjectInterface< T >::data_sample ( param_t  sample,
bool  reset = true 
)
pure virtual

Provides a data sample to initialize this data object.

As such enough storage space can be allocated before the actual writing begins.

Parameters
samplethe data sample
resetenforce reinitialization even if this operation clears the stored data.
Returns
true if the data object was successfully (re)initialized.

Implemented in RTT::base::DataObjectLockFree< T >, RTT::base::DataObjectLocked< T >, and RTT::base::DataObjectUnSync< T >.

Referenced by RTT::internal::ChannelDataElement< T >::data_sample().

template<class T>
virtual value_t RTT::base::DataObjectInterface< T >::data_sample ( ) const
pure virtual
template<class T>
virtual FlowStatus RTT::base::DataObjectInterface< T >::Get ( reference_t  pull,
bool  copy_old_data = true 
) const
pure virtual

Get a copy of the Data of this data object.

Parameters
pullA copy of the data.
copy_old_dataIf true, also copy the data if the data object has not been updated since the last call.

Implemented in RTT::base::DataObjectLockFree< T >, RTT::base::DataObjectLocked< T >, and RTT::base::DataObjectUnSync< T >.

Referenced by RTT::internal::DataObjectDataSource< T >::evaluate(), RTT::internal::DataObjectDataSource< T >::get(), RTT::OutputPort< T >::getLastWrittenValue(), and RTT::internal::ChannelDataElement< T >::read().

template<class T>
virtual value_t RTT::base::DataObjectInterface< T >::Get ( ) const
pure virtual

Get a copy of the data of this data object.

Returns
A copy of the data.

Implemented in RTT::base::DataObjectLockFree< T >, RTT::base::DataObjectLocked< T >, and RTT::base::DataObjectUnSync< T >.

Referenced by RTT::base::DataObjectInterface< T >::~DataObjectInterface().

template<class T>
virtual bool RTT::base::DataObjectInterface< T >::Set ( param_t  push)
pure virtual

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