RTI Connext C# API Version 7.2.0
Rti.Dds.Core.WaitSet Class Reference

Allows an application to wait until one or more of the attached Condition objects have a trigger value of true or else until the timeout expires. More...

Inherits IDisposable.

Public Member Functions

 WaitSet ()
 Creates a new WaitSet More...
 
 WaitSet (WaitSetProperty property)
 Creates a new WaitSet with a non-default configuration. More...
 
void AttachCondition (Condition condition)
 Attaches a Condition to the WaitSet. More...
 
bool DetachCondition (Condition condition)
 Detaches a Condition from the WaitSet. More...
 
int Dispatch (Duration maxWait)
 Waits for at least one of the attached conditions to trigger and then calls the event handler for each of the active conditions. More...
 
int Dispatch ()
 Waits an unlimited amount of time for at least one of the attached conditions to trigger and then calls the event handlers of the active conditions. More...
 
IEnumerable< ConditionWait (Duration maxWait)
 Allows an application thread to wait for the occurrence of certain conditions. More...
 
IEnumerable< ConditionWait ()
 Allows an application thread to wait for the occurrence of certain conditions. It waits an infinite amount of time. More...
 
void Dispose ()
 Releases the native resources used by this WaitSet. A finalizer is also provided, so it is not necessary to call Dispose. More...
 

Properties

IEnumerable< ConditionConditions [get]
 Retrieves the list of attached Conditions. More...
 

Detailed Description

Allows an application to wait until one or more of the attached Condition objects have a trigger value of true or else until the timeout expires.

Constructor & Destructor Documentation

◆ WaitSet() [1/2]

Rti.Dds.Core.WaitSet.WaitSet ( )

Creates a new WaitSet

The full documentation is available in the C API: DDS_WaitSet_new

◆ WaitSet() [2/2]

Rti.Dds.Core.WaitSet.WaitSet ( WaitSetProperty  property)

Creates a new WaitSet with a non-default configuration.

The full documentation is available in the C API: DDSWaitSetWaitSet(WaitSetProperty_t)

Member Function Documentation

◆ AttachCondition()

void Rti.Dds.Core.WaitSet.AttachCondition ( Condition  condition)

Attaches a Condition to the WaitSet.

The full documentation is available in the C API: DDS_WaitSet_attach_condition

◆ DetachCondition()

bool Rti.Dds.Core.WaitSet.DetachCondition ( Condition  condition)

Detaches a Condition from the WaitSet.

The full documentation is available in the C API: DDS_WaitSet_detach_condition

◆ Dispatch() [1/2]

int Rti.Dds.Core.WaitSet.Dispatch ( Duration  maxWait)
inline

Waits for at least one of the attached conditions to trigger and then calls the event handler for each of the active conditions.

This is an alternative pattern to the use of Wait(). Instead of receiving the list of active conditions, the application associates an event handler to each condition before attaching it to the WaitSet. When this method wakes up after one or more conditions have become active, it calls their Condition.Triggered event handlers before returning. The handlers are called by Dispatch() in the context of the current thread.

Parameters
maxWaitThe maximum time to wait. If that time elapses this method returns normally without calling any of the condition handlers.
Returns
The number of conditions that were triggered (or 0 if the maxWait elapsed)

◆ Dispatch() [2/2]

int Rti.Dds.Core.WaitSet.Dispatch ( )

Waits an unlimited amount of time for at least one of the attached conditions to trigger and then calls the event handlers of the active conditions.

Returns
The number of conditions that were triggered

◆ Wait() [1/2]

IEnumerable< Condition > Rti.Dds.Core.WaitSet.Wait ( Duration  maxWait)

Allows an application thread to wait for the occurrence of certain conditions.

The full documentation is available in the C API: DDS_WaitSet_wait

◆ Wait() [2/2]

IEnumerable< Condition > Rti.Dds.Core.WaitSet.Wait ( )

Allows an application thread to wait for the occurrence of certain conditions. It waits an infinite amount of time.

The full documentation is available in the C API: DDS_WaitSet_wait

◆ Dispose()

void Rti.Dds.Core.WaitSet.Dispose ( )

Releases the native resources used by this WaitSet. A finalizer is also provided, so it is not necessary to call Dispose.

Property Documentation

◆ Conditions

IEnumerable<Condition> Rti.Dds.Core.WaitSet.Conditions
get

Retrieves the list of attached Conditions.

The full documentation is available in the C API: DDS_WaitSet_get_conditions