OpenSplice C# API  v6.x
OpenSplice C# Data Distribution Service Data-Centric Publish-Subscribe API
DDS.IReadCondition Interface Reference

IReadCondition objects allow an IDataReader to specify the data samples it is interested in More...

Inheritance diagram for DDS.IReadCondition:
Inheritance graph
Collaboration diagram for DDS.IReadCondition:
Collaboration graph

Public Member Functions

IDataReader GetDataReader ()
 This operation returns the IDataReader associated with the IReadCondition. More...
 
InstanceStateKind GetInstanceStateMask ()
 This operation returns the set of InstanceStates that are taken into account to determine the TriggerValue of the IReadCondition. More...
 
SampleStateKind GetSampleStateMask ()
 This operation returns the set of SampleStates that are taken into account to determine the TriggerValue of the IReadCondition. More...
 
ViewStateKind GetViewStateMask ()
 This operation returns the set of ViewStates that are taken into account to determine the TriggerValue of the IReadCondition. More...
 
- Public Member Functions inherited from DDS.ICondition
bool GetTriggerValue ()
 Each ICondition has a TriggerValue that can be true or false and is set by the DDS depending on the evaluation of the ICondition. More...
 

Detailed Description

IReadCondition objects allow an IDataReader to specify the data samples it is interested in

The IDataReader objects can create a set of IReadCondition (and IStatusCondition) objects which provide support (in conjunction with IWaitSet objects) for an alternative communication style between the Data Distribution Service and the application (i.e., state-based rather than event-based). IReadCondition objects allow an IDataReader to specify the data samples it is interested in (by specifying the desired sample-states, view-states, and instance-states); see the parameter definitions for IDataReader.CreateReadCondition operation. This allows the Data Distribution Service to trigger the condition only when suitable information is available. IReadCondition objects are to be used in conjunction with an IWaitSet. More than one IReadCondition may be attached to the same IDataReader.

See also
Waitset
/* Simplified example of the creation of an ReadCondition
* Defaults are used and possible errors are ignored. */
/* Prepare Domain. */
DDS.IDomainParticipant participant = factory.CreateParticipant(DDS.DomainId.Default);
/* Create waitset */
IWaitSet waitset = new WaitSet();
/* Add topic data type to the system. */
DDS.ITypeSupport typesupport = new Space.FooTypeSupport();
DDS.ReturnCode retcode = typesupport.RegisterType(participant, "Space.Foo");
DDS.ITopic topic = participant.CreateTopic("SpaceFooTopic", "Space.Foo");
/* Create typed datareader. */
DDS.ISubscriber subscriber = participant.CreateSubscriber();
Space.FooDataReader reader = (Space.FooDataReader)publisher.CreateDataReader(topic);
/* Create readcondition */
IReadCondition condition = reader.CreateReadCondition(DDS.SampleStateKind.Read, DDS.ViewStateKind.New, DDS.InstanceStateKind.Alive);
/* Attach condition to waitset */
retcode = waitset.AttachCondition(condition);

Definition at line 457 of file DdsDcpsInterfaces.cs.

Member Function Documentation

◆ GetDataReader()

IDataReader DDS.IReadCondition.GetDataReader ( )

This operation returns the IDataReader associated with the IReadCondition.

Note that there is exactly one IDataReader associated with each IReadCondition (i.e. the IDataReader that created the IReadCondition object).

Returns
The IDataReader associated with the IReadCondition.

◆ GetInstanceStateMask()

InstanceStateKind DDS.IReadCondition.GetInstanceStateMask ( )

This operation returns the set of InstanceStates that are taken into account to determine the TriggerValue of the IReadCondition.

The InstanceStates returned are the InstanceStates specified when the IReadCondition was created. InstanceStates can be Alive NotAlivedDisposed NotAliveNoWriters or a combination of these (DDS.InstanceStateKind).

Returns
The InstanceStates specified when the IReadCondition was created.

◆ GetSampleStateMask()

SampleStateKind DDS.IReadCondition.GetSampleStateMask ( )

This operation returns the set of SampleStates that are taken into account to determine the TriggerValue of the IReadCondition.

The SampleStates returned are the SampleStates specified when the IReadCondition was created. The SampleStates can be Read, NotRead or both (DDS.SampleStateKind).

Returns
The SampleStates specified when the IReadCondition was created.

◆ GetViewStateMask()

ViewStateKind DDS.IReadCondition.GetViewStateMask ( )

This operation returns the set of ViewStates that are taken into account to determine the TriggerValue of the IReadCondition.

The ViewStates returned are the ViewStates specified when the IReadCondition was created. ViewStates can be New, NotNew or both (DDS.ViewStateKind).

Returns
The ViewStates specified when the IReadCondition was created.

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