![]() |
OpenSplice ISO C++ 2 DCPS
v7.x
ISO C++ 2 OpenSplice Data Distribution Service Data-Centric Publish-Subscribe API
|
A GuardCondition object is a specific Condition whose trigger_value is completely under the control of the application. More...
#include "GuardCondition.hpp"
Public Member Functions | |
GuardCondition () | |
template<typename FUN > | |
GuardCondition (FUN &functor) | |
template<typename FUN > | |
GuardCondition (const FUN &functor) | |
void | dispatch () |
template<typename Functor > | |
void | handler (Functor &func) |
template<typename Functor > | |
void | handler (const Functor &func) |
bool | is_nil () const |
template<typename R > | |
bool | operator!= (const R &ref) const |
bool | operator!= (const null_type nil) const |
DELEGATE * | operator-> () |
const DELEGATE * | operator-> () const |
template<typename R > | |
bool | operator== (const R &ref) const |
bool | operator== (const null_type) const |
void | reset_handler () |
bool | trigger_value () const |
void | trigger_value (bool value) |
bool | trigger_value () |
A GuardCondition object is a specific Condition whose trigger_value is completely under the control of the application.
When a GuardCondition is initially created, the trigger_value is FALSE.
The purpose of the GuardCondition is to provide the means for the application to manually triggering a WaitSet to stop waiting. This is accomplished by attaching the GuardCondition to the WaitSet and then setting the trigger_value by means of the set trigger_value operation.
See the WaitSet examples for more examples.
Although the WaitSet examples use the StatusCondition, the basic usage of this Condition with a WaitSet is the same.
Definition at line 67 of file GuardCondition.hpp.
dds::core::cond::GuardCondition::GuardCondition | ( | ) |
Create a dds::core::cond::GuardCondition.
The GuardCondition can then be added to a dds::core::cond::WaitSet so that the application can manually wake up a thread that is blocked on that WaitSet.
dds::core::Exception |
Definition at line 44 of file GuardConditionImpl.hpp.
dds::core::cond::GuardCondition::GuardCondition | ( | FUN & | functor | ) |
Create a dds::core::cond::GuardCondition.
The GuardCondition can then be added to a dds::core::cond::WaitSet so that the application can manually wake up a thread that is blocked on that WaitSet.
The supplied functor will be called when this GuardCondition 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 GuardCondition is attached to.
functor | The functor to be called when the GuardCondition triggers. |
dds::core::Exception |
dds::core::cond::GuardCondition::GuardCondition | ( | const FUN & | functor | ) |
Create a dds::core::cond::GuardCondition.
The GuardCondition can then be added to a dds::core::cond::WaitSet so that the application can manually wake up a thread that is blocked on that WaitSet.
The supplied functor will be called when this GuardCondition 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 GuardCondition is attached to.
functor | The functor to be called when the GuardCondition triggers. |
dds::core::Exception |
|
inherited |
Dispatches the functor that have been registered with the Condition.
The Condition has to have been triggered for the functor will be called by this function.
dds::core::Exception |
Definition at line 76 of file ConditionImpl.hpp.
|
inherited |
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.
Functor | The functor to be called when the StatusCondition triggers. |
dds::core::Exception |
|
inherited |
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.
Functor | The functor to be called when the StatusCondition triggers. |
dds::core::Exception |
|
inherited |
Check if the referenced object is nil.
In other words, check if the reference is pointing to a null object.
Definition at line 143 of file ReferenceImpl.hpp.
|
inherited |
Compares two Reference objects and returns true if they are not equal.
Inequality is based on the referential inequality of the object being pointed to.
ref | the other Reference object |
Definition at line 100 of file ReferenceImpl.hpp.
|
inherited |
Special operator!= used to check if this reference object does not equal the dds::core::null reference.
The non-null-check can be done like this:
Definition at line 157 of file ReferenceImpl.hpp.
|
inherited |
The operator->() is provided to be able to directly invoke functions on the delegate.
The decision to provide direct access to the delegate was motivated by the need for providing a way that was not invasive with respect to the CXXDDS API and yet would allow for vendor-specific extension. Thus vendor-specific extensions can be invoked on the Reference and on all its subclasses as follows:
Definition at line 180 of file ReferenceImpl.hpp.
|
inherited |
The operator->() is provided to be able to directly invoke functions on the delegate.
The decision to provide direct access to the delegate was motivated by the need for providing a way that was not invasive with respect to the CXXDDS API and yet would allow for vendor-specific extension. Thus vendor-specific extensions can be invoked on the Reference and on all its subclasses as follows:
Definition at line 188 of file ReferenceImpl.hpp.
|
inherited |
Compares two Reference objects and returns true if they are equal.
Equality is based on the referential equality of the object being pointed.
ref | the other Reference object |
Definition at line 83 of file ReferenceImpl.hpp.
|
inherited |
Special operator== used to check if this reference object equals the dds::core::null reference.
The null-check can be done like this:
Definition at line 150 of file ReferenceImpl.hpp.
|
inherited |
Resets the handler for this Condition.
After the invocation of this function no handler will be registered with this Condition.
dds::core::Exception |
Definition at line 69 of file ConditionImpl.hpp.
|
inherited |
This operation retrieves the trigger_value of the Condition.
A Condition has a trigger_value that can be TRUE or FALSE and is set by the Data Distribution Service (except a GuardCondition). This operation returns the trigger_value of the Condition.
dds::core::Exception |
Definition at line 83 of file ConditionImpl.hpp.
void dds::core::cond::GuardCondition::trigger_value | ( | bool | value | ) |
This operation sets the trigger_value of the GuardCondition.
A GuardCondition object is a specific Condition which trigger_value is completely under the control of the application. This operation must be used by the application to manually wake-up a WaitSet. This operation sets the trigger_value of the GuardCondition to the parameter value. The GuardCondition is directly created using the GuardCondition constructor. When a GuardCondition is initially created, the trigger_value is FALSE.
value | The boolean value to which the GuardCondition is set. |
dds::core::Exception |
Definition at line 81 of file GuardConditionImpl.hpp.
bool dds::core::cond::GuardCondition::trigger_value | ( | ) |
This operation retrieves the trigger_value of the Condition.
A Condition has a trigger_value that can be TRUE or FALSE and is set by the Data Distribution Service (except a GuardCondition). This operation returns the trigger_value of the Condition.
dds::core::Exception |
Definition at line 88 of file GuardConditionImpl.hpp.