Orocos Real-Time Toolkit
2.6.0
|
A class which provides locked/protected access to one typed element of data. More...
#include <rtt/base/DataObjectLocked.hpp>
Public Types | |
typedef T | DataType |
The type of the data. | |
typedef boost::shared_ptr < DataObjectInterface< T > > | shared_ptr |
Used for shared_ptr management. | |
Public Member Functions | |
DataObjectLocked (const T &initial_value=T()) | |
Construct a DataObjectLocked by name. | |
virtual void | Get (DataType &pull) const |
Get a copy of the Data of this data object. | |
virtual DataType | Get () const |
Get a copy of the data of this data object. | |
virtual void | Set (const DataType &push) |
Set the data to a certain value. | |
virtual void | data_sample (const DataType &sample) |
Provides a data sample to initialize this data object. |
A class which provides locked/protected access to one typed element of data.
It allows multiple read/write requests using a single lock. This is the in any case threadsafe implementation, and can be blocking in situations where you do not want that.
Definition at line 57 of file DataObjectLocked.hpp.
RTT::base::DataObjectLocked< T >::DataObjectLocked | ( | const T & | initial_value = T() | ) | [inline] |
Construct a DataObjectLocked by name.
_name | The name of this DataObject. |
Definition at line 72 of file DataObjectLocked.hpp.
virtual void RTT::base::DataObjectLocked< T >::data_sample | ( | const DataType & | sample | ) | [inline, virtual] |
Provides a data sample to initialize this data object.
As such enough storage space can be allocated before the actual writing begins.
sample |
Implements RTT::base::DataObjectInterface< T >.
Definition at line 86 of file DataObjectLocked.hpp.
References RTT::base::DataObjectLocked< T >::Set().
virtual void RTT::base::DataObjectLocked< T >::Get | ( | DataType & | pull | ) | const [inline, virtual] |
Get a copy of the Data of this data object.
pull | A copy of the data. |
Implements RTT::base::DataObjectInterface< T >.
Definition at line 80 of file DataObjectLocked.hpp.
virtual DataType RTT::base::DataObjectLocked< T >::Get | ( | ) | const [inline, virtual] |
Get a copy of the data of this data object.
Implements RTT::base::DataObjectInterface< T >.
Definition at line 82 of file DataObjectLocked.hpp.
References RTT::base::DataObjectLocked< T >::Get().
Referenced by RTT::base::DataObjectLocked< T >::Get().
virtual void RTT::base::DataObjectLocked< T >::Set | ( | const DataType & | push | ) | [inline, virtual] |
Set the data to a certain value.
push | The data which must be set. |
Implements RTT::base::DataObjectInterface< T >.
Definition at line 84 of file DataObjectLocked.hpp.
Referenced by RTT::base::DataObjectLocked< T >::data_sample().