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

Method copy_and_prepend

dds/DCPS/WriteDataContainer.cpp:1368–1420  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1366}
1367
1368void
1369WriteDataContainer::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
1423bool

Callers

nothing calls this directly

Calls 8

resend_data_expiredFunction · 0.85
rbeginMethod · 0.80
rendMethod · 0.80
filter_outMethod · 0.80
DataSampleElementClass · 0.70
get_handleMethod · 0.45
mallocMethod · 0.45
getValueMethod · 0.45

Tested by

no test coverage detected