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

Method remove_publication

dds/InfoRepo/DCPSInfo_i.cpp:656–705  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

654}
655
656void TAO_DDS_DCPSInfo_i::remove_publication(
657 DDS::DomainId_t domainId,
658 const OpenDDS::DCPS::GUID_t& participantId,
659 const OpenDDS::DCPS::GUID_t& publicationId)
660{
661 ACE_GUARD(ACE_Recursive_Thread_Mutex, guard, this->lock_);
662
663 // Grab the domain.
664 DCPS_IR_Domain_Map::iterator where = this->domains_.find(domainId);
665
666 if (where == this->domains_.end()) {
667 throw OpenDDS::DCPS::Invalid_Domain();
668 }
669
670 // Grab the participant.
671 DCPS_IR_Participant* const partPtr = where->second->participant(participantId);
672 if (!partPtr) {
673 throw OpenDDS::DCPS::Invalid_Participant();
674 }
675
676 const bool in_cleanup =
677#ifdef DDS_HAS_MINIMUM_BIT
678 false;
679#else
680 in_cleanup_all_built_in_topics_;
681#endif
682
683 if (partPtr->remove_publication(publicationId) != 0) {
684 where->second->remove_dead_participants(in_cleanup);
685
686 // throw exception because the publication was not removed!
687 throw OpenDDS::DCPS::Invalid_Publication();
688 }
689
690 where->second->remove_dead_participants(in_cleanup);
691
692 if (um_ && partPtr->isOwner() && !partPtr->isBitPublisher()) {
693 Update::IdPath path(domainId, participantId, publicationId);
694 this->um_->destroy(path, Update::Actor, Update::DataWriter);
695
696 if (OpenDDS::DCPS::DCPS_debug_level > 4) {
697 OpenDDS::DCPS::RepoIdConverter converter(publicationId);
698 ACE_DEBUG((LM_DEBUG,
699 ACE_TEXT("(%P|%t) TAO_DDS_DCPSInfo_i::remove_publication: ")
700 ACE_TEXT("pushing deletion of publication %C in domain %d.\n"),
701 std::string(converter).c_str(),
702 domainId));
703 }
704 }
705}
706
707OpenDDS::DCPS::GUID_t TAO_DDS_DCPSInfo_i::reserve_subscription_id(DDS::DomainId_t domainId,
708 const OpenDDS::DCPS::GUID_t& participantId,

Callers 3

add_publicationMethod · 0.45
remove_by_ownerMethod · 0.45
processDeleteMethod · 0.45

Calls 7

isOwnerMethod · 0.80
isBitPublisherMethod · 0.80
findMethod · 0.45
endMethod · 0.45
participantMethod · 0.45
destroyMethod · 0.45

Tested by

no test coverage detected