30 ONIXS_CMESTREAMLINEDMDH_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_;
300 std::swap(ticks_, other.ticks_);
387 TimeSpanFormat::SDHHMMSSnsec)
391 case TimeSpanFormat::HHMMSS:
395 case TimeSpanFormat::HHMMSSmsec:
399 case TimeSpanFormat::SDHHMMSSnsec:
405 throw std::invalid_argument(
406 "Unknown timespan format pattern specified. ");
417 TimeSpanFormat::SDHHMMSSnsec)
421 toStr(str, timeSpan, format);
500 Nanosecond nanosecond = 0)
504 hour, minute, second, nanosecond)
512 : sinceEpoch_(other.sinceEpoch_)
519 Year year;
Month month; Day day;
521 toDate(sinceEpoch_, year, month, day);
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 return static_cast<Hour
>(time().hours());
555 return static_cast<Minute
>(time().minutes());
561 return static_cast<Second
>(time().seconds());
567 return static_cast<Millisecond
>(time().milliseconds());
573 return static_cast<Microsecond
>(time().microseconds());
579 return static_cast<Nanosecond
>(time().nanoseconds());
589 TimeTraits::nanosecondsPerDay());
598 TimeTraits::nanosecondsPerDay());
612 sinceEpoch_ = other.sinceEpoch_;
637 Hour, Minute, Second,
646 Year&,
Month&, Day&);
806 TimestampFormat::YYYYMMDDHHMMSSnsec)
810 case TimestampFormat::YYYYMMDD:
814 case TimestampFormat::YYYYMMDDHHMMSS:
818 case TimestampFormat::YYYYMMDDHHMMSSmsec:
822 case TimestampFormat::YYYYMMDDHHMMSSnsec:
828 throw std::invalid_argument(
829 "Unknown timestamp format pattern specified. ");
840 TimestampFormat::YYYYMMDDHHMMSSnsec)
844 toStr(str, timestamp, format);
861 virtual const Char* id()
const = 0;
897 ONIXS_CMESTREAMLINEDMDH_DATA_PACKING_END
static Int64 nanosecondsPerMinute()
Returns number of nanoseconds in single minute.
void toStrAsYYYYMMDDHHMMSSmsec(std::string &, Timestamp)
Serializes timestamp in YYYYMMDDHHMMSSmsec format.
Timestamp(Year year, Month month, Day day, Hour hour=0, Minute minute=0, Second second=0, Nanosecond nanosecond=0)
Explicit timestamp initialization.
Represents time point without time-zone information.
void swap(Timestamp &other)
Exchanges value with other instance.
void toStrAsHHMMSSmsec(std::string &, TimeSpan)
Minute minute() const
Minute component of given time point.
Hour hour() const
Hour component of given time point.
Nanoseconds nanoseconds() const
Nanoseconds component of time interval.
void toStrAsYYYYMMDDHHMMSSnsec(std::string &, Timestamp)
Serializes timestamp in YYYYMMDDHHMMSSnsec format.
static Int64 nanosecondsPerDay()
Returns number of nanoseconds in single day.
Year year() const
Year component of given time point.
static Int32 millisecondsPerSecond()
Returns number of milliseconds in single second.
static Int32 nanosecondsPerSecond()
Returns number of nanoseconds in single second.
UInt32 Hour
Integral type presenting hour component.
Nanosecond nanosecond() const
Nanosecond component of given time point.
Millisecond millisecond() const
Millisecond component of given time point.
Int32 Microseconds
Integral type for number of microseconds.
Int32 Seconds
Integral type for number of seconds.
bool fromStr(Timestamp &, const Char *, size_t)
Deserializes timestamp from string.
Identifies months in year.
bool operator==(const Timestamp &left, const Timestamp &right)
Compares with instances for equality.
void toStrAsYYYYMMDD(std::string &, Timestamp)
Serializes timestamp in YYYYMMDD format.
Month month() const
Month component of given time point.
TimeSpan(Days days, Hours hours, Minutes minutes, Seconds seconds, Nanoseconds nanoseconds)
Initializes with given set of values.
UInt32 Millisecond
Integral type presenting millisecond component.
Int32 Hours
Integral type for number of hours.
Int32 Days
Integral type for number of days.
Microseconds microseconds() const
Microseconds component of time interval.
UInt32 Year
Integral type presenting year component.
void toStrAsHHMMSS(std::string &, TimeSpan)
void toStrAsSDHHMMSSnsec(std::string &, TimeSpan)
static Int32 secondsPerMinute()
Returns number of seconds in single minute.
UInt32 Day
Integral type presenting day component.
UInt64 Ticks
Integral type storing internal ticks.
UInt32 Nanosecond
Integral type presenting nanosecond component.
#define ONIXS_CMESTREAMLINEDMDH_NAMESPACE_END
#define ONIXS_CMESTREAMLINEDMDH_LTWT_CLASS
bool operator<(const Timestamp &left, const Timestamp &right)
Establishes order between two instances.
#define ONIXS_CMESTREAMLINEDMDH_EXPORTED
char Char
Character type alias.
Day day() const
Day component of given time point.
Milliseconds milliseconds() const
Milliseconds component of time interval.
UInt32 Microsecond
Integral type presenting microsecond component.
#define ONIXS_CMESTREAMLINEDMDH_EXPORTED_CLASS
Microsecond microsecond() const
Microsecond component of given time point.
TimeSpan time() const
Time part of timestamp.
Int32 seconds() const
Seconds component of time interval.
Hours hours() const
Hours component of time interval.
Days days() const
Days component of time interval.
Int32 minutes() const
Minutes component of time interval.
static Int32 microsecondsPerSecond()
Returns number of microseconds in single second.
#define ONIXS_CMESTREAMLINEDMDH_LTWT_EXPORTED
Second second() const
Second component of given time point.
Int32 Nanoseconds
Integral type for number of nanoseconds.
void toStrAsYYYYMMDDHHMMSS(std::string &, Timestamp)
Serializes timestamp in YYYYMMDDHHMMSS format.
static Int32 minutesPerHour()
Returns number of minutes in single hour.
Miscellaneous time characteristics.
static Int32 hoursPerDay()
Returns number of hours in single day.
Int64 Ticks
Integral type presenting internal ticks.
#define ONIXS_CMESTREAMLINEDMDH_EXPORTED_STRUCT
UInt32 Second
Integral type presenting second component.
void swap(TimeSpan &other)
Exchanges with given instance.
UInt32 Minute
Integral type presenting minute component.
Timestamp(Ticks ticks=0)
Initializes from number of ticks since epoch.
bool operator!=(const IntegralConstant< UInt64, Value > &left, const Timestamp &right)
static Int32 nanosecondsPerMillisecond()
Returns number of nanoseconds in single millisecond.
Timestamp(const Timestamp &other)
Initializes as copy of other instance.
Represents time interval.
static Int64 nanosecondsPerHour()
Returns number of nanoseconds in single hour.
static const Value value()
Returns value of the constant.
TimeSpan(Hours hours, Minutes minutes, Seconds seconds, Nanoseconds nanoseconds)
Initializes with given set of values.
Ticks ticks() const
Number of ticks in given time interval.
#define ONIXS_CMESTREAMLINEDMDH_LTWT_STRUCT
Int32 Minutes
Integral type for number of minutes.
std::string toStr(Timestamp timestamp, TimestampFormat::Enum format=TimestampFormat::YYYYMMDDHHMMSSnsec)
Serializes timestamp according to specified pattern.
TimeSpan operator-(const Timestamp &left, const Timestamp &right)
Calculates time interval between two time points.
OnixS::CME::Streamlined::MDH::Month::Enum Month
Type presenting month component.
Int32 Milliseconds
Integral type for number of milliseconds.
Timestamp date() const
Timestamp without a time part.
Timestamp operator+(const Timestamp ×tamp, const TimeSpan &timeSpan)
Adds time interval to given time point.
static Int32 nanosecondsPerMicrosecond()
Returns number of nanoseconds in single microsecond.
Ticks sinceEpoch() const
Number of nanoseconds since the Epoch (01-01-1970).
TimeSpan(Ticks ticks=0)
Initializes timespan from given number of ticks.
#define ONIXS_CMESTREAMLINEDMDH_NAMESPACE_BEGIN
bool operator>(const Timestamp &left, const Timestamp &right)
Establishes order between two instances.