Template Class TCondition
Defined in File Condition.hpp
Inheritance Relationships
Base Type
public dds::core::Reference< DELEGATE >
(Template Class Reference)
Derived Types
public dds::core::cond::TGuardCondition< DELEGATE >
(Template Class TGuardCondition)public dds::core::cond::TStatusCondition< DELEGATE >
(Template Class TStatusCondition)
Class Documentation
-
template<typename DELEGATE>
class TCondition : public virtual dds::core::Reference<DELEGATE> This class is the base class for all the conditions that may be attached to a dds::core::cond::WaitSet.
This base class is specialized in three classes by the Data Distribution Service:
dds::core::cond::GuardCondition
dds::core::cond::StatusCondition
dds::sub::cond::ReadCondition
dds::sub::cond::QueryCondition
Each Condition has a trigger_value that can be TRUE or FALSE and is set by the Data Distribution Service (except a GuardCondition) depending on the evaluation of the Condition.
See also
Status concept
See also
WaitSet concept
Subclassed by dds::core::cond::TGuardCondition< DELEGATE >, dds::core::cond::TStatusCondition< DELEGATE >
Public Functions
- OMG_DDS_REF_TYPE_PROTECTED_DC (TCondition, dds::core::Reference, DELEGATE) OMG_DDS_EXPLICIT_REF_BASE_DECL(TCondition
- detail::StatusCondition OMG_DDS_EXPLICIT_REF_BASE_DECL (TCondition, detail::GuardCondition) OMG_DDS_EXPLICIT_REF_BASE_DECL(TCondition
- detail::StatusCondition dds::sub::cond::detail::ReadCondition OMG_DDS_EXPLICIT_REF_BASE_DECL (TCondition, dds::sub::cond::detail::QueryCondition) template< typename Functor > OMG_DDS_API void 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:
Functor – The functor to be called when the StatusCondition triggers.
- Throws:
dds::core::Exception –
- Returns:
void
- template<typename Functor> OMG_DDS_API void handler (const Functor &func)
- OMG_DDS_API void reset_handler ()
Resets the handler for this Condition.
After the invocation of this function no handler will be registered with this Condition.
- Throws:
dds::core::Exception –
- Returns:
void
- OMG_DDS_API void dispatch ()
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.
- Throws:
dds::core::Exception –
- Returns:
void
- OMG_DDS_API bool trigger_value () const
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.
- Throws:
dds::core::Exception –
- Returns:
bool The boolean value to which the Condition is set.