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

Function resend_data_expired

dds/DCPS/WriteDataContainer.cpp:36–66  ·  view source on GitHub ↗

* @todo Refactor this code and DataReaderImpl::data_expired() to * a common function. */

Source from the content-addressed store, hash-verified

34 * a common function.
35 */
36bool
37resend_data_expired(const DataSampleElement& element,
38 const DDS::LifespanQosPolicy& lifespan)
39{
40 if (lifespan.duration.sec != DDS::DURATION_INFINITE_SEC
41 || lifespan.duration.nanosec != DDS::DURATION_INFINITE_NSEC) {
42 // Finite lifespan. Check if data has expired.
43
44 const DDS::Time_t tmp = {
45 element.get_header().source_timestamp_sec_ + lifespan.duration.sec,
46 element.get_header().source_timestamp_nanosec_ + lifespan.duration.nanosec
47 };
48 const SystemTimePoint expiration_time(time_to_time_value(tmp));
49 const SystemTimePoint now = SystemTimePoint::now();
50
51 if (now >= expiration_time) {
52 if (DCPS_debug_level >= 8) {
53 const TimeDuration diff = now - expiration_time;
54 ACE_DEBUG((LM_DEBUG,
55 ACE_TEXT("OpenDDS (%P|%t) Data to be sent ")
56 ACE_TEXT("expired by %d seconds, %d microseconds.\n"),
57 diff.value().sec(),
58 diff.value().usec()));
59 }
60
61 return true; // Data expired.
62 }
63 }
64
65 return false;
66}
67
68WriteDataContainer::WriteDataContainer(
69 DataWriterImpl* writer,

Callers 1

copy_and_prependMethod · 0.85

Calls 2

time_to_time_valueFunction · 0.85
valueMethod · 0.45

Tested by

no test coverage detected