DDS-PSM-C++  1.0
ISO C++ API for OpenSplice DDS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
Public Types | Public Member Functions | List of all members
dds::core::cond::TWaitSet< DELEGATE > Class Template Reference

#include <TWaitSet.hpp>

Inheritance diagram for dds::core::cond::TWaitSet< DELEGATE >:
Inheritance graph
[legend]

Public Types

typedef std::vector
< dds::core::cond::Condition
ConditionSeq
 

Public Member Functions

 TWaitSet ()
 
 ~TWaitSet ()
 
WaitSetattach_condition (const dds::core::cond::Condition &cond)
 
const ConditionSeq conditions ()
 
ConditionSeqconditions (ConditionSeq &conds) const
 
bool detach_condition (const dds::core::cond::Condition &cond)
 
void dispatch ()
 
void dispatch (const dds::core::Duration &timeout)
 
WaitSetoperator+= (const dds::core::cond::Condition &cond)
 
WaitSetoperator-= (const dds::core::cond::Condition &cond)
 
const ConditionSeq wait (const dds::core::Duration &timeout)
 
const ConditionSeq wait ()
 
ConditionSeqwait (ConditionSeq &triggered, const dds::core::Duration &timeout)
 
ConditionSeqwait (ConditionSeq &triggered)
 
- Public Member Functions inherited from dds::core::Reference< DELEGATE >
 Reference (dds::core::null_type &)
 
 Reference (const Reference &ref)
 
template<typename D >
 Reference (const Reference< D > &ref)
 
 Reference (DELEGATE_T *p)
 
 ~Reference ()
 
const DELEGATE_REF_T & delegate () const
 
DELEGATE_REF_T & delegate ()
 
bool is_nil () const
 
 operator const DELEGATE_REF_T & () const
 
 operator DELEGATE_REF_T () const
 
 operator DELEGATE_REF_T & ()
 
template<typename R >
bool operator!= (const R &ref) const
 
bool operator!= (const null_type nil) const
 
DELEGATE * operator-> ()
 
const DELEGATE * operator-> () const
 
template<typename D >
Referenceoperator= (const Reference< D > &that)
 
template<typename R >
Referenceoperator= (const R &rhs)
 
Referenceoperator= (const null_type)
 
template<typename R >
bool operator== (const R &ref) const
 
bool operator== (const null_type) const
 

Additional Inherited Members

- Protected Attributes inherited from dds::core::Reference< DELEGATE >
DELEGATE_REF_T impl_
 

Detailed Description

template<typename DELEGATE>
class dds::core::cond::TWaitSet< DELEGATE >

A WaitSet object allows an application to wait until one or more of the attached Condition objects has a trigger_value of TRUE or else until the timeout expires. A WaitSet is not necessarily associated with a single DomainParticipant and could be used to wait on Condition objects associated with different DomainParticipant objects.

Definition at line 46 of file TWaitSet.hpp.

Member Typedef Documentation

template<typename DELEGATE >
typedef std::vector<dds::core::cond::Condition> dds::core::cond::TWaitSet< DELEGATE >::ConditionSeq

Definition at line 48 of file TWaitSet.hpp.

Constructor & Destructor Documentation

template<typename DELEGATE >
dds::core::cond::TWaitSet< DELEGATE >::TWaitSet ( )

Creates a new waitset.

template<typename DELEGATE >
dds::core::cond::TWaitSet< DELEGATE >::~TWaitSet ( )

Member Function Documentation

template<typename DELEGATE >
WaitSet& dds::core::cond::TWaitSet< DELEGATE >::attach_condition ( const dds::core::cond::Condition cond)

Attaches a Condition to the WaitSet. It is possible to attach a Condition on a WaitSet that is currently being waited upon (via the wait operation). In this case, if the Condition has a trigger_value of TRUE, then attaching the condition will unblock the WaitSet. Adding a Condition that is already attached to the WaitSet has no effect.

Parameters
condthe condition to be attached to this waitset.
template<typename DELEGATE >
const ConditionSeq dds::core::cond::TWaitSet< DELEGATE >::conditions ( )

This operation retrieves the list of attached conditions.

Returns
the list of attached conditions.
template<typename DELEGATE >
ConditionSeq& dds::core::cond::TWaitSet< DELEGATE >::conditions ( ConditionSeq conds) const

This operation retrieves the list of attached conditions.

Returns
the list of attached conditions.
template<typename DELEGATE >
bool dds::core::cond::TWaitSet< DELEGATE >::detach_condition ( const dds::core::cond::Condition cond)

Detaches a Condition from the WaitSet. If the Condition was not attached to the WaitSet, the operation will return false.

Parameters
condthe condition to detach from this WaitSet
Returns
true if the condition was found and detached, false if the condition was not part of the WaitSet.
template<typename DELEGATE >
void dds::core::cond::TWaitSet< DELEGATE >::dispatch ( )

Waits for at least one of the attached conditions to trigger and then dispatches the events.

