30. 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 notifies your application of status changes relevant to the Entity. The QosPolicies allow your application to configure the behavior and resources of the Entity.

  • A DomainParticipant defines the DDS domain in which the information will be made available.
  • A Topic defines the name under which the data will be published, as well as the type (format) of the data itself.
  • An application writes data using a DataWriter. The DataWriter is bound at creation time to a Topic, thus specifying the name under which the DataWriter will publish the data and the type associated with the data. The application uses the DataWriter’s write() operation to indicate that a new value of the data is available for dissemination.
  • A Publisher manages the activities of several DataWriters. The Publisher determines when the data is actually sent to other applications. Depending on the settings of various QosPolicies of the Publisher and DataWriter, data may be buffered to be sent with the data of other DataWriters or not sent at all. By default, the data is sent as soon as the DataWriter’s write() function is called.
  • You may have multiple Publishers, each managing a different set of DataWriters, or you may choose to use one Publisher for all your DataWriters.

    For more information, see 30.1 Creating Publishers Explicitly vs. Implicitly.

Figure 30.1: Publication Module shows how these Entities are related, as well as the methods defined for each Entity.

Figure 30.1: Publication Module

Publishers are used to perform the operations listed in Table 30.1 Publisher Operations. 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 15.8.8.1 Restricted Operations in Listener Callbacks.

Table 30.1 Publisher Operations

Working with ...

Operation

Description

Reference

DataWriters

begin_coherent_
changes

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

31.10 Writing Coherent Sets of DDS Data Samples

create_datawriter

Creates a DataWriter that will belong to the Publisher.

31.1 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.

30.4.6 Other Publisher QoS-Related Operations

DataWriters
cont'd

delete_contained_
entities

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

30.3.1 Deleting Contained DataWriters

delete_datawriter

Deletes a DataWriter that belongs to the Publisher.

31.3 Deleting DataWriters

end_coherent_changes

Ends the coherent set initiated by begin_coherent_changes().

31.10 Writing Coherent Sets of DDS Data Samples

DataWriters
cont'd

get_all_datawriters

Retrieves all the DataWriters created from this Publisher.

31.2 Getting All DataWriters

get_default_
datawriter_qos

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

31.15 Setting DataWriter QosPolicies

get_status_changes

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

15.4 Getting Status and Status Changes

lookup_datawriter

Retrieves a DataWriter previously created for a specific Topic.

30.6 Finding a Publisher’s Related DDS Entities

DataWriters
cont'd

set_default_datawriter_qos

Sets or changes the default DataWriterQos values.

30.4.5 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.

30.7 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.

31.12 Application Acknowledgment

Libraries and Profiles

get_default_library

Gets the Publisher’s default QoS profile library.

30.4.4 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.

30.6 Finding a Publisher’s Related DDS Entities

Publishers

enable

Enables the Publisher.

15.2 Enabling DDS Entities

equals

Compares two Publisher’s QoS structures for equality.

30.4.2 Comparing QoS Values

get_qos

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

30.4 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.

30.5 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 does not currently use this hint.

30.9 Suspending and Resuming Publications

resume_publications

Reverses the action of suspend_publications().