| 1366 | } |
| 1367 | |
| 1368 | void |
| 1369 | WriteDataContainer::copy_and_prepend(SendStateDataSampleList& list, |
| 1370 | const SendStateDataSampleList& appended, |
| 1371 | const GUID_t& reader_id, |
| 1372 | const DDS::LifespanQosPolicy& lifespan, |
| 1373 | #ifndef OPENDDS_NO_CONTENT_FILTERED_TOPIC |
| 1374 | const OPENDDS_STRING& filterClassName, |
| 1375 | const FilterEvaluator* eval, |
| 1376 | const DDS::StringSeq& params, |
| 1377 | #endif |
| 1378 | ssize_t& max_resend_samples) |
| 1379 | { |
| 1380 | for (SendStateDataSampleList::const_reverse_iterator cur = appended.rbegin(); |
| 1381 | cur != appended.rend() && max_resend_samples; ++cur) { |
| 1382 | |
| 1383 | if (resend_data_expired(*cur, lifespan)) |
| 1384 | continue; |
| 1385 | |
| 1386 | #ifndef OPENDDS_NO_CONTENT_FILTERED_TOPIC |
| 1387 | if (eval && writer_->filter_out(*cur, filterClassName, *eval, params)) |
| 1388 | continue; |
| 1389 | #endif |
| 1390 | |
| 1391 | PublicationInstance_rch inst = cur->get_handle(); |
| 1392 | |
| 1393 | if (!inst) { |
| 1394 | // *cur is a control message, just skip it |
| 1395 | continue; |
| 1396 | } |
| 1397 | |
| 1398 | if (inst->durable_samples_remaining_ == 0) |
| 1399 | continue; |
| 1400 | --inst->durable_samples_remaining_; |
| 1401 | |
| 1402 | DataSampleElement* element = 0; |
| 1403 | ACE_NEW_MALLOC(element, |
| 1404 | static_cast<DataSampleElement*>( |
| 1405 | sample_list_element_allocator_.malloc( |
| 1406 | sizeof(DataSampleElement))), |
| 1407 | DataSampleElement(*cur)); |
| 1408 | |
| 1409 | element->set_num_subs(1); |
| 1410 | element->set_sub_id(0, reader_id); |
| 1411 | |
| 1412 | if (DCPS_debug_level > 9) { |
| 1413 | ACE_DEBUG((LM_DEBUG, "(%P|%t) WriteDataContainer::copy_and_prepend added seq# %q\n", |
| 1414 | cur->get_header().sequence_.getValue())); |
| 1415 | } |
| 1416 | |
| 1417 | list.enqueue_head(element); |
| 1418 | --max_resend_samples; |
| 1419 | } |
| 1420 | } |
| 1421 | |
| 1422 | #ifndef OPENDDS_NO_PERSISTENCE_PROFILE |
| 1423 | bool |
nothing calls this directly
no test coverage detected