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

Method remove_topic

dds/InfoRepo/DCPS_IR_Domain.cpp:369–415  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

367}
368
369OpenDDS::DCPS::TopicStatus DCPS_IR_Domain::remove_topic(DCPS_IR_Participant* part,
370 DCPS_IR_Topic*& topic)
371{
372 DCPS_IR_Topic_Description* description = topic->get_topic_description();
373
374 if (description->remove_topic(topic) != 0) {
375 // An unknown error means that the description may still
376 // have the topic in its topic set. We can't remove it.
377 // The system is an inconsistent state!
378 throw OpenDDS::DCPS::Invalid_Topic();
379 }
380
381 if (description->get_number_topics() == 0) {
382 // Remove the topic description
383 if (remove_topic_description(description) != 0) {
384 // An unknown error means that the description may still
385 // have the topic in its topic set.
386 ACE_ERROR((LM_ERROR,
387 ACE_TEXT("(%P|%t) ERROR: Topic Description %C %C ")
388 ACE_TEXT("was not correctly removed from Domain %d"),
389 description->get_name(),
390 description->get_dataTypeName(),
391 id_));
392
393 }
394 }
395
396 // description variable is invalid after this point
397
398 if (part->remove_topic_reference(topic->get_id(), topic) != 0) {
399 OpenDDS::DCPS::RepoIdConverter part_converter(part->get_id());
400 OpenDDS::DCPS::RepoIdConverter topic_converter(topic->get_id());
401 ACE_ERROR((LM_ERROR,
402 ACE_TEXT("(%P|%t) ERROR: Domain %d Topic %C ")
403 ACE_TEXT("was not correctly removed from Participant %C"),
404 id_,
405 std::string(topic_converter).c_str(),
406 std::string(part_converter).c_str()));
407 }
408
409 // Dispose the BIT information
410 dispose_topic_bit(topic);
411
412 topic->release(true);
413 topic = 0;
414 return OpenDDS::DCPS::REMOVED;
415}
416
417int
418DCPS_IR_Domain::find_topic_description(

Callers 1

add_topic_iMethod · 0.45

Calls 7

get_number_topicsMethod · 0.80
get_dataTypeNameMethod · 0.80
get_topic_descriptionMethod · 0.45
get_nameMethod · 0.45
get_idMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected