| 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 | { |
no test coverage detected