RTI Connext C# API  7.1.0
Publisher Class Reference

A publisher is the object responsible for the actual dissemination of publications. More...

Inheritance diagram for Publisher:
Entity

Public Member Functions

DataWriter< T > LookupDataWriter< T > (string topicName)
 Retrieves a writer for a specific topic. More...
 
AnyDataWriter LookupDataWriter (string topicName)
 Retrieves a writer for a specific topic. More...
 
AnyDataWriter LookupDataWriterByName (string writerName)
 Retrieves a writer by its name More...
 
DataWriter< T > CreateDataWriter< T > (Topic< T > topic)
 Creates a DataWriter<T> that will be attached and belong to this publisher. More...
 
DataWriter< T > CreateDataWriter< T > (Topic< T > topic, DataWriterQos qos)
 Creates a DataWriter<T> that will be attached and belong to this publisher. More...
 
DataWriter< T > CreateDataWriter< T > (Topic< T > topic, Action< DataWriter< T >> preEnableAction)
 Creates a DataWriter<T> that will be attached and belong to this publisher. More...
 
DataWriter< T > CreateDataWriter< T > (Topic< T > topic, DataWriterQos qos, Action< DataWriter< T >> preEnableAction)
 Creates a DataWriter<T> that will be attached and belong to this publisher. More...
 
AnyDataWriter CreateDataWriter (Topics.IAnyTopic topic, DataWriterQos qos)
 Creates a DataWriter that will be attached and belong to this Publisher, without knowing the type at compile time. More...
 
AnyDataWriter CreateDataWriter (Topics.IAnyTopic topic)
 Creates a DataWriter that will be attached and belong to this Publisher, without knowing the type at compile time. More...
 
void DisposeContainedEntities ()
 Disposes all the entities that were created by this Publisher. More...
 
override void ResetEvents (StatusMask eventsToRemove=StatusMask.All)
 Stop notifying of certain events and remove their event handlers More...
 
CoherentSet BeginCoherentChanges ()
 Indicates that a coherent set of modifications is going to be performed using DataWriter<T> objects belonging to this publisher. More...
 
void EndCoherentChanges ()
 Ends a coherent set of changes (alternative to CoherentSet.Dispose) More...
 
SuspendedPublication SuspendPublications ()
 Indicates that the application is about to make multiple modifications using DataWriter<T> objects belonging this publisher. More...
 
void ResumePublications ()
 Indicates that the application has completed the multiple changes initiated by the previous call to SuspendPublications (alternative to SuspendedPublication.Dispose) More...
 
void WaitForAcknowledgments (Duration maxWait)
 Blocks the calling thread until all data written by the Publisher's reliable DataWriters is acknowledged, or until timeout expires. More...
 
void WaitForAsynchronousPublishing (Duration maxWait)
 Blocks the calling thread until asynchronous sending is complete. 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

DataWriterQos DefaultDataWriterQos [get, set]
 Get or change the default DataWriterQos used by More...
 
IEnumerable< AnyDataWriterDataWriters [get]
 Retrieve all the writers created by this publisher More...
 
PublisherQos Qos [get, set]
 Gets or sets the publisher QoS. More...
 
DomainParticipant DomainParticipant [get]
 Returns the DomainParticipant to which this publisher belongs. More...
 
LivelinessLostEventHandler LivelinessLost
 Event triggered when the Rti.Dds.Core.Status.StatusMask.LivelinessLost status changes on any DataWriter<T> created by this Publisher for which this event is not being monitored. More...
 
OfferedIncompatibleQosEventHandler OfferedIncompatibleQos
 Event triggered when the Rti.Dds.Core.Status.StatusMask.OfferedIncompatibleQos status changes on any DataWriter<T> created by this Publisher for which this event is not being monitored. More...
 
OfferedDeadlineMissedEventHandler OfferedDeadlineMissed
 Event triggered when the Rti.Dds.Core.Status.StatusMask.OfferedDeadlineMissed status changes on any DataWriter<T> created by this Publisher for which this event is not being monitored. More...
 
PublicationMatchedEventHandler PublicationMatched
 Event triggered when the Rti.Dds.Core.Status.StatusMask.PublicationMatched status changes on any DataWriter<T> created by this Publisher for which this event is not being monitored. More...
 
ReliableReaderActivityChangedEventHandler ReliableReaderActivityChanged
 Event triggered when the Rti.Dds.Core.Status.StatusMask.ReliableReaderActivityChanged status changes on any DataWriter<T> created by this Publisher for which this event is not being monitored. More...
 
ReliableWriterCacheChangedEventHandler ReliableWriterCacheChanged
 Event triggered when the Rti.Dds.Core.Status.StatusMask.ReliableWriterCacheChanged status changes on any DataWriter<T> created by this Publisher for which this event is not being monitored. More...
 
ServiceRequestAcceptedEventHandler ServiceRequestAccepted
 Event triggered when the Rti.Dds.Core.Status.StatusMask.ServiceRequestAccepted status changes on any DataWriter<T> created by this Publisher for which this event is not being monitored. More...
 
ApplicationAcknowledgementReceivedEventHandler ApplicationAcknowledgementReceived
 Event triggered when the Rti.Dds.Core.Status.StatusMask.DataWriterApplicationAcknowledgementReceived status changes on any DataWriter<T> created by this Publisher for which this event is not being monitored. More...
 
InstanceReplacedEventHandler InstanceReplaced
 Event triggered when the Rti.Dds.Core.Status.StatusMask.DataWriterInstanceReplaced status changes on any DataWriter<T> created by this Publisher for which this event is not being monitored. More...
 
SampleRemovedEventHandler SampleRemoved
 Event triggered when the Rti.Dds.Core.Status.StatusMask.DataWriterSampleRemoved status changes on any DataWriter<T> created by this Publisher for which this event is not being monitored. 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

A publisher is the object responsible for the actual dissemination of publications.

The full documentation is available in the C API: DDS_Publisher

Member Function Documentation

◆ BeginCoherentChanges()

CoherentSet BeginCoherentChanges ( )

Indicates that a coherent set of modifications is going to be performed using DataWriter<T> objects belonging to this publisher.

Returns
An object whose disposal indicates the end of the coherent set
using (publisher.BeginCoherentChanges())
{
writer1.Write(sample1);
writer1.Write(sample2);
writer2.Write(sample3); // writer1 and writer2 belong to publisher
} // end of coherent set

The full documentation is available in the C API: DDS_Publisher_begin_coherent_changes

◆ CreateDataWriter() [1/2]

AnyDataWriter CreateDataWriter ( Topics.IAnyTopic  topic)

Creates a DataWriter that will be attached and belong to this Publisher, without knowing the type at compile time.

◆ CreateDataWriter() [2/2]

AnyDataWriter CreateDataWriter ( Topics.IAnyTopic  topic,
DataWriterQos  qos 
)

Creates a DataWriter that will be attached and belong to this Publisher, without knowing the type at compile time.

◆ CreateDataWriter< T >() [1/4]

DataWriter<T> CreateDataWriter< T > ( Topic< T >  topic)

Creates a DataWriter<T> that will be attached and belong to this publisher.

The full documentation is available in the C API: DDS_Publisher_create_datawriter

◆ CreateDataWriter< T >() [2/4]

DataWriter<T> CreateDataWriter< T > ( Topic< T >  topic,
Action< DataWriter< T >>  preEnableAction 
)

Creates a DataWriter<T> that will be attached and belong to this publisher.

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

◆ CreateDataWriter< T >() [3/4]

DataWriter<T> CreateDataWriter< T > ( Topic< T >  topic,
DataWriterQos  qos 
)

Creates a DataWriter<T> that will be attached and belong to this publisher.

The full documentation is available in the C API: DDS_Publisher_create_datawriter

◆ CreateDataWriter< T >() [4/4]

DataWriter<T> CreateDataWriter< T > ( Topic< T >  topic,
DataWriterQos  qos,
Action< DataWriter< T >>  preEnableAction 
)

Creates a DataWriter<T> that will be attached and belong to this publisher.

Parameters
topicThe Topic<T> that the writer will be associated with.
qosThe quality of service
preEnableActionAn action that allows adding handlers to writer events before the writer is enabled.

◆ DisposeContainedEntities()

void DisposeContainedEntities ( )

Disposes all the entities that were created by this Publisher.

The full documentation is available in the C API: DDS_Publisher_delete_contained_entities

◆ EndCoherentChanges()

void EndCoherentChanges ( )

Ends a coherent set of changes (alternative to CoherentSet.Dispose)

The full documentation is available in the C API: DDS_Publisher_end_coherent_changes

◆ LookupDataWriter()

AnyDataWriter LookupDataWriter ( string  topicName)

Retrieves a writer for a specific topic.

Returns
The writer if it exists or null if it doesn't

The full documentation is available in the C API: DDS_Publisher_lookup_datawriter

◆ LookupDataWriter< T >()

DataWriter<T> LookupDataWriter< T > ( string  topicName)

Retrieves a writer for a specific topic.

Returns
The writer if it exists or null if it doesn't

The full documentation is available in the C API: DDS_Publisher_lookup_datawriter

◆ LookupDataWriterByName()

AnyDataWriter LookupDataWriterByName ( string  writerName)

Retrieves a writer by its name

The full documentation is available in the C API: DDS_Publisher_lookup_datawriter_by_name

◆ ResetEvents()

override void ResetEvents ( StatusMask  eventsToRemove = StatusMask.All)
virtual

Stop notifying of certain events and remove their event handlers

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

Implements Entity.

◆ ResumePublications()

void ResumePublications ( )

Indicates that the application has completed the multiple changes initiated by the previous call to SuspendPublications (alternative to SuspendedPublication.Dispose)

The full documentation is available in the C API: DDS_Publisher_resume_publications

◆ SuspendPublications()

SuspendedPublication SuspendPublications ( )

Indicates that the application is about to make multiple modifications using DataWriter<T> objects belonging this publisher.

Returns
An object whose disposal indicates the end of the suspension

The full documentation is available in the C API: DDS_Publisher_suspend_publications

◆ WaitForAcknowledgments()

void WaitForAcknowledgments ( Duration  maxWait)

Blocks the calling thread until all data written by the Publisher's reliable DataWriters is acknowledged, or until timeout expires.

The full documentation is available in the C API: DDS_Publisher_wait_for_acknowledgments

◆ WaitForAsynchronousPublishing()

void WaitForAsynchronousPublishing ( Duration  maxWait)

Blocks the calling thread until asynchronous sending is complete.

The full documentation is available in the C API: DDS_Publisher_wait_for_asynchronous_publishing

Property Documentation

◆ ApplicationAcknowledgementReceived

ApplicationAcknowledgementReceivedEventHandler ApplicationAcknowledgementReceived
addremove

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

◆ DataWriters

IEnumerable<AnyDataWriter> DataWriters
get

Retrieve all the writers created by this publisher

The full documentation is available in the C API: DDS_Publisher_get_all_datawriters

◆ DefaultDataWriterQos

DataWriterQos DefaultDataWriterQos
getset

Get or change the default DataWriterQos used by

The full documentation is available in the C API: DDS_Publisher_get_default_datawriter_qos

◆ DomainParticipant

Returns the DomainParticipant to which this publisher belongs.

The full documentation is available in the C API: DDS_Publisher_get_participant

◆ InstanceReplaced

InstanceReplacedEventHandler InstanceReplaced
addremove

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

◆ LivelinessLost

LivelinessLostEventHandler LivelinessLost
addremove

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

◆ OfferedDeadlineMissed

OfferedDeadlineMissedEventHandler OfferedDeadlineMissed
addremove

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

◆ OfferedIncompatibleQos

OfferedIncompatibleQosEventHandler OfferedIncompatibleQos
addremove

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

◆ PublicationMatched

PublicationMatchedEventHandler PublicationMatched
addremove

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

◆ Qos

PublisherQos Qos
getset

Gets or sets the publisher QoS.

The full documentation is available in the C API: DDS_Publisher_set_qos

◆ ReliableReaderActivityChanged

ReliableReaderActivityChangedEventHandler ReliableReaderActivityChanged
addremove

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

◆ ReliableWriterCacheChanged

ReliableWriterCacheChangedEventHandler ReliableWriterCacheChanged
addremove

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

◆ SampleRemoved

SampleRemovedEventHandler SampleRemoved
addremove

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

◆ ServiceRequestAccepted

ServiceRequestAcceptedEventHandler ServiceRequestAccepted
addremove

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