ManagedIceObject missing a method to properly unsubscribe from ice storm topic
I am currently working on the PointCloudProcessor class in VisionX, which is derived from ManagedIceObject. (PointCloudProcessor -> Component -> ManagedIceObject)
The PointCloudProcessor fetches PointCloudProviders by topic subscription. Therefore, part of the procedure to connect to a PointCloudProvider uses ManagedIceObject's functionality and looks as follows:
void PointCloudProcessor::usingPointCloudProvider(std::string providerName)
{
...
// use PointCloud event topic
usingTopic(providerName + ".PointCloudListener");
...
}
Right now I am adding the feature to disconnect from a PointCloudProvider (or at least clean up proxy dependencies after the external shutdown of a provider so the whole plugin doesn't get disconnected by ArmarXManager). Therefore I want to unsubscribe from the topic to avoid getting topic messages if the provider comes online again in the future and I'm not using it. While I could technically do something like this:
void PointCloudProcessor::releasePointCloudProvider(std::string providerName)
{
...
this->getIceManager()->unsubscribeTopic(this->getProxy(), providerName + ".PointCloudListener");
...
}
I noticed that this is not the best approach, because the ManagedIceObject does the following during usingTopic:
void ManagedIceObject::usingTopic(const std::string& name)
{
...
// add dependency
connectivity.usedTopics.push_back(name);
...
}
TL;DR: I am missing a way to properly unsubscribe from a topic in ManagedIceObject.