MCPcopy Create free account
hub / github.com/OpenDDS/OpenDDS / remove_subscription

Method remove_subscription

dds/InfoRepo/DCPS_IR_Participant.cpp:355–401  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

353}
354
355int DCPS_IR_Participant::remove_subscription(OpenDDS::DCPS::GUID_t subId)
356{
357 DCPS_IR_Subscription_Map::iterator where = this->subscriptions_.find(subId);
358
359 if (where != this->subscriptions_.end()) {
360 DCPS_IR_Topic* topic = where->second->get_topic();
361 topic->remove_subscription_reference(where->second.get());
362
363 if (0 != where->second->remove_associations(false)) {
364 // N.B. As written today, this branch will never be taken.
365 OpenDDS::DCPS::RepoIdConverter part_converter(id_);
366 OpenDDS::DCPS::RepoIdConverter sub_converter(subId);
367 ACE_ERROR((LM_ERROR,
368 ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Participant::remove_subscription: ")
369 ACE_TEXT("participant %C unable to remove associations from subscription %C\n"),
370 std::string(part_converter).c_str(),
371 std::string(sub_converter).c_str()));
372 return -1;
373 }
374
375 this->domain_->dispose_subscription_bit(where->second.get());
376 topic->release(false);
377 this->subscriptions_.erase(where);
378
379 if (OpenDDS::DCPS::DCPS_debug_level > 0) {
380 OpenDDS::DCPS::RepoIdConverter part_converter(id_);
381 OpenDDS::DCPS::RepoIdConverter sub_converter(subId);
382 ACE_DEBUG((LM_DEBUG,
383 ACE_TEXT("(%P|%t) DCPS_IR_Participant::remove_subscription: ")
384 ACE_TEXT("participant %C removed subscription %C.\n"),
385 std::string(part_converter).c_str(),
386 std::string(sub_converter).c_str()));
387 }
388
389 return 0;
390
391 } else {
392 OpenDDS::DCPS::RepoIdConverter part_converter(id_);
393 OpenDDS::DCPS::RepoIdConverter sub_converter(subId);
394 ACE_ERROR((LM_ERROR,
395 ACE_TEXT("(%P|%t) ERROR: DCPS_IR_Participant::remove_subscription: ")
396 ACE_TEXT("participant %C unable to remove subscription %C.\n"),
397 std::string(part_converter).c_str(),
398 std::string(sub_converter).c_str()));
399 return -1;
400 }
401}
402
403int DCPS_IR_Participant::add_topic_reference(DCPS_IR_Topic* topic)
404{

Callers 4

add_subscriptionMethod · 0.45
DCPSInfo_i.cppFile · 0.45
remove_by_ownerMethod · 0.45
processDeleteMethod · 0.45

Calls 9

findMethod · 0.45
endMethod · 0.45
get_topicMethod · 0.45
getMethod · 0.45
remove_associationsMethod · 0.45
releaseMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected