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

Function find_or_create_sub

dds/FACE/FaceTSS.cpp:469–499  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

467 }
468
469 void find_or_create_sub(const DDS::SubscriberQos& qos,
470 const DDS::DomainParticipant_var& dp,
471 DDS::Subscriber_var& sub)
472 {
473 DDS::DomainParticipant_var temp_dp;
474 DDS::Subscriber_var temp_sub;
475
476 Entities::ConnIdToReceiverMap& readers = Entities::instance()->receivers_;
477 Entities::ConnIdToReceiverMap::iterator rdrIter = readers.begin();
478
479 while (rdrIter != readers.end()) {
480 temp_sub = rdrIter->second->dr->get_subscriber();
481 temp_dp = temp_sub->get_participant();
482 DDS::SubscriberQos temp_qos;
483 temp_sub->get_qos(temp_qos);
484 if (dp->get_domain_id() == temp_dp->get_domain_id() &&
485 temp_qos == qos) {
486 if (OpenDDS::DCPS::DCPS_debug_level > 3) {
487 ACE_DEBUG((LM_DEBUG, "(%P|%t) find_or_create_sub - found existing subscriber in receivers\n"));
488 }
489 sub = temp_sub;
490 return;
491 } else {
492 ++rdrIter;
493 }
494 }
495 if (OpenDDS::DCPS::DCPS_debug_level > 3) {
496 ACE_DEBUG((LM_DEBUG, "(%P|%t) find_or_create_sub - created new subscriber\n"));
497 }
498 sub = dp->create_subscriber(qos, 0, 0);
499 }
500
501 bool cleanup_opendds_publisher(const DDS::Publisher_var pub)
502 {

Callers 1

create_opendds_entitiesFunction · 0.85

Calls 8

instanceFunction · 0.85
beginMethod · 0.45
endMethod · 0.45
get_subscriberMethod · 0.45
get_participantMethod · 0.45
get_qosMethod · 0.45
get_domain_idMethod · 0.45
create_subscriberMethod · 0.45

Tested by

no test coverage detected