RTI Connext C# API Version 7.2.0
Rti.Dds.Subscription.Subscriber Class Reference

A subscriber is the object responsible for actually receiving data from a subscription. More...

Inheritance diagram for Rti.Dds.Subscription.Subscriber:
Rti.Dds.Core.Entity

Public Member Functions

DataReader< T > CreateDataReader< T > (Topic< T > topic)
 Creates a DataReader that will be attached and belong to this Subscriber, using default QoS. More...
 
DataReader< T > CreateDataReader< T > (Topic< T > topic, Action< DataReader< T > > preEnableAction)
 Creates a DataReader that will be attached and belong to this Subscriber, using default QoS. More...
 
DataReader< T > CreateDataReader< T > (Topic< T > topic, DataReaderQos qos, Action< DataReader< T > > preEnableAction)
 Creates a DataReader that will be attached and belong to this Subscriber. More...
 
DataReader< T > CreateDataReader< T > (ContentFilteredTopic< T > cft)
 Creates a DataReader that will be attached and belong to this Subscriber, using default QoS. More...
 
DataReader< T > CreateDataReader< T > (ContentFilteredTopic< T > cft, Action< DataReader< T > > preEnableAction)
 Creates a DataReader that will be attached and belong to this Subscriber, using default QoS More...
 
DataReader< T > CreateDataReader< T > (ContentFilteredTopic< T > cft, DataReaderQos qos, Action< DataReader< T > > preEnableAction)
 Creates a DataReader that will be attached and belong to this Subscriber, using default QoS More...
 
DataReader< T > CreateDataReader< T > (Topic< T > topic, DataReaderQos qos)
 Creates a DataReader that will be attached and belong to this Subscriber, providing the QoS. More...
 
DataReader< T > CreateDataReader< T > (ContentFilteredTopic< T > cft, DataReaderQos qos)
 Creates a DataReader that will be attached and belong to this Subscriber, providing the QoS. More...
 
AnyDataReader CreateDataReader (ITopicDescription topic)
 Creates a DataReader that will be attached and belong to this Subscriber, without knowing the type at compile time, using default QoS. More...
 
AnyDataReader CreateDataReader (ITopicDescription topic, DataReaderQos qos)
 Creates a DataReader that will be attached and belong to this Subscriber, without knowing the type at compile time, and providing the QoS. More...
 
DataReader< T > CreateDataReader< T > (ITopicDescription topicDescription, Action< DataReader< T > > preEnableAction)
 Creates a DataReader<T> that will be attached and belong to this subscriber. More...
 
DataReader< T > CreateDataReader< T > (ITopicDescription topicDescription, DataReaderQos qos)
 Creates a DataReader<T> that will be attached and belong to this subscriber. More...
 
DataReader< T > CreateDataReader< T > (ITopicDescription topicDescription, DataReaderQos qos, Action< DataReader< T > > preEnableAction)
 Creates a DataReader<T> that will be attached and belong to this subscriber. More...
 
DataReader< T > LookupDataReader< T > (string topicName)
 Retrieves a DataReader by looking it up by topic name More...
 
AnyDataReader LookupDataReader (string topicName)
 Retrieves a DataReader by looking it up by topic name More...
 
AnyDataReader LookupDataReaderByName (string readerName)
 Retrieves a DataReader contained within this looking it up by the DataReader entity name. More...
 
CoherentAccess BeginAccess ()
 Indicates that the application is about to access the data samples in any of the DataReader<T> objects attached to this subscriber. More...
 
void EndAccess ()
 Indicates that the application has finished accessing the data samples in DataReader<T> objects managed by this (alternative to CoherentAccess.Dispose.) More...
 
IEnumerable< AnyDataReaderGetDataReaders ()
 Returns all readers (equivalent to the property DataReaders). More...
 
IEnumerable< AnyDataReaderGetDataReaders (DataState state)
 Returns the DataReader<T> objects that contain data samples with the specified state. More...
 
void NotifyDataReaders ()
 When a subscriber handles the DataOnReaders event, the AnyDataReader.DataAvailable event is not triggered on its contained readers until this function is called. More...
 
override void ResetEvents (StatusMask eventsToRemove=StatusMask.All)
 Stop notifying of events and remove their event handlers More...
 
