Getting list of published topics from within C++ code
I'm using the vicon_bridge node, which publishes a topic "vicon/<subject_name>/<segment_name>" for every subject and segment it finds. In this example, consider that it publishes the topics:
vicon/subject1/segment1 vicon/subject2/segment1
Is there a way, from within C++ code, to get a list of all "vicon/*" topics that are being published? Something like 'rostopic list' that can be used from within the code and can search on a topic "subdirectory"?