38 #ifndef CORELIB_DATAOBJECT_LOCKED_HPP 39 #define CORELIB_DATAOBJECT_LOCKED_HPP 42 #include "../os/MutexLock.hpp" 79 : data(), status(
NoData), initialized(false) {}
85 : data(initial_value), status(
NoData), initialized(true) {}
92 virtual FlowStatus Get( reference_t pull,
bool copy_old_data =
true )
const {
98 }
else if ((status ==
OldData) && copy_old_data) {
104 virtual value_t
Get()
const {
110 virtual bool Set( param_t push ) {
119 if (!initialized || reset) {
DataObjectLocked(param_t initial_value)
Construct a DataObjectLocked with initial value.
virtual FlowStatus Get(reference_t pull, bool copy_old_data=true) const
Get a copy of the Data of this data object.
T DataType
The type of the data.
FlowStatus
Returns the status of a data flow read operation.
virtual value_t data_sample() const
Reads back a data sample.
virtual value_t Get() const
Get a copy of the data of this data object.
virtual void clear()
Clears any data stored by this data object, so that any subsequent Get() without a new Set() will ret...
boost::call_traits< T >::param_type param_t
virtual bool Set(param_t push)
Set the data to a certain value.
A DataObjectInterface implements multi-threaded read/write solutions.
A class which provides locked/protected access to one typed element of data.
DataObjectLocked()
Construct an uninitialized DataObjectLocked.
boost::call_traits< T >::reference reference_t
An object oriented wrapper around a non recursive mutex.
Contains TaskContext, Activity, OperationCaller, Operation, Property, InputPort, OutputPort, Attribute.
virtual bool data_sample(param_t sample, bool reset)
Provides a data sample to initialize this data object.
MutexLock is a scope based Monitor, protecting critical sections with a Mutex object through locking ...