template<typename DELEGATE >
void dds::core::cond::TWaitSet< DELEGATE >::dispatch ( const dds::core::Duration timeout)

Waits for at least one of the attached conditions to trigger and then dispatches the events, or, times out and unblocks.

template<typename DELEGATE >
WaitSet& dds::core::cond::TWaitSet< DELEGATE >::operator+= ( const dds::core::cond::Condition cond)

A synonym for attach_condition.

template<typename DELEGATE >
WaitSet& dds::core::cond::TWaitSet< DELEGATE >::operator-= ( const dds::core::cond::Condition cond)

A synonym for detach_condition.

template<typename DELEGATE >
const ConditionSeq dds::core::cond::TWaitSet< DELEGATE >::wait ( const dds::core::Duration timeout)

This operation allows an application thread to wait for the occurrence of certain conditions. If none of the conditions attached to the WaitSet have a trigger_value of TRUE, the wait operation will block suspending the calling thread.

The wait operation takes a timeout argument that specifies the maximum duration for the wait. It this duration is exceeded and none of the attached Condition objects is true, wait will continue and the returned ConditionSeq will be empty.

It is not allowed for more than one application thread to be waiting on the same WaitSet. If the wait operation is invoked on a WaitSet that already has a thread blocking on it, the operation will raise immediately an exception PreconditionNotMet.

The result of the wait operation is the list of all the attached conditions that have a trigger_value of TRUE (i.e., the conditions that unblocked the wait).

Parameters
timeoutthe maximum amount of time for which the wait should block while waiting for a condition to be triggered.

PreconditionNotMetException when multiple thread try to invoke the method concurrently.

Returns
a vector containing the triggered conditions
template<typename DELEGATE >
const ConditionSeq dds::core::cond::TWaitSet< DELEGATE >::wait ( )

This operation allows an application thread to wait for the occurrence of certain conditions. If none of the conditions attached to the WaitSet have a trigger_value of TRUE, the wait operation will block suspending the calling thread.

The wait operation takes a timeout argument that specifies the maximum duration for the wait. It this duration is exceeded and none of the attached Condition objects is true, wait will continue and the returned ConditionSeq will be empty.

It is not allowed for more than one application thread to be waiting on the same WaitSet. If the wait operation is invoked on a WaitSet that already has a thread blocking on it, the operation will raise immediately an exception PreconditionNotMet.

The result of the wait operation is the list of all the attached conditions that have a trigger_value of TRUE (i.e., the conditions that unblocked the wait).

Parameters
timeoutthe maximum amount of time for which the wait should block while waiting for a condition to be triggered.

PreconditionNotMetException when multiple thread try to invoke the method concurrently.

Returns
a vector containing the triggered conditions
template<typename DELEGATE >
ConditionSeq& dds::core::cond::TWaitSet< DELEGATE >::wait ( ConditionSeq triggered,
const dds::core::Duration timeout 
)

This operation allows an application thread to wait for the occurrence of certain conditions. If none of the conditions attached to the WaitSet have a trigger_value of TRUE, the wait operation will block suspending the calling thread.

The wait operation takes a timeout argument that specifies the maximum duration for the wait. It this duration is exceeded and none of the attached Condition objects is true, wait will continue and the returned ConditionSeq will be empty.

It is not allowed for more than one application thread to be waiting on the same WaitSet. If the wait operation is invoked on a WaitSet that already has a thread blocking on it, the operation will raise immediately an exception PreconditionNotMet.

The result of the wait operation is the list of all the attached conditions that have a trigger_value of TRUE (i.e., the conditions that unblocked the wait).

Parameters
timeoutthe maximum amount of time for which the wait should block while waiting for a condition to be triggered.

PreconditionNotMetException when multiple thread try to invoke the method concurrently.

Returns
a vector containing the triggered conditions
template<typename DELEGATE >
ConditionSeq& dds::core::cond::TWaitSet< DELEGATE >::wait ( ConditionSeq triggered)

This operation allows an application thread to wait for the occurrence of certain conditions. If none of the conditions attached to the WaitSet have a trigger_value of TRUE, the wait operation will block suspending the calling thread.

The wait operation takes a timeout argument that specifies the maximum duration for the wait. It this duration is exceeded and none of the attached Condition objects is true, wait will continue and the returned ConditionSeq will be empty.

It is not allowed for more than one application thread to be waiting on the same WaitSet. If the wait operation is invoked on a WaitSet that already has a thread blocking on it, the operation will raise immediately an exception PreconditionNotMet.

The result of the wait operation is the list of all the attached conditions that have a trigger_value of TRUE (i.e., the conditions that unblocked the wait).

Parameters
timeoutthe maximum amount of time for which the wait should block while waiting for a condition to be triggered.

PreconditionNotMetException when multiple thread try to invoke the method concurrently.

Returns
a vector containing the triggered conditions

The documentation for this class was generated from the following file: