RTI Connext C# API  6.1.0
DataReader< T > Class Template Reference

Allows the application to: (1) declare the data it wishes to receive (i.e. make a subscription) and (2) access the data received by the attached Subscriber. More...

Inheritance diagram for DataReader< T >:
AnyDataReader Entity

Public Member Functions

LoanedSamples< T > Read ()
 Access all data samples. More...
 
override LoanedSamples< object > ReadUntyped ()
 Allows calling Read in a context where the type is not known, as an AnyDataReader More...
 
override LoanedSamples< object > TakeUntyped ()
 Allows calling Take in a context where the type is not known, as an AnyDataReader More...
 
LoanedSamples< T > Take ()
 Access and remove all data samples. More...
 
Selector< T > Select ()
 Access data samples according with certain selection criteria More...
 
override SelectorUntyped SelectUntyped ()
 Calls Select, but allows doing so as an AnyDataReader in a context where T is not known. More...
 
InstanceHandle LookupInstance (T keyHolder)
 Retrieves the instance handle that corresponds to a data sample containing the key values. More...
 
override InstanceHandle LookupInstanceUntyped (object keyHolder)
 Calls LookupInstance(T), but allows doing so as an AnyDataReader in a context where T is not known. More...
 
GetKeyValue (T keyHolder, in InstanceHandle instanceHandle)
 Retrieve the instance key value that corresponds to an instance handle. More...
 
override object GetKeyValueUntyped (object keyHolder, in InstanceHandle instanceHandle)
 Calls DataReader<T>.GetKeyValue, but allows doing so as an AnyDataReader in a context where T is not known. More...
 
override string ToString ()
 Provides a readable summary of information about this DataWriter. More...
 
- Public Member Functions inherited from AnyDataReader
ReadCondition CreateReadCondition (DataState state)
 Creates a ReadCondition. More...
 
QueryCondition CreateQueryCondition (Filter filter, DataState state)
 Creates a QueryCondition with a filter and a data state. More...
 
QueryCondition CreateQueryCondition (Filter filter)
 Creates a QueryCondition with DataState.Any. More...
 
PublicationBuiltinTopicData GetMatchedPublicationData (in InstanceHandle publicationHandle)
 Retrieves the information on a publication that is currently "associated" with this DataReader. More...
 
IEnumerable< PublicationBuiltinTopicDataGetMatchedPublicationData ()
 Retrieves the information on all publications that are currently "associated" with this DataReader. More...
 
ParticipantBuiltinTopicData GetMatchedPublicationParticipantData (in InstanceHandle publicationHandle)
 Retrieves the information on the discovered Domain.DomainParticipant associated with the publication that is currently matching with the DataReader<T> More...
 
void AcknowledgeAll ()
 Acknowledges all previously accessed samples. More...
 
void AcknowledgeAll (AckResponseData responseData)
 Acknowledges all previously accessed samples with a response. More...
 
void AcknowledgeSample (SampleInfo sampleInfo)
 Acknowledges a single sample explicitly. More...
 
void AcknowledgeSample (SampleInfo sampleInfo, AckResponseData responseData)
 Acknowledges a single sample explicitly with a response. More...
 
void AcknowledgeSample (SampleIdentity sampleIdentity)
 Acknowledges a single sample explicitly. More...
 
void AcknowledgeSample (SampleIdentity sampleIdentity, AckResponseData responseData)
 Acknowledges a single sample explicitly with a response. More...
 
DataReaderProtocolStatus GetMatchedPublicationDataReaderProtocolStatus (in InstanceHandle publicationHandle)
 Gets the DataReaderProtocolStatus for this reader, per matched publication identified by its InstanceHandle. More...
 
bool IsMatchedPublicationAlive (in InstanceHandle publicationHandle)
 Check if a publication currently matched with this reader is alive. More...
 
void WaitForHistoricalData (in Duration duration)
 Waits until all "historical" data is received if the reader was configured with a non-Volatile DurabilityKind. More...
 
abstract object GetKeyValueUntyped (object keyHolder, in InstanceHandle InstanceHandle)
 Allows calling DataReader<T>.GetKeyValue in a context where the type is not known. More...
 
override void ResetEvents (StatusMask eventsToRemove=StatusMask.All)
 Stop notifying of certain events and remove their event handlers More...
 
void DisposeContainedEntities ()
 Disposes all the entities that were created by this reader. More...
 
- Public Member Functions inherited from Entity
void Enable ()
 Enables this Entity (by default entities are automatically enabled after creation) More...
 
EntityLock Lock ()
 Locks the Entity using its internal lock. More...
 
void Dispose ()
 Releases the resources used by this Entity and disposes its contained entities as well (if any). More...
 

Properties

override Subscriber Subscriber [get]
 Returns the Subscriber to which the DataReader belongs. More...
 
override ITopicDescription TopicDescription [get]
 Returns the TopicDescription associated with the DataReader. More...
 
- Properties inherited from AnyDataReader
DataReaderQos Qos [get, set]
 Gets or sets the reader QoS. More...
 
abstract Subscriber Subscriber [get]
 Returns the Subscriber to which the DataReader belongs. More...
 
abstract ITopicDescription TopicDescription [get]
 Returns the TopicDescription associated with this DataReader. More...
 
SubscriptionMatchedStatus SubscriptionMatchedStatus [get]
 Retrieve the StatusMask.SubscriptionMatched status. More...
 
LivelinessChangedStatus LivelinessChangedStatus [get]
 Retrieve the StatusMask.LivelinessChanged status. More...
 
RequestedDeadlineMissedStatus RequestedDeadlineMissedStatus [get]
 Retrieve the StatusMask.RequestedDeadlineMissed status. More...
 
RequestedIncompatibleQosStatus RequestedIncompatibleQosStatus [get]
 Retrieve the StatusMask.RequestedIncompatibleQos status. More...
 
SampleLostStatus SampleLostStatus [get]
 Retrieve the StatusMask.SampleLost status. More...
 
SampleRejectedStatus SampleRejectedStatus [get]
 Retrieve the StatusMask.SampleRejected status. More...
 
DataReaderCacheStatus DataReaderCacheStatus [get]
 Retrieve the StatusMask.DataReaderCache status. More...
 
DataReaderProtocolStatus DataReaderProtocolStatus [get]
 Retrieve the StatusMask.DataReaderProtocol status. More...
 
IEnumerable< InstanceHandleMatchedPublications [get]
 Retrieves the list of publications currently "associated" with this DataReader. More...
 
SubscriptionMatchedEventHandler SubscriptionMatched
 Event triggered when the Rti.Dds.Core.Status.StatusMask.SubscriptionMatched status changes More...
 
DataAvailableEventHandler DataAvailable
 Event triggered when the Rti.Dds.Core.Status.StatusMask.DataAvailable status changes More...
 
LivelinessChangedEventHandler LivelinessChanged
 Event triggered when the Rti.Dds.Core.Status.StatusMask.LivelinessChanged status changes More...
 
RequestedDeadlineMissedEventHandler RequestedDeadlineMissed
 Event triggered when the Rti.Dds.Core.Status.StatusMask.RequestedDeadlineMissed status changes More...
 
RequestedIncompatibleQosEventHandler RequestedIncompatibleQos
 Event triggered when the Rti.Dds.Core.Status.StatusMask.RequestedIncompatibleQos status changes More...
 
SampleLostEventHandler SampleLost
 Event triggered when the Rti.Dds.Core.Status.StatusMask.SampleLost status changes More...
 
SampleRejectedEventHandler SampleRejected
 Event triggered when the Rti.Dds.Core.Status.StatusMask.SampleRejected status changes More...
 
- Properties inherited from Entity
InstanceHandle InstanceHandle [get]
 Gets the InstanceHandle that identifies this Entity More...
 
StatusMask StatusChanges [get]
 Retrieves the list of communication statuses in this Entity that are triggered. More...
 
StatusCondition StatusCondition [get]
 Gets the StatusCondition associated with this Entity. More...
 
bool Enabled [get]
 Indicates whether this Entity is enabled. More...
 
bool Disposed [get]
 Indicates whether this Entity has already been disposed. More...
 

Detailed Description

Allows the application to: (1) declare the data it wishes to receive (i.e. make a subscription) and (2) access the data received by the attached Subscriber.

The full documentation is available in the C API: DDS_DataReader

Member Function Documentation

◆ GetKeyValue()

T GetKeyValue ( keyHolder,
in InstanceHandle  instanceHandle 
)

Retrieve the instance key value that corresponds to an instance handle.

The full documentation is available in the C API: FooDataReader_get_key_value

◆ GetKeyValueUntyped()

override object GetKeyValueUntyped ( object  keyHolder,
in InstanceHandle  instanceHandle 
)

Calls DataReader<T>.GetKeyValue, but allows doing so as an AnyDataReader in a context where T is not known.

Parameters
keyHolderThe obtained key values.
instanceHandleThe InstanceHandle corresponding to the instance whose key values we want to obtain. The runtime type of keyHolder must be T. Otherwise this operation throws InvalidCastException.
Returns
The obtained key values.

◆ LookupInstance()

InstanceHandle LookupInstance ( keyHolder)

Retrieves the instance handle that corresponds to a data sample containing the key values.

The full documentation is available in the C API: FooDataReader_lookup_instance

◆ LookupInstanceUntyped()

override InstanceHandle LookupInstanceUntyped ( object  keyHolder)
virtual

Calls LookupInstance(T), but allows doing so as an AnyDataReader in a context where T is not known.

Parameters
keyHolderThe key fields of the instance to lookup. The runtime type of keyHolder must be T. Otherwise this operation throws InvalidCastException.

Implements AnyDataReader.

◆ Read()

LoanedSamples<T> Read ( )

Access all data samples.

The full documentation is available in the C API: FooDataReader_read

◆ ReadUntyped()

override LoanedSamples<object> ReadUntyped ( )
virtual

Allows calling Read in a context where the type is not known, as an AnyDataReader

Returns
A collection equivalent to the one returned by Read, but one where the declared type of the data is object, instead of a concrete T.

Implements AnyDataReader.

◆ Select()

Selector<T> Select ( )

Access data samples according with certain selection criteria

Returns
A selector that can be configured to specify which samples to read or take.

The full documentation is available in the C API: FooDataReader_take

◆ SelectUntyped()

override SelectorUntyped SelectUntyped ( )
virtual

Calls Select, but allows doing so as an AnyDataReader in a context where T is not known.

Returns
A selector that can be configured to specify which samples to read or take. /returns>

Implements AnyDataReader.

◆ Take()

LoanedSamples<T> Take ( )

Access and remove all data samples.

See also Rti.Dds.Subscription.DataReaderAsyncExtensions.TakeAsync.

The full documentation is available in the C API: FooDataReader_take

◆ TakeUntyped()

override LoanedSamples<object> TakeUntyped ( )
virtual

Allows calling Take in a context where the type is not known, as an AnyDataReader

Returns
A collection equivalent to the one returned by Take, but one where the declared type of the data is object, instead of a concrete T.

Implements AnyDataReader.

◆ ToString()

override string ToString ( )

Provides a readable summary of information about this DataWriter.

Property Documentation

◆ Subscriber

override Subscriber Subscriber
get

Returns the Subscriber to which the DataReader belongs.

The full documentation is available in the C API: DDS_DataReader_get_subscriber

◆ TopicDescription

override ITopicDescription TopicDescription
get

Returns the TopicDescription associated with the DataReader.

The full documentation is available in the C API: DDS_DataReader_get_topicdescription