RTI Connext Modern C++ API  Version 6.1.0
dds::core::cond::GuardCondition Class Reference

<<reference-type>> A condition whose trigger value is under the control of the application. More...

#include <dds/core/cond/GuardCondition.hpp>

Inheritance diagram for dds::core::cond::GuardCondition:
dds::core::cond::Condition

Public Member Functions

template<typename Functor >
void handler (const Functor &func)
 Registers a custom handler with this condition. More...
 
void reset_handler ()
 Resets the handler for this condition. More...
 
void trigger_value (bool value)
 Manually sets the trigger value. More...
 
- Public Member Functions inherited from dds::core::cond::Condition
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...
 

Detailed Description

<<reference-type>> A condition whose trigger value is under the control of the application.

The dds::core::cond::GuardCondition provides a way for an application to manually wake up a dds::core::cond::WaitSet. This is accomplished by attaching the dds::core::cond::GuardCondition to the dds::core::cond::WaitSet and then setting the trigger_value by means of the dds::core::cond::GuardCondition::trigger_value() operation.

See also
dds::core::cond::WaitSet.

Member Function Documentation

◆ handler()

template<typename Functor >
void dds::core::cond::GuardCondition::handler ( const Functor &  func)
inline

Registers a custom handler with this condition.

For information about condition handlers, see this ReadCondition constructor

MT Safety:
It is not safe to call handler(), reset_handler() or trigger_value() concurrently.

◆ reset_handler()

void dds::core::cond::GuardCondition::reset_handler ( )
inline

Resets the handler for this condition.

After the invocation of this method no handler will be registered with this condition.

MT Safety:
It is not safe to call handler(), reset_handler() or trigger_value() concurrently.

◆ trigger_value()

void dds::core::cond::GuardCondition::trigger_value ( bool  value)
inline

Manually sets the trigger value.

Setting the trigger value to true causes the activation of the condition in a WaitSet.

See also
WaitSet::wait()
WaitSet::dispatch()