CoreDX DDS Modern C++ API
Public Member Functions | List of all members
dds::core::cond::Condition Class Reference

A Condition is a root class for all the conditions that may be attached to a WaitSet. More...

Inheritance diagram for dds::core::cond::Condition:
Inheritance graph
[legend]
Collaboration diagram for dds::core::cond::Condition:
Collaboration graph
[legend]

Public Member Functions

template<typename Functor >
void handler (Functor &func)
 Registers a functor as custom handler with this Condition. More...
 
template<typename Functor >
void handler (const Functor &func)
 Registers a functor as custom handler with this Condition. More...
 
void reset_handler ()
 Resets the handler for this Condition. More...
 
void dispatch ()
 Dispatches the functors that have been registered with the condition, if the condition is in the 'triggered' state. More...
 
bool trigger_value () const
 This operation retrieves the trigger_value of the Condition.
 
- 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...
 
Referenceoperator= (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...
 

Detailed Description

A Condition is a root class for all the conditions that may be attached to a WaitSet.

This basic class is specialized in three classes that are known by the middleware: GuardCondition (Section 7.1.2.1.8), StatusCondition (Section 7.1.2.1.9), and ReadCondition (Section 7.1.2.5.8).

Member Function Documentation

◆ dispatch()

void dds::core::cond::Condition::dispatch ( )

Dispatches the functors that have been registered with the condition, if the condition is in the 'triggered' state.

The Condition must be 'triggered' for the functor to be called by this function.

◆ handler() [1/2]

template<typename Functor >
void dds::core::cond::Condition::handler ( Functor &  func)

Registers a functor as custom handler with this Condition.

The supplied functor will be called when this Condition is triggered and either the dds::core::cond::Condition::dispatch() is called or the dds::core::cond::WaitSet::dispatch() on the WaitSet to which this Condition is attached to.

Template Parameters
FunctorThe functor to be called when the StatusCondition triggers.
Returns
void
Exceptions
dds::core::Exception

◆ handler() [2/2]

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

Registers a functor as custom handler with this Condition.

The supplied functor will be called when this Condition is triggered and either the dds::core::cond::Condition::dispatch() is called or the dds::core::cond::WaitSet::dispatch() on the WaitSet to which this Condition is attached to.

Template Parameters
FunctorThe const functor to be called when the StatusCondition triggers.
Returns
void
Exceptions
dds::core::Exception

◆ reset_handler()

void dds::core::cond::Condition::reset_handler ( )

Resets the handler for this Condition.

After the invocation of this function no handler will be registered with this Condition.

Returns
void
Exceptions
dds::core::Exception

© 2009-2020 Twin Oaks Computing, Inc
Castle Rock, CO 80104
All rights reserved.