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

Method remove_topic

dds/InfoRepo/DCPSInfo_i.cpp:325–372  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

323}
324
325OpenDDS::DCPS::TopicStatus TAO_DDS_DCPSInfo_i::remove_topic(
326 DDS::DomainId_t domainId,
327 const OpenDDS::DCPS::GUID_t& participantId,
328 const OpenDDS::DCPS::GUID_t& topicId)
329{
330 ACE_GUARD_RETURN(ACE_Recursive_Thread_Mutex, guard, this->lock_, OpenDDS::DCPS::INTERNAL_ERROR);
331
332 // Grab the domain.
333 DCPS_IR_Domain_Map::iterator where = this->domains_.find(domainId);
334
335 if (where == this->domains_.end()) {
336 throw OpenDDS::DCPS::Invalid_Domain();
337 }
338
339 // Grab the participant.
340 DCPS_IR_Participant* partPtr
341 = where->second->participant(participantId);
342
343 if (0 == partPtr) {
344 throw OpenDDS::DCPS::Invalid_Participant();
345 }
346
347 DCPS_IR_Topic* topic;
348
349 if (partPtr->find_topic_reference(topicId, topic) != 0) {
350 throw OpenDDS::DCPS::Invalid_Topic();
351 }
352
353 OpenDDS::DCPS::TopicStatus removedStatus = where->second->remove_topic(partPtr, topic);
354
355 if (this->um_
356 && (partPtr->isOwner() == true)
357 && (partPtr->isBitPublisher() == false)) {
358 Update::IdPath path(domainId, participantId, topicId);
359 this->um_->destroy(path, Update::Topic);
360
361 if (OpenDDS::DCPS::DCPS_debug_level > 4) {
362 OpenDDS::DCPS::RepoIdConverter converter(topicId);
363 ACE_DEBUG((LM_DEBUG,
364 ACE_TEXT("(%P|%t) TAO_DDS_DCPSInfo_i::remove_topic: ")
365 ACE_TEXT("pushing deletion of topic %C in domain %d.\n"),
366 std::string(converter).c_str(),
367 domainId));
368 }
369 }
370
371 return removedStatus;
372}
373
374OpenDDS::DCPS::GUID_t TAO_DDS_DCPSInfo_i::reserve_publication_id(DDS::DomainId_t domainId,
375 const OpenDDS::DCPS::GUID_t& participantId,

Callers 2

remove_all_dependentsMethod · 0.45
processDeleteMethod · 0.45

Calls 7

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

Tested by

no test coverage detected