Skip to content

Commit

Permalink
Updated for platforms that don't have OPENDDS_USES_MONOTONIC_TIME
Browse files Browse the repository at this point in the history
  • Loading branch information
mitza-oci committed Jun 6, 2024
1 parent 2c1c94b commit b2d5283
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion dds/DCPS/TimePoint_T.inl
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ ACE_INLINE
IdlType
TimePoint_T<AceClock, IdlType>::to_idl_struct() const
{
return time_value_to_time(value_);
IdlType i;
time_value_to_time(i, value_);
return i;
}

template<typename AceClock, typename IdlType>
Expand Down
7 changes: 7 additions & 0 deletions dds/DCPS/Time_Helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ ACE_Time_Value time_to_time_value(const TimeT& t)
return tv;
}

template <typename IdlType>
void time_value_to_time(IdlType& t, const ACE_Time_Value& tv)
{
t.sec = ACE_Utils::truncate_cast<CORBA::Long>(tv.sec());
t.nanosec = ACE_Utils::truncate_cast<CORBA::ULong>(tv.usec() * 1000);
}

ACE_INLINE OpenDDS_Dcps_Export
DDS::Time_t time_value_to_time(const ACE_Time_Value& tv);

Expand Down

0 comments on commit b2d5283

Please sign in to comment.