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

Method remove_excess_durable

dds/DCPS/WriteDataContainer.cpp:939–978  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

937}
938
939void
940WriteDataContainer::remove_excess_durable()
941{
942 if (!max_durable_per_instance_)
943 return;
944
945 size_t n_released = 0;
946
947 for (PublicationInstanceMapType::iterator iter = instances_.begin();
948 iter != instances_.end();
949 ++iter) {
950
951 CORBA::Long durable_allowed = max_durable_per_instance_;
952 InstanceDataSampleList& instance_list = iter->second->samples_;
953
954 for (DataSampleElement* it = instance_list.tail(), *prev; it; it = prev) {
955 prev = InstanceDataSampleList::prev(it);
956
957 if (DataSampleHeader::test_flag(HISTORIC_SAMPLE_FLAG, it->get_sample())) {
958
959 if (durable_allowed) {
960 --durable_allowed;
961 } else {
962 instance_list.dequeue(it);
963 sent_data_.dequeue(it);
964 release_buffer(it);
965 ++n_released;
966 }
967 }
968 }
969 }
970
971 if (n_released && DCPS_debug_level > 9) {
972 ACE_DEBUG((LM_DEBUG,
973 ACE_TEXT("(%P|%t) WriteDataContainer::remove_excess_durable: ")
974 ACE_TEXT("domain %d topic %C publication %C %B samples removed ")
975 ACE_TEXT("from durable data.\n"), domain_id_, topic_name_,
976 LogGuid(publication_id_).c_str(), n_released));
977 }
978}
979
980
981DDS::ReturnCode_t

Callers

nothing calls this directly

Calls 5

LogGuidFunction · 0.85
get_sampleMethod · 0.80
dequeueMethod · 0.65
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected