| 353 | } |
| 354 | |
| 355 | int 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 | |
| 403 | int DCPS_IR_Participant::add_topic_reference(DCPS_IR_Topic* topic) |
| 404 | { |
no test coverage detected