void DisposeContainedEntities ()
 Disposes all the entities that were created by this Subscriber. More...
 
- Public Member Functions inherited from Rti.Dds.Core.Entity
void Enable ()
 Enables this Entity (by default entities are automatically enabled after creation) More...
 
abstract void ResetEvents (StatusMask eventsToRemove=StatusMask.All)
 Stop notifying of events and remove their event handlers. The actual events are defined in each derived entity class. 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...
 

Static Public Attributes

const string SubscriptionBuiltinTopicName = "DCPSSubscription"
 The topic name of the DataReader in DomainParticipant.BuiltinSubscriber that provides information about Subscriptions discovered by a participant. More...
 
const string PublicationBuiltinTopicName = "DCPSPublication"
 The topic name of the DataReader in DomainParticipant.BuiltinSubscriber that provides information about Publications discovered by a participant. More...
 
const string TopicBuiltinTopicName = "DCPSTopic"
 The topic name of the DataReader in DomainParticipant.BuiltinSubscriber that provides information about Topics discovered by a participant. More...
 
const string ParticipantBuiltinTopicName = "DCPSParticipant"
 The topic name of the DataReader in DomainParticipant.BuiltinSubscriber that provides information about participants discovered by another participant. More...
 

Properties

DataReaderQos DefaultDataReaderQos [get, set]
 Copies the default DataReaderQos values into the provided DataReaderQos instance. More...
 
SubscriberQos Qos [get, set]
 Gets or sets the subscriber QoS. More...
 
DomainParticipant DomainParticipant [get]
 Returns the DomainParticipant to which this Subscriber belongs. More...
 
IEnumerable< AnyDataReaderDataReaders [get]
 Retrieve all the DataReaders created from this Subscriber More...
 
DataOnReadersEventHandler DataOnReaders
 Event triggered when the Rti.Dds.Core.Status.StatusMask.DataOnReaders status changes on this Subscriber. More...
 
SubscriptionMatchedEventHandler SubscriptionMatched
 Event triggered when the Rti.Dds.Core.Status.StatusMask.SubscriptionMatched status changes on any DataReader<T> created by this Subscriber for which this event is not being monitored. More...
 
DataAvailableEventHandler DataAvailable
 Event triggered when the Rti.Dds.Core.Status.StatusMask.DataAvailable status changes on any DataReader<T> created by this Subscriber for which this event is not being monitored. More...
 
LivelinessChangedEventHandler LivelinessChanged
 Event triggered when the Rti.Dds.Core.Status.StatusMask.LivelinessChanged status changes on any DataReader<T> created by this Subscriber for which this event is not being monitored. More...
 
RequestedDeadlineMissedEventHandler RequestedDeadlineMissed
 Event triggered when the Rti.Dds.Core.Status.StatusMask.RequestedDeadlineMissed status changes on any DataReader<T> created by this Subscriber for which this event is not being monitored. More...
 
RequestedIncompatibleQosEventHandler RequestedIncompatibleQos
 Event triggered when the Rti.Dds.Core.Status.StatusMask.RequestedIncompatibleQos status changes on any DataReader<T> created by this Subscriber for which this event is not being monitored. More...
 
SampleLostEventHandler SampleLost
 Event triggered when the Rti.Dds.Core.Status.StatusMask.SampleLost status changes on any DataReader<T> created by this Subscriber for which this event is not being monitored. More...
 
SampleRejectedEventHandler SampleRejected
 Event triggered when the Rti.Dds.Core.Status.StatusMask.SampleRejected status changes on any DataReader<T> created by this Subscriber for which this event is not being monitored. More...
 
- Properties inherited from Rti.Dds.Core.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

A subscriber is the object responsible for actually receiving data from a subscription.

Member Function Documentation

◆ CreateDataReader< T >() [1/11]

Creates a DataReader that will be attached and belong to this Subscriber, using default QoS.

Parameters
topicThe Topic<T> that the DataReader will be associated with.

The full documentation is available in the C API: DDS_Subscriber_create_datareader

◆ CreateDataReader< T >() [2/11]

DataReader< T > Rti.Dds.Subscription.Subscriber.CreateDataReader< T > ( Topic< T >  topic,
Action< DataReader< T > >  preEnableAction 
)

Creates a DataReader that will be attached and belong to this Subscriber, using default QoS.

Parameters
topicThe Topic<T> that the DataReader will be associated with.
preEnableActionAn action that allows adding handlers to reader events before the reader is enabled.

The full documentation is available in the C API: DDS_Subscriber_create_datareader

◆ CreateDataReader< T >() [3/11]

DataReader< T > Rti.Dds.Subscription.Subscriber.CreateDataReader< T > ( Topic< T >  topic,
DataReaderQos  qos,
Action< DataReader< T > >  preEnableAction 
)

Creates a DataReader that will be attached and belong to this Subscriber.

Parameters
topicThe Topic<T> that the DataReader will be associated with.
qosThe reader QoS.
preEnableActionAn action that allows adding handlers to reader events before the reader is enabled.

The full documentation is available in the C API: DDS_Subscriber_create_datareader

◆ CreateDataReader< T >() [4/11]

Creates a DataReader that will be attached and belong to this Subscriber, using default QoS.

Parameters
cftThe ContentFilteredTopic<T> that the DataReader will be associated with

The full documentation is available in the C API: DDS_Subscriber_create_datareader

◆ CreateDataReader< T >() [5/11]

DataReader< T > Rti.Dds.Subscription.Subscriber.CreateDataReader< T > ( ContentFilteredTopic< T >  cft,
Action< DataReader< T > >  preEnableAction 
)

Creates a DataReader that will be attached and belong to this Subscriber, using default QoS

Parameters
cftThe ContentFilteredTopic<T> that the DataReader will be associated with.
preEnableActionAn action that allows adding handlers to reader events before the reader is enabled.

The full documentation is available in the C API: DDS_Subscriber_create_datareader

◆ CreateDataReader< T >() [6/11]

DataReader< T > Rti.Dds.Subscription.Subscriber.CreateDataReader< T > ( ContentFilteredTopic< T >  cft,
DataReaderQos  qos,
Action< DataReader< T > >  preEnableAction 
)

Creates a DataReader that will be attached and belong to this Subscriber, using default QoS

Parameters
cftThe ContentFilteredTopic<T> that the DataReader will be associated with.
qosThe reader QoS.
preEnableActionAn action that allows adding handlers to reader events before the reader is enabled.

The full documentation is available in the C API: DDS_Subscriber_create_datareader

◆ CreateDataReader< T >() [7/11]

Creates a DataReader that will be attached and belong to this Subscriber, providing the QoS.

The full documentation is available in the C API: DDS_Subscriber_create_datareader

◆ CreateDataReader< T >() [8/11]

Creates a DataReader that will be attached and belong to this Subscriber, providing the QoS.

The full documentation is available in the C API: DDS_Subscriber_create_datareader

◆ CreateDataReader() [1/2]

AnyDataReader Rti.Dds.Subscription.Subscriber.CreateDataReader ( ITopicDescription  topic)
inline

Creates a DataReader that will be attached and belong to this Subscriber, without knowing the type at compile time, using default QoS.

The full documentation is available in the C API: DDS_Subscriber_create_datareader

◆ CreateDataReader() [2/2]

AnyDataReader Rti.Dds.Subscription.Subscriber.CreateDataReader ( ITopicDescription  topic,
DataReaderQos  qos 
)
inline

Creates a DataReader that will be attached and belong to this Subscriber, without knowing the type at compile time, and providing the QoS.

The full documentation is available in the C API: DDS_Subscriber_create_datareader

◆ CreateDataReader< T >() [9/11]

DataReader< T > Rti.Dds.Subscription.Subscriber.CreateDataReader< T > ( ITopicDescription  topicDescription,
Action< DataReader< T > >  preEnableAction 
)

Creates a DataReader<T> that will be attached and belong to this subscriber.

Parameters
topicDescriptionThe ITopicDescription that the reader will be associated with.
preEnableActionAn action that allows adding handlers to reader events before the reader is enabled.

◆ CreateDataReader< T >() [10/11]

Creates a DataReader<T> that will be attached and belong to this subscriber.

Parameters
topicDescriptionThe ITopicDescription that the reader will be associated with.
qosThe reader QoS.

