24#ifndef __DOUF_ACE_TIME_CONVERTER_H
25#define __DOUF_ACE_TIME_CONVERTER_H
27#ifndef SAFIR_NO_DEPRECATED
29#include <ace/Time_Value.h>
35 #pragma warning (push)
36 #pragma warning (disable : 4127)
39#include <boost/date_time/posix_time/posix_time.hpp>
75 static ACE_Time_Value
ToAceTime(
const boost::posix_time::time_duration & duration);
83 static ACE_Time_Value
ToAceTime(
const boost::posix_time::ptime & time);
99 static boost::posix_time::ptime
ToPtime(
const ACE_Time_Value & utcTime);
105 if (boost::posix_time::time_duration::num_fractional_digits() == 6)
107 return ACE_Time_Value(
static_cast<time_t
>(duration.total_seconds()),
108 static_cast<suseconds_t
>(duration.fractional_seconds()));
112 return ACE_Time_Value(
static_cast<time_t
>(duration.total_seconds()),
113 static_cast<suseconds_t
>(duration.fractional_seconds()
114 * pow(1.0, boost::posix_time::time_duration::num_fractional_digits() -6)));
120 return ACE_Time_Value(
static_cast<suseconds_t
>(time),
131 return time.sec() + (time.usec() / pow (10.0,6));
This namespace contains all the functionality and definitions of the SAFIR SDK.
Definition Backdoor.h:31
DotsC_Int64 Int64
64 bit integer type.
Definition Defs.h:69
Float64 Second
64 bit representation of Second.
Definition Defs.h:197
The AceTimeConverter class provides functions to convert to/from ACE time.
Definition AceTimeConverter.h:58
static Safir::Dob::Typesystem::Si64::Second ToDouble(const ACE_Time_Value &time)
Convert specified ACE time to a Double.
Definition AceTimeConverter.h:129
static ACE_Time_Value ToAceTime(const Safir::Dob::Typesystem::Si64::Second time)
Get specified time in ACE Time representation.
Definition AceTimeConverter.h:118
static boost::posix_time::ptime ToPtime(const ACE_Time_Value &utcTime)
Get specified ACE time in boost::posix_time::ptime representation.
Definition AceTimeConverter.h:134
static boost::posix_time::ptime ToPtime(const Safir::Dob::Typesystem::Si64::Second utcTime)
Get specified UTC time in boost::posix_time::ptime representation.
Definition TimeProvider.h:105
static Safir::Dob::Typesystem::Si64::Second ToDouble(const boost::posix_time::ptime &utcTime)
Convert specified UTC time to a Double.
Definition TimeProvider.h:130