| 2387 | } |
| 2388 | |
| 2389 | void |
| 2390 | DataWriterImpl::end_coherent_changes(const GroupCoherentSamples& group_samples) |
| 2391 | { |
| 2392 | // PublisherImpl::pi_lock_ should be held. |
| 2393 | ACE_GUARD(ACE_Recursive_Thread_Mutex, |
| 2394 | guard, |
| 2395 | get_lock()); |
| 2396 | |
| 2397 | CoherentChangeControl end_msg; |
| 2398 | end_msg.coherent_samples_.num_samples_ = this->coherent_samples_; |
| 2399 | end_msg.coherent_samples_.last_sample_ = get_max_sn(); |
| 2400 | |
| 2401 | RcHandle<PublisherImpl> publisher = this->publisher_servant_.lock(); |
| 2402 | |
| 2403 | if (publisher) { |
| 2404 | end_msg.group_coherent_ |
| 2405 | = publisher->qos_.presentation.access_scope == DDS::GROUP_PRESENTATION_QOS; |
| 2406 | } |
| 2407 | |
| 2408 | if (publisher && end_msg.group_coherent_) { |
| 2409 | end_msg.publisher_id_ = publisher->publisher_id_; |
| 2410 | end_msg.group_coherent_samples_ = group_samples; |
| 2411 | } |
| 2412 | |
| 2413 | Message_Block_Ptr data( |
| 2414 | new ACE_Message_Block( |
| 2415 | end_msg.get_max_serialized_size(), |
| 2416 | ACE_Message_Block::MB_DATA, |
| 2417 | 0, // cont |
| 2418 | 0, // data |
| 2419 | 0, // alloc_strategy |
| 2420 | get_db_lock())); |
| 2421 | |
| 2422 | Serializer serializer(data.get(), Encoding::KIND_UNALIGNED_CDR, |
| 2423 | this->swap_bytes()); |
| 2424 | |
| 2425 | serializer << end_msg; |
| 2426 | |
| 2427 | DataSampleHeader header; |
| 2428 | Message_Block_Ptr control( |
| 2429 | create_control_message(END_COHERENT_CHANGES, header, OPENDDS_MOVE_NS::move(data), |
| 2430 | SystemTimePoint::now().to_idl_struct())); |
| 2431 | |
| 2432 | this->coherent_ = false; |
| 2433 | this->coherent_samples_ = 0; |
| 2434 | |
| 2435 | guard.release(); |
| 2436 | if (this->send_control(header, OPENDDS_MOVE_NS::move(control)) == SEND_CONTROL_ERROR) { |
| 2437 | ACE_ERROR((LM_ERROR, |
| 2438 | ACE_TEXT("(%P|%t) ERROR: DataWriterImpl::end_coherent_changes:") |
| 2439 | ACE_TEXT(" unable to send END_COHERENT_CHANGES control message!\n"))); |
| 2440 | } |
| 2441 | } |
| 2442 | |
| 2443 | #endif // OPENDDS_NO_OBJECT_MODEL_PROFILE |
| 2444 |
nothing calls this directly
no test coverage detected