◆ CreateDataReader< T >() [11/11]

DataReader< T > Rti.Dds.Subscription.Subscriber.CreateDataReader< T > ( ITopicDescription  topicDescription,
DataReaderQos  qos,
Action< DataReader< T > >  preEnableAction 
)

Creates a DataReader<T> that will be attached and belong to this subscriber.

Parameters
topicDescriptionThe ITopicDescription that the reader will be associated with.
qosThe reader QoS
preEnableActionAn action that allows adding handlers to reader events before the reader is enabled.

◆ LookupDataReader< T >()

Retrieves a DataReader by looking it up by topic name

Returns
A reader with that topic name or null if none exist

The full documentation is available in the C API: DDS_Subscriber_lookup_datareader

◆ LookupDataReader()

AnyDataReader Rti.Dds.Subscription.Subscriber.LookupDataReader ( string  topicName)
inline

Retrieves a DataReader by looking it up by topic name

Returns
A reader with that topic name or null if none exist

The full documentation is available in the C API: DDS_Subscriber_lookup_datareader

◆ LookupDataReaderByName()

AnyDataReader Rti.Dds.Subscription.Subscriber.LookupDataReaderByName ( string  readerName)
inline

Retrieves a DataReader contained within this looking it up by the DataReader entity name.

Returns
A reader with that entity name or null if none exist

The full documentation is available in the C API: DDS_Subscriber_lookup_datareader_by_name

◆ BeginAccess()

CoherentAccess Rti.Dds.Subscription.Subscriber.BeginAccess ( )
inline

Indicates that the application is about to access the data samples in any of the DataReader<T> objects attached to this subscriber.

Returns
An object whose disposal indicates the end of the coherent access

The full documentation is available in the C API: DDS_Subscriber_begin_access

◆ EndAccess()

void Rti.Dds.Subscription.Subscriber.EndAccess ( )

Indicates that the application has finished accessing the data samples in DataReader<T> objects managed by this (alternative to CoherentAccess.Dispose.)

The full documentation is available in the C API: DDS_Subscriber_end_access

◆ GetDataReaders() [1/2]

IEnumerable< AnyDataReader > Rti.Dds.Subscription.Subscriber.GetDataReaders ( )

Returns all readers (equivalent to the property DataReaders).

◆ GetDataReaders() [2/2]

IEnumerable< AnyDataReader > Rti.Dds.Subscription.Subscriber.GetDataReaders ( DataState  state)

Returns the DataReader<T> objects that contain data samples with the specified state.

The full documentation is available in the C API: DDS_Subscriber_get_datareaders

◆ NotifyDataReaders()

void Rti.Dds.Subscription.Subscriber.NotifyDataReaders ( )

When a subscriber handles the DataOnReaders event, the AnyDataReader.DataAvailable event is not triggered on its contained readers until this function is called.

The full documentation is available in the C API: DDS_Subscriber_notify_datareaders

◆ ResetEvents()

override void Rti.Dds.Subscription.Subscriber.ResetEvents ( StatusMask  eventsToRemove = StatusMask.All)
inlinevirtual

Stop notifying of events and remove their event handlers

Parameters
eventsToRemoveSelects which events will stop receiving notifications. Use StatusMask.All to remove all event handlers.

Implements Rti.Dds.Core.Entity.

◆ DisposeContainedEntities()

void Rti.Dds.Subscription.Subscriber.DisposeContainedEntities ( )
inline

Disposes all the entities that were created by this Subscriber.

The full documentation is available in the C API: DDS_Subscriber_delete_contained_entities

Field Documentation

◆ SubscriptionBuiltinTopicName

const string Rti.Dds.Subscription.Subscriber.SubscriptionBuiltinTopicName = "DCPSSubscription"
static

The topic name of the DataReader in DomainParticipant.BuiltinSubscriber that provides information about Subscriptions discovered by a participant.

See Accessing Information on Entity Discovery

◆ PublicationBuiltinTopicName

const string Rti.Dds.Subscription.Subscriber.PublicationBuiltinTopicName = "DCPSPublication"
static

The topic name of the DataReader in DomainParticipant.BuiltinSubscriber that provides information about Publications discovered by a participant.

