| 937 | } |
| 938 | |
| 939 | void |
| 940 | WriteDataContainer::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 | |
| 981 | DDS::ReturnCode_t |
nothing calls this directly
no test coverage detected