History

TimeSeriesPlatformLibrary: Added temporal support options to DataPublisher interfaces.

J. Ritchie Carroll committed 7 years ago

Commit 5c5b4061 parent 04505f228 files · +603 −300Browse files

Showing the changes to Source/Libraries/TimeSeriesPlatformLibrary/Common/CommonTypes.h (1 of 28 files). Show all

Unified · Split

Source/Libraries/TimeSeriesPlatformLibrary/Common/CommonTypes.h+21−9
@@ -48,6 +48,9 @@ namespace GSF · 47 unmodified lines
4848 typedef double_t float64_t;
4949 typedef boost::multiprecision::cpp_dec_float_100 decimal_t;
5050
51+ // DateTime type
52+ typedef boost::posix_time::ptime datetime_t;
53+
5154 struct Int8
5255 {
5356 static const int8_t MaxValue = static_cast<int8_t>(127);
@@ -105,16 +108,26 @@ namespace GSF · 51 unmodified lines
105108 static const decimal_t DotNetMinValue;
106109 };
107110
111+ struct DateTime
112+ {
113+ static const datetime_t MaxValue;
114+ static const datetime_t MinValue;
115+ };
116+
108117 struct Ticks
109118 {
119+ static const int64_t MaxValue = 3155378975999999999L; // 12/31/1999 11:59:59.999
120+ static const int64_t MinValue = 0L; // 01/01/0001 00:00:00.000
121+
122+ static const int64_t UnixBaseOffset = 621355968000000000L; // 01/01/1970 00:00:00.000
123+ static const int64_t PTimeBaseOffset = 441481536000000000L; // 01/01/1400 00:00:00.000
124+
110125 static const int64_t PerSecond = 10000000L;
111126 static const int64_t PerMillisecond = Ticks::PerSecond / 1000;
112127 static const int64_t PerMicrosecond = Ticks::PerSecond / 1000000;
113128 static const int64_t PerMinute = 60L * Ticks::PerSecond;
114129 static const int64_t PerHour = 60L * Ticks::PerMinute;
115130 static const int64_t PerDay = 24L * Ticks::PerHour;
116− static const int64_t UnixBaseOffset = 621355968000000000L; // 01/01/1970 00:00:00
117− static const int64_t PtimeBaseOffset = 441481536000000000L; // 01/01/1400 00:00:00
118131 };
119132
120133 template<class T>
@@ -167,7 +180,6 @@ namespace GSF · 46 unmodified lines
167180
168181 typedef boost::any Object;
169182 typedef boost::uuids::uuid Guid;
170− typedef boost::posix_time::ptime DateTime;
171183 typedef boost::posix_time::time_duration TimeSpan;
172184 typedef boost::system::error_code ErrorCode;
173185 typedef boost::system::system_error SystemError;
@@ -192,7 +204,7 @@ namespace GSF · 18 unmodified lines
192204 struct Empty
193205 {
194206 static const std::string String;
195− static const GSF::DateTime DateTime;
207+ static const GSF::datetime_t DateTime;
196208 static const GSF::Guid Guid;
197209 static const GSF::Object Object;
198210 static const GSF::IPAddress IPAddress;
@@ -394,11 +406,11 @@ namespace GSF · 195 unmodified lines
394406 Millisecond
395407 };
396408
397− DateTime DateAdd(const DateTime& value, int32_t addValue, TimeInterval interval);
398− int32_t DateDiff(const DateTime& startTime, const DateTime& endTime, TimeInterval interval);
399− int32_t DatePart(const DateTime& value, TimeInterval interval);
400− DateTime Now();
401− DateTime UtcNow();
409+ datetime_t DateAdd(const datetime_t& value, int32_t addValue, TimeInterval interval);
410+ int32_t DateDiff(const datetime_t& startTime, const datetime_t& endTime, TimeInterval interval);
411+ int32_t DatePart(const datetime_t& value, TimeInterval interval);
412+ datetime_t Now();
413+ datetime_t UtcNow();
402414 }
403415
404416 // Setup standard hash code for Guid

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t