| 131 | } |
| 132 | |
| 133 | int DCPS_IR_Subscription::remove_associated_publication(DCPS_IR_Publication* pub, |
| 134 | CORBA::Boolean sendNotify, |
| 135 | CORBA::Boolean notify_lost, |
| 136 | bool notify_both_side) |
| 137 | { |
| 138 | bool marked_dead = false; |
| 139 | |
| 140 | if (sendNotify) { |
| 141 | |
| 142 | if (participant_->is_alive() && this->participant_->isOwner()) { |
| 143 | try { |
| 144 | if (OpenDDS::DCPS::DCPS_debug_level > 0) { |
| 145 | OpenDDS::DCPS::RepoIdConverter sub_converter(id_); |
| 146 | OpenDDS::DCPS::RepoIdConverter pub_converter(pub->get_id()); |
| 147 | ACE_DEBUG((LM_DEBUG, |
| 148 | ACE_TEXT("(%P|%t) DCPS_IR_Subscription::remove_associated_publication:") |
| 149 | ACE_TEXT(" calling sub %C with pub %C\n"), |
| 150 | std::string(sub_converter).c_str(), |
| 151 | std::string(pub_converter).c_str() |
| 152 | )); |
| 153 | } |
| 154 | |
| 155 | OpenDDS::DCPS::WriterIdSeq idSeq(5); |
| 156 | idSeq.length(1); |
| 157 | idSeq[0] = pub->get_id(); |
| 158 | |
| 159 | reader_->remove_associations(idSeq, notify_lost); |
| 160 | |
| 161 | if (notify_both_side) { |
| 162 | pub->remove_associated_subscription(this, sendNotify, notify_lost); |
| 163 | } |
| 164 | |
| 165 | } catch (const CORBA::Exception& ex) { |
| 166 | if (OpenDDS::DCPS::DCPS_debug_level > 0) { |
| 167 | ex._tao_print_exception( |
| 168 | "(%P|%t) ERROR: Exception caught in DCPS_IR_Subscription::remove_associated_publication:"); |
| 169 | } |
| 170 | |
| 171 | participant_->mark_dead(); |
| 172 | marked_dead = true; |
| 173 | } |
| 174 | } |
| 175 | } |
| 176 | |
| 177 | int status = associations_.remove(pub); |
| 178 | |
| 179 | if (0 == status) { |
| 180 | if (OpenDDS::DCPS::DCPS_debug_level > 0) { |
| 181 | OpenDDS::DCPS::RepoIdConverter sub_converter(id_); |
| 182 | OpenDDS::DCPS::RepoIdConverter pub_converter(pub->get_id()); |
| 183 | ACE_DEBUG((LM_DEBUG, |
| 184 | ACE_TEXT("(%P|%t) DCPS_IR_Subscription::remove_associated_publication: ") |
| 185 | ACE_TEXT("subscription %C removed publication %C at %x.\n"), |
| 186 | std::string(sub_converter).c_str(), |
| 187 | std::string(pub_converter).c_str(), |
| 188 | pub)); |
| 189 | } |
| 190 |
no test coverage detected