You are here: Part 2: Core Concepts > Sending Data > Publishers

Publishers

An application that intends to publish information needs the following Entities: DomainParticipant, Topic, Publisher, and DataWriter. All Entities have a corresponding specialized Listener and a set of QosPolicies. A Listener is how Connext DDS notifies your application of status changes relevant to the Entity. The QosPolicies allow your application to configure the behavior and resources of the Entity.

Figure 1 shows how these Entities are related, as well as the methods defined for each Entity.

Figure 1 Publication Module

Publishers are used to perform the operations listed in . You can find more information about the operations by looking in the section listed under the Reference column. For details such as formal parameters and return codes, please see the API Reference HTML documentation.

Some operations cannot be used within a listener callback, see Restricted Operations in Listener Callbacks.

Publisher Operations

Working with ...

Operation

Description

Reference

DataWriters

begin_coherent_
changes

Indicates that the application will begin a coherent set of modifications.

Writing Coherent Sets of DDS Data Samples

create_datawriter

Creates a DataWriter that will belong to the Publisher.

Creating DataWriters

create_datawriter_
with_profile

Sets the DataWriter’s QoS based on a specified QoS profile.

copy_from_topic_qos

Copies relevant QosPolicies from a Topic into a DataWriterQoS structure.

Other Publisher QoS-Related Operations

DataWriters
cont'd

delete_contained_
entities

Deletes all of the DataWriters that were created by the Publisher.

Deleting Contained DataWriters

delete_datawriter

Deletes a DataWriter that belongs to the Publisher.

Deleting DataWriters

end_coherent_changes

Ends the coherent set initiated by begin_coherent_changes().

Writing Coherent Sets of DDS Data Samples

DataWriters
cont'd

get_all_datawriters

Retrieves all the DataWriters created from this Publisher.

Getting All DataWriters

get_default_
datawriter_qos

Copies the Publisher’s default DataWriterQoS values into a DataWriterQos structure.

Setting DataWriter QosPolicies

get_status_changes

Will always return 0 since there are no Statuses currently defined for Publishers.

Getting Status and Status Changes

lookup_datawriter

Retrieves a DataWriter previously created for a specific Topic.

Finding a Publisher’s Related DDS Entities

DataWriters
cont'd

set_default_datawriter_qos

Sets or changes the default DataWriterQos values.

Getting and Setting Default QoS for DataWriters

set_default_datawriter_
qos_with_profile

Sets or changes the default DataWriterQos values based on a QoS profile.

wait_for_
acknowledgments

Blocks until all data written by the Publisher’s reliable DataWriters are acknowledged by all matched reliable DataReaders, or until the a specified timeout duration, max_wait, elapses.

Waiting for Acknowledgments in a Publisher

is_sample_app_acknowledged

Indicates if a sample has been application-acknowledged by all the matching DataReaders that were alive when the sample was written.

If a DataReader does not enable application acknowledgment (by setting the ReliabilityQosPolicy's acknowledgment_kind to a value other than DDS_PROTOCOL_ACKNOWLEDGMENT_MODE), the sample is considered application-acknowledged for that DataReader.

Application Acknowledgment

Libraries and Profiles

get_default_library

Gets the Publisher’s default QoS profile library.

Getting and Setting the Publisher’s Default QoS Profile and Library

get_default_profile

Gets the Publisher’s default QoS profile.

get_default_profile_
library

Gets the library that contains the Publisher’s default QoS profile.

set_default_library

Sets the default library for a Publisher.

set_default_profile

Sets the default profile for a Publisher.

Participants

get_participant

Gets the DomainParticipant that was used to create the Publisher.

Finding a Publisher’s Related DDS Entities

Publishers

enable

Enables the Publisher.

Enabling DDS Entities

equals

Compares two Publisher’s QoS structures for equality.

Comparing QoS Values

get_qos

Gets the Publisher’s current QosPolicy settings. This is most often used in preparation for calling set_qos().

Setting Publisher QosPolicies

set_qos

Sets the Publisher’s QoS. You can use this operation to change the values for the Publisher’s QosPolicies. Note, however, that not all QosPolicies can be changed after the Publisher has been created.

set_qos_with_profile

Sets the Publisher’s QoS based on a specified QoS profile.

Publishers
cont'd

get_listener

Gets the currently installed Listener.

Setting Up PublisherListeners

set_listener

Sets the Publisher’s Listener. If you created the Publisher without a Listener, you can use this operation to add one later.

suspend_publications

Provides a hint that multiple data-objects within the Publisher are about to be written.Connext DDS does not currently use this hint.

Suspending and Resuming Publications

resume_publications

Reverses the action of suspend_publications().

© 2017 RTI