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

Method end_coherent_changes

dds/DCPS/DataWriterImpl.cpp:2389–2441  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2387}
2388
2389void
2390DataWriterImpl::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

Callers

nothing calls this directly

Calls 9

send_controlMethod · 0.95
get_lockFunction · 0.85
get_db_lockFunction · 0.85
moveFunction · 0.85
swap_bytesMethod · 0.80
get_max_snFunction · 0.70
lockMethod · 0.45
getMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected