Getting all topic in a domain participant

2 posts / 0 new
Last post
Last seen: 8 months 1 week ago
Joined: 01/08/2020
Posts: 1
Getting all topic in a domain participant


I have run into some issues were I want to look up all topics in inside a domain. 

I have followed the How-To and been using dds::topic::discover_any_topic() to get a list of the instancehandlers. From here I get stuck, since I would like to use dds::topic::discover_topic_data(), but this throws Unsupported Error since since it only retrieves data about local topics. 

Running DDS 6. Can someone point me in the right direction or have a working example of how this can be done? 

Thanks in advance! 




irwin's picture
Last seen: 1 month 4 weeks ago
Joined: 08/14/2010
Posts: 42

 There is no direct API to do that. So your steps are as follows:
1- factory.get_participants
2- for each participant get_publishers and get_subscribers
3- For each publisher and subscriber get_all_datareaders and get_all_datawriters
4- For each datareader/datawriter get_topic
5- for topic get_the_type_name (ie message type), get_name ( ie topic name.).