Class WaitSet

Class Documentation

class WaitSet

The WaitSet class allows an application to wait until one or more of the attached Condition objects has a trigger_value of TRUE or until timeout expires.

Public Functions

RTPS_DllAPI WaitSet()
RTPS_DllAPI ~WaitSet()
WaitSet(const WaitSet&) = delete
WaitSet(WaitSet&&) = delete
WaitSet &operator=(const WaitSet&) = delete
WaitSet &operator=(WaitSet&&) = delete
RTPS_DllAPI ReturnCode_t attach_condition (const Condition &cond)

Attaches a Condition to the Wait Set.

Parameters

condCondition

Returns

RETCODE_OK if attached correctly, error code otherwise

RTPS_DllAPI ReturnCode_t detach_condition (const Condition &cond)

Detaches a Condition from the WaitSet.

Parameters

condCondition

Returns

RETCODE_OK if detached correctly, PRECONDITION_NOT_MET if condition was not attached

RTPS_DllAPI ReturnCode_t wait (ConditionSeq &active_conditions, const fastrtps::Duration_t timeout) const

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.

Parameters
  • active_conditions – Reference to the collection of conditions which trigger_value are true

  • timeout – Maximum time of the wait

Returns

RETCODE_OK if everything correct, PRECONDITION_NOT_MET if WaitSet already waiting, TIMEOUT if maximum time expired, error code otherwise

RTPS_DllAPI ReturnCode_t get_conditions (ConditionSeq &attached_conditions) const

Retrieves the list of attached conditions.

Parameters

attached_conditions – Reference to the collection of attached conditions

Returns

RETCODE_OK if everything correct, error code otherwise