Is there an API that will return the list of registered topics for a given domain participant to determine topics to delete at shutdown?
Thanks.
Mark.
Is there an API that will return the list of registered topics for a given domain participant to determine topics to delete at shutdown?
Thanks.
Mark.
Hi,
Did you mean Topics or Types? I ask because n DDS speak you 'create' Topics but 'register' types.
Unfortunately I do not think there is an operation to get all the created Topics. It is a good observation. We probably should add one...
The registered types you do need to delete because the TypePlugins are created as a singletons and any state the DomainParticipant saves related to registerd types is deleted when the DomainParticipant is deleted.
If all you want to get the Topics to delete them when you are sutting down, then you may be able to get a similar effect calling the delete_contained_entities operation on the DomainParticipant. This will delete everything the participant contains, including the Topics that it created.
Gerardo
I meant types. Is there an API to get a list of types that have been registered so that I can unregister them at shutdown?
Thanks
Mark
Hello Mark,
Right now that functionality does not exist. On platforms other than Windows, you can call participant->delete_contained_entities() and this will clean up all memory associated with the registered type. If you are running on Windows, you will see a memory leak at shutdown if you do not unregister the type. To prevent warnings about memory leaks, I have been storing a map of type names and their associated unregister functions so that I can unregister all types:
std::map<std::string,UnregisterInfo>_typeCleanupFunctions;
You can see the full source file here:
https://github.com/rticommunity/rticonnext-usecases/blob/master/VehicleTracking/ExampleCode/src/CommonInfrastructure/DDSCommunicator.h
Thank you,
Rose