RTI Connext C# API  6.1.2
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 newMask)
 Stop notifying of events not selected in the newMask 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...
 
- 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  newMask)
virtual

Stop notifying of events not selected in the newMask and remove their event handlers.

Parameters
newMaskSelects which events will continue to receive notifications. Events not included in the status mask will no longer be notified. Use StatusMask.None to remove all event handlers.
Warning
This method has no effect on a Publisher.

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

◆ 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

◆ Qos

PublisherQos Qos
getset

Gets or sets the publisher QoS.

The full documentation is available in the C API: DDS_Publisher_set_qos