Click or drag to resize

SubscriberGetDataReaders Method (IListDataReader, SampleStateMask, ViewStateMask, InstanceStateMask)

Allows the application to access the DataReader objects that contain samples with the specified sampleStates, viewStates, and instanceStates.

Namespace:  OpenDDSharp.DDS
Assembly:  OpenDDSharp (in OpenDDSharp.dll) Version: 0.5.0.0
Syntax
public ReturnCode GetDataReaders(
	IList<DataReader> readers,
	SampleStateMask sampleStates,
	ViewStateMask viewStates,
	InstanceStateMask instanceStates
)

Parameters

readers
Type: System.Collections.GenericIListDataReader
The DataReader collection to be filled up.
sampleStates
Type: OpenDDSharp.DDSSampleStateMask
The returned DataReader in the collection must contain samples that have one of the sample states.
viewStates
Type: OpenDDSharp.DDSViewStateMask
The returned DataReader in the collection must contain samples that have one of the view states.
instanceStates
Type: OpenDDSharp.DDSInstanceStateMask
The returned DataReader in the collection must contain samples that have one of the instance states.

Return Value

Type: ReturnCode
The ReturnCode that indicates the operation result.
Remarks

If the PresentationQosPolicy of the Subscriber to which the DataReader belongs has the AccessScope set to GroupPresentationQos, this operation should only be invoked inside a BeginAccess/EndAccess block. Otherwise it will return the error PreconditionNotMet.

Depending on the setting of the PresentationQosPolicy, the returned collection of DataReader objects may be a 'set' containing each DataReader at most once in no specified order, or a 'list' containing each DataReader one or more times in a specific order.

  1. If AccessScope is InstancePresentationQos or TopicPresentationQos the returned collection behaves as a 'set'.
  2. If AccessScope is GroupPresentationQos and OrderedAccess is set to , then the returned collection behaves as a 'list'.

This difference is due to the fact that, in the second situation it is required to access samples belonging to different DataReader objects in a particular order. In this case, the application should process each DataReader in the same order it appears in the 'list' and Read or Take exactly one sample from each DataReader.

See Also