See Accessing Information on Entity Discovery

◆ TopicBuiltinTopicName

const string Rti.Dds.Subscription.Subscriber.TopicBuiltinTopicName = "DCPSTopic"
static

The topic name of the DataReader in DomainParticipant.BuiltinSubscriber that provides information about Topics discovered by a participant.

See Accessing Information on Entity Discovery

◆ ParticipantBuiltinTopicName

const string Rti.Dds.Subscription.Subscriber.ParticipantBuiltinTopicName = "DCPSParticipant"
static

The topic name of the DataReader in DomainParticipant.BuiltinSubscriber that provides information about participants discovered by another participant.

See Accessing Information on Entity Discovery

Property Documentation

◆ DefaultDataReaderQos

DataReaderQos Rti.Dds.Subscription.Subscriber.DefaultDataReaderQos
getset

Copies the default DataReaderQos values into the provided DataReaderQos instance.

The full documentation is available in the C API: DDS_Subscriber_get_default_datareader_qos

◆ Qos

SubscriberQos Rti.Dds.Subscription.Subscriber.Qos
getset

Gets or sets the subscriber QoS.

The full documentation is available in the C API: DDS_Subscriber_get_qos

◆ DomainParticipant

DomainParticipant Rti.Dds.Subscription.Subscriber.DomainParticipant
get

Returns the DomainParticipant to which this Subscriber belongs.

The full documentation is available in the C API: DDS_Subscriber_get_participant

◆ DataReaders

IEnumerable<AnyDataReader> Rti.Dds.Subscription.Subscriber.DataReaders
get

Retrieve all the DataReaders created from this Subscriber

The full documentation is available in the C API: DDS_Subscriber_get_all_datareaders

◆ DataOnReaders

DataOnReadersEventHandler Rti.Dds.Subscription.Subscriber.DataOnReaders
addremove

Event triggered when the Rti.Dds.Core.Status.StatusMask.DataOnReaders status changes on this Subscriber.

◆ SubscriptionMatched

SubscriptionMatchedEventHandler Rti.Dds.Subscription.Subscriber.SubscriptionMatched
addremove

Event triggered when the Rti.Dds.Core.Status.StatusMask.SubscriptionMatched status changes on any DataReader<T> created by this Subscriber for which this event is not being monitored.

◆ DataAvailable

DataAvailableEventHandler Rti.Dds.Subscription.Subscriber.DataAvailable
addremove

Event triggered when the Rti.Dds.Core.Status.StatusMask.DataAvailable status changes on any DataReader<T> created by this Subscriber for which this event is not being monitored.

◆ LivelinessChanged

LivelinessChangedEventHandler Rti.Dds.Subscription.Subscriber.LivelinessChanged
addremove

Event triggered when the Rti.Dds.Core.Status.StatusMask.LivelinessChanged status changes on any DataReader<T> created by this Subscriber for which this event is not being monitored.

◆ RequestedDeadlineMissed

RequestedDeadlineMissedEventHandler Rti.Dds.Subscription.Subscriber.RequestedDeadlineMissed
addremove

Event triggered when the Rti.Dds.Core.Status.StatusMask.RequestedDeadlineMissed status changes on any DataReader<T> created by this Subscriber for which this event is not being monitored.

◆ RequestedIncompatibleQos

RequestedIncompatibleQosEventHandler Rti.Dds.Subscription.Subscriber.RequestedIncompatibleQos
addremove

Event triggered when the Rti.Dds.Core.Status.StatusMask.RequestedIncompatibleQos status changes on any DataReader<T> created by this Subscriber for which this event is not being monitored.

◆ SampleLost

SampleLostEventHandler Rti.Dds.Subscription.Subscriber.SampleLost
addremove

Event triggered when the Rti.Dds.Core.Status.StatusMask.SampleLost status changes on any DataReader<T> created by this Subscriber for which this event is not being monitored.

◆ SampleRejected

SampleRejectedEventHandler Rti.Dds.Subscription.Subscriber.SampleRejected
addremove

Event triggered when the Rti.Dds.Core.Status.StatusMask.SampleRejected status changes on any DataReader<T> created by this Subscriber for which this event is not being monitored.