RTI Connext Modern C++ API
Version 6.1.2
|
<<reference-type>> Condition specifically dedicated to read operations and attached to one dds::sub::DataReader. More...
#include <dds/sub/cond/ReadCondition.hpp>
Public Member Functions | |
template<typename T > | |
ReadCondition (const dds::sub::DataReader< T > &reader, const dds::sub::status::DataState &status) | |
Creates a ReadCondition. More... | |
template<typename T , typename Functor > | |
ReadCondition (const dds::sub::DataReader< T > &reader, const dds::sub::status::DataState &status, const Functor &handler) | |
Creates a ReadCondition with a handler. More... | |
const dds::sub::status::DataState | state_filter () const |
Returns the DataState of this condition. More... | |
const AnyDataReader & | data_reader () const |
Returns the DataReader associated to this condition. More... | |
void | close () |
Closes the ReadCondition. More... | |
bool | closed () const |
Indicates whether this ReadCondition has been closed with close(). More... | |
![]() | |
void | dispatch () |
Dispatches the functors that have been registered with the condition. More... | |
bool | trigger_value () const |
This operation retrieves the trigger_value of the Condition. More... | |
Related Functions | |
(Note that these are not member functions.) | |
dds::sub::cond::detail::ReadCondition | create_read_condition_ex (const dds::sub::AnyDataReader &reader, const ::rti::sub::status::DataStateEx &status) |
<<extension>> Creates a ReadCondition with the extended DataStateEx. More... | |
template<typename Functor > | |
dds::sub::cond::detail::ReadCondition | create_read_condition_ex (const dds::sub::AnyDataReader &reader, const ::rti::sub::status::DataStateEx &status, const Functor &handler) |
<<extension>> Creates a ReadCondition with the extended DataStateEx and a handler. More... | |
<<reference-type>> Condition specifically dedicated to read operations and attached to one dds::sub::DataReader.
dds::sub::cond::ReadCondition objects allow an application to specify the data samples it is interested in (by specifying the desired sample_states
, view_states
as well as instance_states
in dds::sub::DataReader::read and dds::sub::DataReader::take variants.
This allows RTI Connext 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 dds::sub::cond::ReadCondition may be attached to the same dds::sub::DataReader.
|
inline |
Creates a ReadCondition.
T | The topic-type of the DataReader. |
reader | The reader associated to the condition. One reader can have multiple ReadConditions but one ReadCondition belongs to exactly one DataReader. |
status | The sample, view and instance states of interest. |
|
inline |
Creates a ReadCondition with a handler.
T | The topic-type of the DataReader. |
Functor | Any type whose instances can be called with a no-argument function call (i.e. f() , if f is an instance of Functor ), or with a Condition argument (f(condition) ) Examples are functions, types that override operator() , and lambdas. |
reader | The reader associated to the condition. One reader can have multiple ReadConditions but one ReadCondition belongs to exactly one DataReader. |
status | The sample, view and instance states of interest. |
handler | The handler that dds::core::cond::WaitSet::dispatch() will call when the condition is triggered. |
The following examples creates two ReadConditions with handlers. The first one receives a lambda function with no arguments. The second one receives a function with the condition as an argument.
|
inline |
Returns the DataState of this condition.
|
inline |
Returns the DataReader associated to this condition.
To obtain the actual typed DataReader, see AnyDataReader::get()
|
inline |
Closes the ReadCondition.
This is a explicit deletion, which otherwise would occur when all references to this ReadCondition go out of scope.
dds::core::PreconditionNotMetError | If the ReadCondition is attached to a Waitset when it is closed. |
|
inline |
Indicates whether this ReadCondition has been closed with close().
|
related |
<<extension>> Creates a ReadCondition with the extended DataStateEx.
The usual way to create a dds::sub::cond::ReadCondition is the constructor that receives a dds::sub::status::DataState. This extension function allows using rti::sub::status::DataStateEx, which includes additional state masks.
References dds::sub::condition().
|
related |
<<extension>> Creates a ReadCondition with the extended DataStateEx and a handler.
The usual way to create a dds::sub::cond::ReadCondition is the constructor that receives a dds::sub::status::DataState. This extension function allows using rti::sub::status::DataStateEx, which includes additional state masks.
References dds::sub::condition().