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.
Working with ... |
Operation |
Description |
Reference |
DataWriters |
begin_coherent_ |
Indicates that the application will begin a coherent set of modifications. |
|
create_datawriter |
Creates a DataWriter that will belong to the Publisher. |
||
create_datawriter_ |
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. |
||
DataWriters |
delete_contained_ |
Deletes all of the DataWriters that were created by the Publisher. |
|
delete_datawriter |
Deletes a DataWriter that belongs to the Publisher. |
||
end_coherent_changes |
Ends the coherent set initiated by begin_coherent_changes(). |
||
DataWriters |
get_all_datawriters |
Retrieves all the DataWriters created from this Publisher. |
|
get_default_ |
Copies the Publisher’s default DataWriterQoS values into a DataWriterQos structure. |
||
get_status_changes |
Will always return 0 since there are no Statuses currently defined for Publishers. |
||
lookup_datawriter |
Retrieves a DataWriter previously created for a specific Topic. |
||
DataWriters |
set_default_datawriter_qos |
Sets or changes the default DataWriterQos values. |
|
set_default_datawriter_ |
Sets or changes the default DataWriterQos values based on a QoS profile. |
||
wait_for_ |
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. |
||
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. |
||
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_ |
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. |
|
Publishers |
enable |
Enables the Publisher. |
|
equals |
Compares two Publisher’s QoS structures for equality. |
||
get_qos |
Gets the Publisher’s current QosPolicy settings. This is most often used in preparation for calling set_qos(). |
||
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 |
get_listener |
Gets the currently installed Listener. |
|
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. |
||
resume_publications |
Reverses the action of suspend_publications(). |