CoreDX DDS Modern C++ API
|
A WaitSet object allows an application to wait until one or more of the attached Condition objects has a trigger_value of TRUE or else until the timeout expires. More...
Public Member Functions | |
WaitSet () | |
Creates a new waitset. | |
const ConditionSeq | wait (const dds::core::Duration &timeout) |
This operation allows an application thread to wait for the occurrence of certain conditions. More... | |
const ConditionSeq | wait () |
This operation allows an application thread to wait for the occurrence of certain conditions. More... | |
ConditionSeq & | wait (ConditionSeq &triggered, const dds::core::Duration &timeout) |
This operation allows an application thread to wait for the occurrence of certain conditions. More... | |
ConditionSeq & | wait (ConditionSeq &triggered) |
This operation allows an application thread to wait for the occurrence of certain conditions. More... | |
void | dispatch () |
Waits for at least one of the attached conditions to trigger and then dispatches the events. | |
void | dispatch (const dds::core::Duration &timeout) |
Waits for at least one of the attached conditions to trigger and then dispatches the events, or, times out and unblocks. | |
WaitSet & | operator+= (const dds::core::cond::Condition &cond) |
A synonym for attach_condition. | |
WaitSet & | operator-= (const dds::core::cond::Condition &cond) |
A synonym for detach_condition. | |
WaitSet & | attach_condition (const dds::core::cond::Condition &cond) |
Attaches a Condition to the WaitSet. More... | |
bool | detach_condition (const dds::core::cond::Condition &cond) |
Detaches a Condition from the WaitSet. More... | |
const ConditionSeq | conditions () const |
This operation retrieves the list of attached conditions. More... | |
ConditionSeq & | conditions (ConditionSeq &conds) const |
This operation retrieves the list of attached conditions. More... | |
Public Member Functions inherited from dds::core::Reference< DELEGATE > | |
Reference (dds::core::null_type &) | |
Creates a "null" reference. | |
Reference (const Reference &ref) | |
Creates a reference from another. More... | |
template<typename D > | |
Reference (const Reference< D > &ref) | |
Enables safe assignment from other reference types. More... | |
Reference (DELEGATE_T *p) | |
The following two constructors create a dds Reference from a vendor specific delegate. More... | |
~Reference () | |
Destroys a reference. | |
template<typename R > | |
bool | operator== (const R &ref) const |
Compares two reference objects and returns true if they are equal. More... | |
template<typename R > | |
bool | operator!= (const R &ref) const |
Compares two reference objects and returns true if they are not-equal. More... | |
Reference & | operator= (const null_type) |
Special assignment operators that takes care of assigning null to this reference. More... | |
bool | is_nil () const |
Returns true if this reference object is nil, meaning pointing to null. | |
bool | operator== (const null_type) const |
Special operator== used to check if this reference object equals the null reference. More... | |
bool | operator!= (const null_type nil) const |
Special operator!= used to check if this reference object does not equals the null reference. More... | |
const DELEGATE_REF_T & | delegate () const |
Returns a reference to the underlying delegate. More... | |
DELEGATE_REF_T & | delegate () |
Returns a reference to the underlying delegate. More... | |
DELEGATE * | operator-> () |
The operator->() is provided to be able to directly invoke methods on the delegate. More... | |
const DELEGATE * | operator-> () const |
The operator->() is provided to be able to directly invoke methods on the delegate. More... | |
A WaitSet object allows an application to wait until one or more of the attached Condition objects has a trigger_value of TRUE or else until the timeout expires.
A WaitSet is not necessarily associated with a single DomainParticipant and could be used to wait on Condition objects associated with different DomainParticipant objects.
WaitSet& dds::core::cond::WaitSet::attach_condition | ( | const dds::core::cond::Condition & | cond | ) |
Attaches a Condition to the WaitSet.
It is possible to attach a Condition on a WaitSet that is currently being waited upon (via the wait operation). In this case, if the Condition has a trigger_value of TRUE, then attaching the condition will unblock the WaitSet. Adding a Condition that is already attached to the WaitSet has no effect.
cond | the condition to be attached to this waitset. |
const ConditionSeq dds::core::cond::WaitSet::conditions | ( | ) | const |
This operation retrieves the list of attached conditions.
ConditionSeq& dds::core::cond::WaitSet::conditions | ( | ConditionSeq & | conds | ) | const |
This operation retrieves the list of attached conditions.
bool dds::core::cond::WaitSet::detach_condition | ( | const dds::core::cond::Condition & | cond | ) |
const ConditionSeq dds::core::cond::WaitSet::wait | ( | const dds::core::Duration & | timeout | ) |
This operation allows an application thread to wait for the occurrence of certain conditions.
If none of the conditions attached to the WaitSet have a trigger_value of TRUE, the wait operation will block suspending the calling thread.
The wait operation takes a timeout argument that specifies the maximum duration for the wait. It this duration is exceeded and none of the attached Condition objects is true, wait will continue and the returned ConditionSeq will be empty.
It is not allowed for more than one application thread to be waiting on the same WaitSet. If the wait operation is invoked on a WaitSet that already has a thread blocking on it, the operation will raise immediately an exception PreconditionNotMet.
The result of the wait operation is the list of all the attached conditions that have a trigger_value of TRUE (i.e., the conditions that unblocked the wait).
timeout | the maximum amount of time for which the wait should block while waiting for a condition to be triggered. |
const ConditionSeq dds::core::cond::WaitSet::wait | ( | ) |
This operation allows an application thread to wait for the occurrence of certain conditions.
If none of the conditions attached to the WaitSet have a trigger_value of TRUE, the wait operation will block suspending the calling thread.
It is not allowed for more than one application thread to be waiting on the same WaitSet. If the wait operation is invoked on a WaitSet that already has a thread blocking on it, the operation will raise immediately an exception PreconditionNotMet.
The result of the wait operation is the list of all the attached conditions that have a trigger_value of TRUE (i.e., the conditions that unblocked the wait).
ConditionSeq& dds::core::cond::WaitSet::wait | ( | ConditionSeq & | triggered, |
const dds::core::Duration & | timeout | ||
) |
This operation allows an application thread to wait for the occurrence of certain conditions.
If none of the conditions attached to the WaitSet have a trigger_value of TRUE, the wait operation will block suspending the calling thread.
The wait operation takes a timeout argument that specifies the maximum duration for the wait. It this duration is exceeded and none of the attached Condition objects is true, wait will continue and the returned ConditionSeq will be empty.
It is not allowed for more than one application thread to be waiting on the same WaitSet. If the wait operation is invoked on a WaitSet that already has a thread blocking on it, the operation will raise immediately an exception PreconditionNotMet.
The result of the wait operation is the list of all the attached conditions that have a trigger_value of TRUE (i.e., the conditions that unblocked the wait).
triggered | a sequence that is populated with triggered conditions on return |
timeout | the maximum amount of time for which the wait should block while waiting for a condition to be triggered. |
ConditionSeq& dds::core::cond::WaitSet::wait | ( | ConditionSeq & | triggered | ) |
This operation allows an application thread to wait for the occurrence of certain conditions.
If none of the conditions attached to the WaitSet have a trigger_value of TRUE, the wait operation will block suspending the calling thread.
The wait operation takes a timeout argument that specifies the maximum duration for the wait. It this duration is exceeded and none of the attached Condition objects is true, wait will continue and the returned ConditionSeq will be empty.
It is not allowed for more than one application thread to be waiting on the same WaitSet. If the wait operation is invoked on a WaitSet that already has a thread blocking on it, the operation will raise immediately an exception PreconditionNotMet.
The result of the wait operation is the list of all the attached conditions that have a trigger_value of TRUE (i.e., the conditions that unblocked the wait).
triggered | a sequence that is populated with triggered conditions on return |