Navigating Relationships Among Entities

Finding Matching Publications

The following DataReader operations can be used to get information about the DataWriters that will send data to this DataReader.

The get_matched_publications() operation will return a sequence of handles to matched DataWriters. You can use these handles in the get_matched_publication_data() method to get information about the DataWriter such as the values of its QosPolicies.

Note that DataWriter that have been ignored using the DomainParticipant’s ignore_publication() operation are not considered to be matched even if the DataWriter has the same Topic and compatible QosPolicies. Thus, they will not be included in the list of DataWriters returned by get_matched_publications(). See Ignoring Publications and Subscriptions for more on ignore_publication().

You can also get the DATA_READER PROTOCOL_STATUS for matching publications with get_matched_publication_datareader_protocol_status() (see DATA_READER_PROTOCOL_STATUS).

Note:

See also: Finding the Matching Publication’s ParticipantBuiltinTopicData

Finding the Matching Publication’s ParticipantBuiltinTopicData

get_matched_publication_participant_data() allows you to get the DDS_ParticipantBuiltinTopicData (see Participant Built-in Topic’s Data Type (DDS_ParticipantBuiltinTopicData)) of a matched publication using a publication handle.

This operation retrieves the information on a discovered DomainParticipant associated with the publication that is currently matching with the DataReader.

The publication handle passed into this operation must correspond to a publication currently associated with the DataReader. Otherwise, the operation will fail with RETCODE_BAD_PARAMETER. The operation may also fail with RETCODE_PRECONDITION_NOT_MET if the publication handle corresponds to the same DomainParticipant to which the DataReader belongs.

Use get_matched_publications() (see Finding Matching Publications) to find the publications that are currently matched with the DataReader.

Note: This operation does not retrieve the ParticipantBuiltinTopicData_property. This information is available through the on_data_available() callback (if a DataReaderListener is installed on the PublicationBuiltinTopicDataDataReader.

Finding a DataReader’s Related Entities

These DataReader operations are useful for obtaining a handle to various related entities:

The get_subscriber() operation returns the Subscriber that created the DataReader. get_topicdescription() returns the Topic with which the DataReader is associated.

Looking Up an Instance Handle

Some operations, such as read_instance() and take_instance(), take an instance_handle parameter. If you need to get such as handle, you can call the lookup_instance() operation, which takes an instance as a parameter and returns a handle to that instance.

Getting the Key Value for an Instance

If you have a handle to a data-instance, you can use the FooDataReader’s get_key_value() operation to retrieve the key for that instance. The value of the key is decomposed into its constituent fields and returned in a Foo structure. For information on keys and keyed data types, please see DDS Samples, Instances, and Keys.

© 2018 RTI