24 #ifndef __DOUF_ACE_TIME_CONVERTER_H
25 #define __DOUF_ACE_TIME_CONVERTER_H
27 #include <ace/Time_Value.h>
33 #pragma warning (push)
34 #pragma warning (disable : 4127)
37 #include <boost/date_time/posix_time/posix_time.hpp>
70 static ACE_Time_Value
ToAceTime(
const boost::posix_time::time_duration & duration);
78 static ACE_Time_Value
ToAceTime(
const boost::posix_time::ptime & time);
94 static boost::posix_time::ptime
ToPtime(
const ACE_Time_Value & utcTime);
100 if (boost::posix_time::time_duration::num_fractional_digits() == 6)
102 return ACE_Time_Value(static_cast<time_t>(duration.total_seconds()),
103 static_cast<suseconds_t>(duration.fractional_seconds()));
107 return ACE_Time_Value(static_cast<time_t>(duration.total_seconds()),
108 static_cast<suseconds_t>(duration.fractional_seconds()
109 * pow(1.0, boost::posix_time::time_duration::num_fractional_digits() -6)));
115 return ACE_Time_Value(static_cast<suseconds_t>(time),
126 return time.sec() + (time.usec() / pow (10.0,6));
138 #endif //__DOUF_ACE_TIME_CONVERTER_H
static boost::posix_time::ptime ToPtime(const Safir::Dob::Typesystem::Si64::Second utcTime)
Get specified UTC time in boost::posix_time::ptime representation.
static ACE_Time_Value ToAceTime(const Safir::Dob::Typesystem::Si64::Second time)
Get specified time in ACE Time representation.
Definition: AceTimeConverter.h:113
static Safir::Dob::Typesystem::Si64::Second ToDouble(const boost::posix_time::ptime &utcTime)
Convert specified UTC time to a Double.
DotsC_Int64 Int64
64 bit integer type.
Definition: Defs.h:70
Float64 Second
64 bit representation of Second.
Definition: Defs.h:198
static boost::posix_time::ptime ToPtime(const ACE_Time_Value &utcTime)
Get specified ACE time in boost::posix_time::ptime representation.
Definition: AceTimeConverter.h:129
The AceTimeConverter class provides functions to convert to/from ACE time.
Definition: AceTimeConverter.h:52
static Safir::Dob::Typesystem::Si64::Second ToDouble(const ACE_Time_Value &time)
Convert specified ACE time to a Double.
Definition: AceTimeConverter.h:124