![]() |
OpenSplice ISO C++ 2 DCPS
v6.x
ISO C++ 2 OpenSplice Data Distribution Service Data-Centric Publish-Subscribe API
|
ReadCondition objects are conditions specifically dedicated to read operations and attached to one DataReader. More...
#include "ReadCondition.hpp"
Public Member Functions | |
ReadCondition (const dds::sub::AnyDataReader &dr, const dds::sub::status::DataState &status) | |
template<typename FUN > | |
ReadCondition (const dds::sub::AnyDataReader &dr, const dds::sub::status::DataState &status, FUN &functor) | |
template<typename FUN > | |
ReadCondition (const dds::sub::AnyDataReader &dr, const dds::sub::status::DataState &status, const FUN &functor) | |
const dds::sub::AnyDataReader & | data_reader () const |
void | dispatch () |
template<typename Functor > | |
void | handler (Functor &func) |
template<typename Functor > | |
void | handler (const Functor &func) |
bool | is_nil () const |
template<typename R > | |
bool | operator!= (const R &ref) const |
bool | operator!= (const null_type nil) const |
DELEGATE * | operator-> () |
const DELEGATE * | operator-> () const |
template<typename R > | |
bool | operator== (const R &ref) const |
bool | operator== (const null_type) const |
void | reset_handler () |
const dds::sub::status::DataState | state_filter () const |
bool | trigger_value () const |
ReadCondition objects are conditions specifically dedicated to read operations and attached to one DataReader.
ReadCondition objects allow an application to specify the data samples it is interested in (by specifying the desired sample states, view states, and instance states). (See the parameter definitions for DataReader's read/take operations.) This allows the middle-ware to enable the condition only when suitable information is available. They are to be used in conjunction with a WaitSet as normal conditions. More than one ReadCondition may be attached to the same DataReader.
See the WaitSet examples for some examples.
Although the WaitSet examples use the StatusCondition, the basic usage of this Condition with a WaitSet is the same.
Definition at line 63 of file ReadCondition.hpp.
dds::sub::cond::ReadCondition::ReadCondition | ( | const dds::sub::AnyDataReader & | dr, |
const dds::sub::status::DataState & | status | ||
) |
Create a dds::sub::cond::ReadCondition associated with a DataReader.
The ReadCondition can then be added to a dds::core::cond::WaitSet so that the application can wait for specific status changes that affect the Entity.
State Masks.
The result of the ReadCondition depends on the selection of samples determined by three masks:
dr | The DataReader to associate with the ReadCondition. |
status | A mask, which selects only those samples with the desired sample/view/instance states. |
dds::core::Exception |
Definition at line 44 of file ReadConditionImpl.hpp.
dds::sub::cond::ReadCondition::ReadCondition | ( | const dds::sub::AnyDataReader & | dr, |
const dds::sub::status::DataState & | status, | ||
FUN & | functor | ||
) |
Create a dds::sub::cond::ReadCondition associated with a DataReader.
The ReadCondition can then be added to a dds::core::cond::WaitSet so that the application can wait for specific status changes that affect the Entity.
The supplied functor will be called when this ReadCondition is triggered and either the inherited dds::core::cond::Condition::dispatch() is called or the dds::core::cond::WaitSet::dispatch() on the WaitSet to which this ReadCondition is attached to.
See State mask info.
dr | The DataReader to associate with the ReadCondition. |
status | A mask, which selects only those samples with the desired sample/view/instance states. |
functor | The functor to be called when the ReadCondition triggers. |
dds::core::Exception |
dds::sub::cond::ReadCondition::ReadCondition | ( | const dds::sub::AnyDataReader & | dr, |
const dds::sub::status::DataState & | status, | ||
const FUN & | functor | ||
) |
Create a dds::sub::cond::ReadCondition associated with a DataReader.
The ReadCondition can then be added to a dds::core::cond::WaitSet so that the application can wait for specific status changes that affect the Entity.
The supplied functor will be called when this ReadCondition is triggered and either the inherited dds::core::cond::Condition::dispatch() is called or the dds::core::cond::WaitSet::dispatch() on the WaitSet to which this ReadCondition is attached to.
See State mask info.
dr | The DataReader to associate with the ReadCondition. |
status | A mask, which selects only those samples with the desired sample/view/instance states. |
functor | The functor to be called when the ReadCondition triggers. |
dds::core::Exception |
const AnyDataReader & dds::sub::cond::ReadCondition::data_reader | ( | ) | const |
This operation returns the DataReader associated with the ReadCondition.
Note that there is exactly one DataReader associated with each ReadCondition.
dds::core::Exception |
Definition at line 94 of file ReadConditionImpl.hpp.
|
inherited |
Dispatches the functor that have been registered with the Condition.
The Condition has to have been triggered for the functor will be called by this function.
dds::core::Exception |
Definition at line 76 of file ConditionImpl.hpp.
|
inherited |
Registers a functor as custom handler with this Condition.
The supplied functor will be called when this Condition is triggered and either the dds::core::cond::Condition::dispatch() is called or the dds::core::cond::WaitSet::dispatch() on the WaitSet to which this Condition is attached to.
Functor | The functor to be called when the StatusCondition triggers. |
dds::core::Exception |
|
inherited |
Registers a functor as custom handler with this Condition.
The supplied functor will be called when this Condition is triggered and either the dds::core::cond::Condition::dispatch() is called or the dds::core::cond::WaitSet::dispatch() on the WaitSet to which this Condition is attached to.
Functor | The functor to be called when the StatusCondition triggers. |
dds::core::Exception |
|
inherited |
Check if the referenced object is nil.
In other words, check if the reference is pointing to a null object.
Definition at line 143 of file ReferenceImpl.hpp.
|
inherited |
Compares two Reference objects and returns true if they are not equal.
Inequality is based on the referential inequality of the object being pointed to.
ref | the other Reference object |
Definition at line 100 of file ReferenceImpl.hpp.
|
inherited |
Special operator!= used to check if this reference object does not equal the dds::core::null reference.
The non-null-check can be done like this:
Definition at line 157 of file ReferenceImpl.hpp.
|
inherited |
The operator->() is provided to be able to directly invoke functions on the delegate.
The decision to provide direct access to the delegate was motivated by the need for providing a way that was not invasive with respect to the CXXDDS API and yet would allow for vendor-specific extension. Thus vendor-specific extensions can be invoked on the Reference and on all its subclasses as follows:
Definition at line 180 of file ReferenceImpl.hpp.
|
inherited |
The operator->() is provided to be able to directly invoke functions on the delegate.
The decision to provide direct access to the delegate was motivated by the need for providing a way that was not invasive with respect to the CXXDDS API and yet would allow for vendor-specific extension. Thus vendor-specific extensions can be invoked on the Reference and on all its subclasses as follows:
Definition at line 188 of file ReferenceImpl.hpp.
|
inherited |
Compares two Reference objects and returns true if they are equal.
Equality is based on the referential equality of the object being pointed.
ref | the other Reference object |
Definition at line 83 of file ReferenceImpl.hpp.
|
inherited |
Special operator== used to check if this reference object equals the dds::core::null reference.
The null-check can be done like this:
Definition at line 150 of file ReferenceImpl.hpp.
|
inherited |
Resets the handler for this Condition.
After the invocation of this function no handler will be registered with this Condition.
dds::core::Exception |
Definition at line 69 of file ConditionImpl.hpp.
const dds::sub::status::DataState dds::sub::cond::ReadCondition::state_filter | ( | ) | const |
This operation returns the set of data-states that are taken into account to determine the trigger_value of the ReadCondition.
These are data-states specified when the ReadCondition was created.
dds::core::Exception |
Definition at line 87 of file ReadConditionImpl.hpp.
|
inherited |
This operation retrieves the trigger_value of the Condition.
A Condition has a trigger_value that can be TRUE or FALSE and is set by the Data Distribution Service (except a GuardCondition). This operation returns the trigger_value of the Condition.
dds::core::Exception |
Definition at line 83 of file ConditionImpl.hpp.