| 253 | } |
| 254 | |
| 255 | void |
| 256 | RecorderImpl::add_association(const WriterAssociation& writer, |
| 257 | bool active) |
| 258 | { |
| 259 | if (DCPS_debug_level >= 4) { |
| 260 | ACE_DEBUG((LM_DEBUG, "(%P|%t) RecorderImpl::add_association: " |
| 261 | "bit %d local %C remote %C\n", |
| 262 | is_bit_, |
| 263 | LogGuid(subscription_id_).c_str(), |
| 264 | LogGuid(writer.writerId).c_str())); |
| 265 | } |
| 266 | |
| 267 | // |
| 268 | // This block prevents adding associations to deleted readers. |
| 269 | // Presumably this is a "good thing(tm)". |
| 270 | // |
| 271 | // if (entity_deleted_) { |
| 272 | // if (DCPS_debug_level >= 1) |
| 273 | // ACE_DEBUG((LM_DEBUG, |
| 274 | // ACE_TEXT("(%P|%t) RecorderImpl::add_association") |
| 275 | // ACE_TEXT(" This is a deleted datareader, ignoring add.\n"))); |
| 276 | // |
| 277 | // return; |
| 278 | // } |
| 279 | |
| 280 | // |
| 281 | // We do the following while holding the publication_handle_lock_. |
| 282 | // |
| 283 | { |
| 284 | ACE_GUARD(ACE_Recursive_Thread_Mutex, guard, publication_handle_lock_); |
| 285 | |
| 286 | // |
| 287 | // For each writer in the list of writers to associate with, we |
| 288 | // create a WriterInfo and a WriterStats object and store them in |
| 289 | // our internal maps. |
| 290 | // |
| 291 | { |
| 292 | ACE_WRITE_GUARD(ACE_RW_Thread_Mutex, write_guard, writers_lock_); |
| 293 | |
| 294 | const GUID_t& writer_id = writer.writerId; |
| 295 | RcHandle<WriterInfo> info (make_rch<WriterInfo>(rchandle_from<WriterInfoListener>(this), writer_id, writer.writerQos, qos_.liveliness.lease_duration)); |
| 296 | /*std::pair<WriterMapType::iterator, bool> bpair =*/ |
| 297 | writers_.insert( |
| 298 | // This insertion is idempotent. |
| 299 | WriterMapType::value_type( |
| 300 | writer_id, |
| 301 | info)); |
| 302 | // statistics_.insert( |
| 303 | // StatsMapType::value_type( |
| 304 | // writer_id, |
| 305 | // WriterStats( |
| 306 | // raw_latency_buffer_size_, |
| 307 | // raw_latency_buffer_type_))); |
| 308 | |
| 309 | // if (DCPS_debug_level > 4) { |
| 310 | // GuidConverter converter(writer_id); |
| 311 | // ACE_DEBUG((LM_DEBUG, |
| 312 | // "(%P|%t) RecorderImpl::add_association: " |
no test coverage detected