30 ONIXS_CMEMDH_DATA_PACKING_BEGIN(1)
38 return 86400000000000ll;
44 return 3600000000000ll;
149 Nanoseconds nanoseconds)
151 static_cast<Ticks>(days) *
153 static_cast<Ticks>(hours) *
155 static_cast<Ticks>(minutes) *
157 static_cast<Ticks>(seconds) *
174 Nanoseconds nanoseconds)
176 static_cast<Ticks>(hours) *
178 static_cast<Ticks>(minutes) *
180 static_cast<Ticks>(seconds) *
193 TimeTraits::nanosecondsPerDay());
203 TimeTraits::nanosecondsPerHour()) %
204 TimeTraits::hoursPerDay()
213 static_cast<Minutes
>(
215 TimeTraits::nanosecondsPerMinute()) %
216 TimeTraits::minutesPerHour()
225 static_cast<Seconds
>(
227 TimeTraits::nanosecondsPerSecond()) %
228 TimeTraits::secondsPerMinute()
237 static_cast<Milliseconds
> 239 TimeTraits::nanosecondsPerMillisecond()) %
240 TimeTraits::millisecondsPerSecond()
249 static_cast<Microseconds
> 251 TimeTraits::nanosecondsPerMicrosecond()) %
252 TimeTraits::microsecondsPerSecond()
261 static_cast<Nanoseconds
> 263 TimeTraits::nanosecondsPerSecond());
281 ticks_ += other.ticks_;
291 ticks_ -= other.ticks_;
301 ticks_ = other.ticks_;
310 std::swap(ticks_, other.ticks_);
360 ONIXS_CMEMDH_EXPORTED
365 ONIXS_CMEMDH_EXPORTED
370 ONIXS_CMEMDH_EXPORTED
397 TimeSpanFormat::SDHHMMSSnsec)
401 case TimeSpanFormat::HHMMSS:
405 case TimeSpanFormat::HHMMSSmsec:
409 case TimeSpanFormat::SDHHMMSSnsec:
415 throw std::invalid_argument(
416 "Unknown timespan format pattern specified. ");
427 TimeSpanFormat::SDHHMMSSnsec)
431 toStr(str, timeSpan, format);
510 Nanosecond nanosecond = 0)
514 hour, minute, second, nanosecond)
522 : sinceEpoch_(other.sinceEpoch_)
529 Year year;
Month month; Day day;
531 toDate(sinceEpoch_, year, month, day);
539 Year year;
Month month; Day day;
541 toDate(sinceEpoch_, year, month, day);
549 Year year;
Month month; Day day;
551 toDate(sinceEpoch_, year, month, day);
559 return static_cast<Hour
>(time().hours());
565 return static_cast<Minute
>(time().minutes());
571 return static_cast<Second
>(time().seconds());
577 return static_cast<Millisecond
>(time().milliseconds());
583 return static_cast<Microsecond
>(time().microseconds());
589 return static_cast<Nanosecond
>(time().nanoseconds());
599 TimeTraits::nanosecondsPerDay());
608 TimeTraits::nanosecondsPerDay());
622 sinceEpoch_ = other.sinceEpoch_;
647 Hour, Minute, Second,
656 Year&,
Month&, Day&);
744 ONIXS_CMEMDH_EXPORTED
749 ONIXS_CMEMDH_EXPORTED
754 ONIXS_CMEMDH_EXPORTED
759 ONIXS_CMEMDH_EXPORTED
789 TimestampFormat::YYYYMMDDHHMMSSnsec)
793 case TimestampFormat::YYYYMMDD:
797 case TimestampFormat::YYYYMMDDHHMMSS:
801 case TimestampFormat::YYYYMMDDHHMMSSmsec:
805 case TimestampFormat::YYYYMMDDHHMMSSnsec:
811 throw std::invalid_argument(
812 "Unknown timestamp format pattern specified. ");
823 TimestampFormat::YYYYMMDDHHMMSSnsec)
827 toStr(str, timestamp, format);
833 ONIXS_CMEMDH_EXPORTED
844 virtual const Char* id()
const = 0;
880 ONIXS_CMEMDH_DATA_PACKING_END
#define ONIXS_CMEMDH_LTWT_CLASS
Microsecond microsecond() const
Microsecond component of given time point.
ONIXS_CMEMDH_EXPORTED void toStrAsHHMMSSmsec(std::string &, TimeSpan)
static Int64 nanosecondsPerDay()
Returns number of nanoseconds in single day.
ONIXS_CMEMDH_EXPORTED bool fromStr(Timestamp &, const Char *, size_t)
Deserializes timestamp from string.
static Int32 millisecondsPerSecond()
Returns number of milliseconds in single second.
ONIXS_CMEMDH_EXPORTED void toStrAsSDHHMMSSnsec(std::string &, TimeSpan)
Timestamp(Ticks ticks=0)
Initializes from number of ticks since epoch.
Milliseconds milliseconds() const
Microseconds microseconds() const
static Int32 nanosecondsPerMicrosecond()
Returns number of nanoseconds in single microsecond.
UInt32 Day
Integral type presenting day component.
Int32 Hours
Integral type for number of hours.
static Int64 nanosecondsPerMinute()
Returns number of nanoseconds in single minute.
ONIXS_CMEMDH_EXPORTED void toStrAsYYYYMMDD(std::string &, Timestamp)
Serializes timestamp in YYYYMMDD format.
ONIXS_CMEMDH_EXPORTED void toStrAsYYYYMMDDHHMMSS(std::string &, Timestamp)
Serializes timestamp in YYYYMMDDHHMMSS format.
Represents time point without time-zone information.
Identifies months in year.
static Int32 microsecondsPerSecond()
Returns number of microseconds in single second.
Int64 Ticks
Integral type presenting internal ticks.
Timestamp date() const
Timestamp without a time part.
ONIXS_CMEMDH_EXPORTED void toStrAsYYYYMMDDHHMMSSmsec(std::string &, Timestamp)
Serializes timestamp in YYYYMMDDHHMMSSmsec format.
static Int32 minutesPerHour()
Returns number of minutes in single hour.
Year year() const
Year component of given time point.
UInt32 Nanosecond
Integral type presenting nanosecond component.
Int32 Nanoseconds
Integral type for number of nanoseconds.
Millisecond millisecond() const
Millisecond component of given time point.
Ticks sinceEpoch() const
Number of nanoseconds since the Epoch (01-01-1970).
Second second() const
Second component of given time point.
char Char
Character type alias.
UInt32 Hour
Integral type presenting hour component.
Int32 Milliseconds
Integral type for number of milliseconds.
bool operator<(const Timestamp &left, const Timestamp &right)
Establishes order between two instances.
Hour hour() const
Hour component of given time point.
TimeSpan(Ticks ticks=0)
Initializes timespan from given number of ticks.
Nanoseconds nanoseconds() const
#define ONIXS_CMEMDH_EXPORTED_CLASS
#define ONIXS_CMEMDH_LTWT_STRUCT
static Int32 hoursPerDay()
Returns number of hours in single day.
UInt32 Second
Integral type presenting second component.
Timestamp operator+(const Timestamp ×tamp, const TimeSpan &timeSpan)
Adds time interval to given time point.
#define ONIXS_CMEMDH_NAMESPACE_BEGIN
UInt32 Minute
Integral type presenting minute component.
Int32 Seconds
Integral type for number of seconds.
void swap(TimeSpan &other)
Exchanges with given instance.
UInt32 Microsecond
Integral type presenting microsecond component.
Int32 Microseconds
Integral type for number of microseconds.
bool operator>(const Timestamp &left, const Timestamp &right)
Establishes order between two instances.
TimeSpan time() const
Time part of timestamp.
UInt64 Ticks
Integral type storing internal ticks.
TimeSpan operator-(const Timestamp &left, const Timestamp &right)
Calculates time interval between two time points.
#define ONIXS_CMEMDH_LTWT_EXPORTED
UInt32 Year
Integral type presenting year component.
ONIXS_CMEMDH_EXPORTED void toStrAsHHMMSS(std::string &, TimeSpan)
ONIXS_CMEMDH_EXPORTED void toStrAsYYYYMMDDHHMMSSnsec(std::string &, Timestamp)
Serializes timestamp in YYYYMMDDHHMMSSnsec format.
Miscellaneous time characteristics.
TimeSpan(Hours hours, Minutes minutes, Seconds seconds, Nanoseconds nanoseconds)
void swap(Timestamp &other)
Exchanges value with other instance.
Nanosecond nanosecond() const
Nanosecond component of given time point.
Timestamp(Year year, Month month, Day day, Hour hour=0, Minute minute=0, Second second=0, Nanosecond nanosecond=0)
Timestamp(const Timestamp &other)
Initializes as copy of other instance.
static Int32 nanosecondsPerMillisecond()
Returns number of nanoseconds in single millisecond.
std::string toStr(Timestamp timestamp, TimestampFormat::Enum format=TimestampFormat::YYYYMMDDHHMMSSnsec)
Serializes timestamp according to specified pattern.
static Int32 secondsPerMinute()
Returns number of seconds in single minute.
static Int64 nanosecondsPerHour()
Returns number of nanoseconds in single hour.
bool operator!=(const Timestamp &left, const Timestamp &right)
Compares with instances for inequality.
Month month() const
Month component of given time point.
bool operator==(const Timestamp &left, const Timestamp &right)
Compares with instances for equality.
TimeSpan(Days days, Hours hours, Minutes minutes, Seconds seconds, Nanoseconds nanoseconds)
Day day() const
Day component of given time point.
Minute minute() const
Minute component of given time point.
Int32 Minutes
Integral type for number of minutes.
OnixS::CME::MDH::Month::Enum Month
Type presenting month component.
#define ONIXS_CMEMDH_EXPORTED_STRUCT
Int32 Days
Integral type for number of days.
UInt32 Millisecond
Integral type presenting millisecond component.
static Int32 nanosecondsPerSecond()
Returns number of nanoseconds in single second.
#define ONIXS_CMEMDH_NAMESPACE_END