Looking up Topic Descriptions

The lookup_topicdescription() operation allows you to access a locally created DDSTopicDescription based on the Topic’s name.

DDSTopicDescription* lookup_topicdescription(const char *topic_name)

DDSTopicDescription is the base class for Topics, MultiTopics1Multitopics are not supported. and ContentFilteredTopics. You can narrow the DDSTopicDescription returned from lookup_topicdescription() to a Topic or ContentFilteredTopic as appropriate.

Unlike find_topic() (see Finding a Topic), which logically returns a new Topic that must be independently deleted, this operation returns a reference to the original local object.

If no TopicDescription has been created yet with the given Topic name, this method will return a NULL value.

The DomainParticipant does not have to be enabled when you call lookup_topicdescription().

Note: It is not safe to create or delete a topic while another thread is calling lookup_topicdescription() for that same topic.

© 2018 RTI