* @todo Refactor this code and DataReaderImpl::data_expired() to * a common function. */
| 34 | * a common function. |
| 35 | */ |
| 36 | bool |
| 37 | resend_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 | |
| 68 | WriteDataContainer::WriteDataContainer( |
| 69 | DataWriterImpl* writer, |
no test coverage detected