An application that intends to subscribe to information needs the following Entities: DomainParticipant, Topic, Subscriber, and DataReader. All Entities have a corresponding specialized Listener and a set of QosPolicies. The 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.
For more information, see Creating Subscribers Explicitly vs. Implicitly.
The UML diagram in Figure 1 shows how these Entities are related as well as the methods defined for each Entity.
Subscribers are used to perform the operations listed in Subscriber Operations. For details such as formal parameters and return codes, please see the API Reference HTML documentation. Otherwise, you can find more information about the operations by looking in the section listed under the Reference column.
Note: Some operations cannot be used within a listener callback, see Restricted Operations in Listener Callbacks.
Working with ... |
Operation |
Description |
|
DataReaders |
begin_access |
Indicates that the application is about to access the DDS data samples in the DataReaders of the Subscriber. |
|
create_datareader |
Creates a DataReader. |
||
create_datareader_ |
Creates a DataReader with QoS from a specified QoS profile. |
||
copy_from_topic_qos |
Copies relevant QosPolicies from a Topic into a DataReaderQoS structure. |
||
DataReaders |
delete_contained_ |
Deletes all the DataReaders that were created by the Subscriber. Also deletes the corresponding ReadConditions created by the contained DataReaders. |
|
delete_datareader |
Deletes a specific DataReader. |
||
end_access |
Indicates that the application is done accessing the DDS data samples in the DataReaders of the Subscriber. |
||
get_all_datareaders |
Retrieves all the DataReaders created from this Subscriber. |
||
get_datareaders |
Returns a list of DataReaders that contain DDS samples with the specified sample_states, view_states and instance_states. |
||
get_default_datareader_qos |
Copies the Subscriber’s default DataReaderQos values into a DataReaderQos structure. |
||
DataReaders |
get_status_changes |
Gets all status changes. |
|
lookup_datareader |
Retrieves a DataReader previously created for a specific Topic. |
||
notify_datareaders |
Invokes the on_data_available() operation for attached Listeners of DataReaders that have new DDS data samples. |
||
set_default_datareader_qos |
Sets or changes the Subscriber’s default DataReaderQoS values. |
||
Libraries |
get_default_library |
Gets the Subscriber’s default QoS profile library. |
Getting and Settings Subscriber’s Default QoS Profile and Library |
get_default_profile |
Gets the Subscriber’s default QoS profile. |
||
get_default_profile_ |
Gets the library that contains the Subscriber’s default QoS profile. |
||
set_default_library |
Sets the default library for a Subscriber. |
||
set_default_profile |
Sets the default profile for a Subscriber. |
||
Participants |
get_participant |
Gets the Subscriber’s DomainParticipant. |
|
Subscribers |
enable |
Enables the Subscriber. |
|
equals |
Compares two Subscriber’s QoS structures for equality. |
||
get_listener |
Gets the currently installed Listener. |
||
get_qos |
Gets the Subscriber’s current QosPolicy settings. This is most often used in preparation for calling set_qos. |
||
set_listener |
Sets the Subscriber’s Listener. If you created the Subscriber without a Listener, you can use this operation to add one later. |
||
set_qos |
Sets the Subscriber’s QoS. You can use this operation to change the values for the Subscriber’s QosPolicies. Note, however, that not all QosPolicies can be changed after the Subscriber has been created. |
||
set_qos_with_profile |
Sets the Subscriber’s QoS based on a QoS profile. |
© 2017 RTI