A WaitSet maintains a set of Condition objects and allows the application to wait until one or more of them have a trigger_value of TRUE. More...
Public Member Functions | |
ReturnCode_t | attach_condition (Condition &a_condition) |
Adds the condition c to the WaitSet ws. More... | |
ReturnCode_t | detach_condition (Condition &a_condition) |
Removes a condition c from WaitSet ws. More... | |
ReturnCode_t | wait (ConditionSeq &active_conditions, const Duration_t &timeout) |
Causes the controlling thread to block until an attached condition is triggered or timeout elapses. More... | |
ReturnCode_t | get_conditions (ConditionSeq &attached_conditions) |
Retrieves the current list of attached conditions. More... | |
A WaitSet maintains a set of Condition objects and allows the application to wait until one or more of them have a trigger_value of TRUE.
Multiple conditions may be attached to a WaitSet. A WaitSet is created by a call to WaitSet__alloc(), and destroyed with a call to WaitSet__free().
ReturnCode_t DDS::WaitSet::attach_condition | ( | Condition & | a_condition | ) |
ReturnCode_t DDS::WaitSet::detach_condition | ( | Condition & | a_condition | ) |
ReturnCode_t DDS::WaitSet::get_conditions | ( | ConditionSeq & | attached_conditions | ) |
Retrieves the current list of attached conditions.
Populates the attached_conditions sequence. The application is responsible for freeing the memory contained in the sequence.
ReturnCode_t DDS::WaitSet::wait | ( | ConditionSeq & | active_conditions, |
const Duration_t & | timeout | ||
) |
Causes the controlling thread to block until an attached condition is triggered or timeout elapses.
A return value of RETCODE_OK indicates that one or more of the attached conditions evaluated to TRUE. Those 'active' conditions are included in the 'out' parameter active_conditions.
A return value of RETCODE_TIMEOUT indicates that the timeout period elapsed without any of the conditions evaluating to TRUE.