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

A StatusCondition object is a specific Condition that is associated with each Entity. More...

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

Public Member Functions

 StatusCondition (const dds::core::Entity &e)
 Create a StatusCondition (Section 7.1.2.1.9, StatusCondition Class) associated with the Entity. More...
 
template<typename FUN >
 StatusCondition (const dds::core::Entity &e, FUN &functor)
 Create a dds::core::cond::StatusCondition associated with an Entity. More...
 
template<typename FUN >
 StatusCondition (const dds::core::Entity &e, const FUN &functor)
 Create a dds::core::cond::StatusCondition associated with an Entity. More...
 
void enabled_statuses (const dds::core::status::StatusMask &status) const
 This operation defines the list of communication statuses that are taken into account to determine the trigger_value of the StatusCondition. More...
 
const dds::core::status::StatusMask enabled_statuses () const
 This operation retrieves the list of communication statuses that are taken into account to determine the trigger_value of the StatusCondition. More...
 
- Public Member Functions inherited from dds::core::cond::Condition
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 StatusCondition object is a specific Condition that is associated with each Entity.

The trigger_value of the StatusCondition depends on the communication status of that entity (e.g., arrival of data, loss of information, etc.), filtered by the set of enabled_statuses on the StatusCondition. The enabled_statuses and its relation to Listener and WaitSet is detailed in Trigger State of the StatusCondition.

Constructor & Destructor Documentation

◆ StatusCondition() [1/3]

dds::core::cond::StatusCondition::StatusCondition ( const dds::core::Entity e)

Create a StatusCondition (Section 7.1.2.1.9, StatusCondition Class) associated with the Entity.

The condition can then be added to a WaitSet (Section 7.1.2.1.6, WaitSet Class) so that the application can wait for specific status changes that affect the Entity.

◆ StatusCondition() [2/3]

template<typename FUN >
dds::core::cond::StatusCondition::StatusCondition ( const dds::core::Entity e,
FUN &  functor 
)

Create a dds::core::cond::StatusCondition associated with an Entity.

The StatusCondition can then be added to a dds::core::cond::WaitSet so that the application can wait for specific status changes that affect the Entity.

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

Parameters
eThe Entity to associate with the StatusCondition.
functorThe functor to be called when the StatusCondition triggers.
Exceptions
dds::core::Exception

◆ StatusCondition() [3/3]

template<typename FUN >
dds::core::cond::StatusCondition::StatusCondition ( const dds::core::Entity e,
const FUN &  functor 
)

Create a dds::core::cond::StatusCondition associated with an Entity.

The StatusCondition can then be added to a dds::core::cond::WaitSet so that the application can wait for specific status changes that affect the Entity.

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

Parameters
eThe Entity to associate with the StatusCondition.
functorThe const functor to be called when the StatusCondition triggers.
Exceptions
dds::core::Exception

Member Function Documentation

◆ enabled_statuses() [1/2]

void dds::core::cond::StatusCondition::enabled_statuses ( const dds::core::status::StatusMask status) const

This operation defines the list of communication statuses that are taken into account to determine the trigger_value of the StatusCondition.

This operation may change the trigger_value of the StatusCondition. WaitSet objects behavior depend on the changes of the trigger_value of their attached conditions. Therefore, any WaitSet to which the StatusCondition is attached is potentially affected by this operation. If this function is not invoked, the default list of enabled statuses includes all the statuses.

Parameters
statusthe enabled statuses

◆ enabled_statuses() [2/2]

const dds::core::status::StatusMask dds::core::cond::StatusCondition::enabled_statuses ( ) const

This operation retrieves the list of communication statuses that are taken into account to determine the trigger_value of the StatusCondition.

This operation returns the statuses that were explicitly set on the last call to set enabled_statuses or, if set enabled_statuses was never called, the default list (see Section 7.1.2.1.9.1).


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