List all topics on a domain

2 posts / 0 new
Last post
Offline
Last seen: 2 months 3 days ago
Joined: 02/08/2021
Posts: 6
List all topics on a domain

I have to return to this fight now.

I would like to list all the topics being published on a single domain.

I have set up some readers:

participantsDR = builtinSubscriber->lookup_datareader( "DCPSParticipant" );
publicationsDR = builtinSubscriber->lookup_datareader( "DCPSPublication" );
topicsDR = builtinSubscriber->lookup_datareader( "DCPSTopic" );
 
I am checking the status with
status = DR->get_statuscondition();
 
(yes, yes, yes its polling, its not doing lots of fancy stuff with waits)
 
But although I can tell how many other participants there are I cant find a way to see the topic - name, description or anything.
 
I prefer C or C++ but if any one actually has code that works I would be very grateful as I have no clue what else to try.
Keywords:
Howard's picture
Offline
Last seen: 5 days 18 hours ago
Joined: 11/29/2012
Posts: 177

Hmm, there is no such topic as "DCPSTopic".  There are only "DCPSPublication", "DCPSSubscription" and "DCPSParticipant".

Please see the article here w/example code:

https://community.rti.com/howto/detect-presence-domainparticipants-datawriters-and-datareaders-dds-domain

or here

https://community.rti.com/kb/how-can-i-detect-new-datawriters-and-datareaders-joining-domain

However, you will have to install a listener.  I don't believe that polling the status condition will give you anything since internally DDS is processing the incoming data and thus it's highly likely that the status will be cleared before your own code is able to check....which is why a listener is necessary.