37 return 86400000000000ll;
43 return 3600000000000ll;
240 return numericCast<Milliseconds>(
250 return numericCast<Microseconds>(
275 ticks_ += other.ticks_;
283 ticks_ -= other.ticks_;
291 std::swap(ticks_, other.ticks_);
307 return left.ticks() == right.ticks();
314 return left.ticks() != right.ticks();
321 return left.ticks() < right.ticks();
328 return left.ticks() > right.ticks();
371 toStr(str, timeSpan, format);
434 using Month = ONIXS_CMEMDH_MESSAGING_NAMESPACE::Month::Enum;
485 : sinceEpoch_(other.sinceEpoch_)
528 return static_cast<Hour>(
time().hours());
581 sinceEpoch_ = other.sinceEpoch_;
589 std::swap(sinceEpoch_, other.sinceEpoch_);
612 typedef Ticks FirstArgType;
626 static Ticks toTicks(Year,
Month, Day, Hour, Minute, Second, Nanosecond);
630 static void toDate(Ticks, Year&,
Month&, Day&);
644 return (left.sinceEpoch() == right.sinceEpoch());
651 return (left.sinceEpoch() != right.sinceEpoch());
658 return (left.sinceEpoch() < right.sinceEpoch());
665 return (left.sinceEpoch() <= right.sinceEpoch());
672 return (left.sinceEpoch() > right.sinceEpoch());
679 return (left.sinceEpoch() >= right.sinceEpoch());
700 return TimeSpan(left.sinceEpoch() - right.sinceEpoch());
748 return os <<
toStr(value);
753 return os <<
toStr(value);
764 return fromStr(ts, str.c_str(), str.size());
776 return fromStr(ts, str.c_str(), str.size(), format);
786 throw std::runtime_error(
"Error parsing timestamp.");
798 throw std::runtime_error(
"Error parsing timespan.");
805 return toStr(*
this, format);
810 return toStr(*
this, format);
#define ONIXS_CMEMDH_MESSAGING_NAMESPACE_BEGIN
#define ONIXS_CMEMDH_MESSAGING_NAMESPACE_END
#define ONIXS_CMEMDH_LTWT_EXPORTED
#define ONIXS_CMEMDH_DATA_PACKING_END
#define ONIXS_CMEMDH_DATA_PACKING_BEGIN(alignment)
#define ONIXS_CMEMDH_EXPORTED
#define ONIXS_CMEMDH_PURE
#define ONIXS_CMEMDH_NODISCARD
Nanoseconds nanoseconds() const noexcept
Int32 Milliseconds
Integral type for number of milliseconds.
static TimeSpan fromStr(const std::string &)
void swap(TimeSpan &other) noexcept
Swaps.
Int32 Minutes
Integral type for number of minutes.
TimeSpan(Hours hours, Minutes minutes, Seconds seconds, Nanoseconds nanoseconds) noexcept
TimeSpan(Ticks ticks=0) noexcept
Initializes the timespan from the given number of ticks.
TimeSpan(Days days, Hours hours, Minutes minutes, Seconds seconds, Nanoseconds nanoseconds) noexcept
Int32 Nanoseconds
Integral type for number of nanoseconds.
Int32 Seconds
Integral type for number of seconds.
Microseconds microseconds() const noexcept
Ticks ticks() const noexcept
Hours hours() const noexcept
Int32 Microseconds
Integral type for number of microseconds.
TimeSpan & operator-=(const TimeSpan &other) noexcept
Subtracts the given time interval.
std::string toString(TimeSpanFormat::Enum=TimeSpanFormat::SDHHMMSSnsec) const
Int32 Hours
Integral type for number of hours.
TimeSpan & operator+=(const TimeSpan &other) noexcept
Adds the given time interval.
Int32 Days
Integral type for number of days.
Days days() const noexcept
Minutes minutes() const noexcept
Milliseconds milliseconds() const noexcept
Seconds seconds() const noexcept
Int64 Ticks
Integral type presenting internal ticks.
The time point without the time-zone information.
static Timestamp fromStr(const std::string &, TimestampFormat::Enum=TimestampFormat::YYYYMMDDHHMMSSnsec)
Microsecond microsecond() const noexcept
UInt32 Hour
Integral type presenting the hour component.
Timestamp(Ticks ticks=0) noexcept
Initializes from the number of ticks since epoch.
Minute minute() const noexcept
static Timestamp now() noexcept
Current local time.
void swap(Timestamp &other) noexcept
Exchanges the value.
UInt32 Minute
Integral type presenting the minute component.
TimeSpan time() const noexcept
static Timestamp utcNow() noexcept
Current utc time.
UInt32 Millisecond
Integral type presenting the millisecond component.
UInt64 Ticks
Integral type storing internal ticks.
Timestamp date() const noexcept
Timestamp & operator=(const Timestamp &other) noexcept
UInt32 Microsecond
Integral type presenting the microsecond component.
Timestamp(Year year, Month month, Day day, Hour hour=0, Minute minute=0, Second second=0, Nanosecond nanosecond=0)
UInt32 Second
Integral type presenting the second component.
UInt32 Day
Integral type presenting the day component.
Second second() const noexcept
UInt32 Nanosecond
Integral type presenting the nanosecond component.
OnixS::CME::MDH::Messaging::Month::Enum Month
Type presenting the month component.
Hour hour() const noexcept
UInt32 Year
Integral type presenting the year component.
Ticks sinceEpoch() const noexcept
Millisecond millisecond() const noexcept
Nanosecond nanosecond() const noexcept
Timestamp(const Timestamp &other) noexcept
std::string toString(TimestampFormat::Enum=TimestampFormat::YYYYMMDDHHMMSSnsec) const
bool operator>=(const Timestamp &left, const Timestamp &right) noexcept
Compares instances.
void toStrAsHHMMSSpsec(std::string &, TimeSpan)
Serializes the timespan according to the HH:MM:SS.ssssssssssss pattern.
Timestamp makeTimestamp(Timestamp::Ticks ticks) noexcept
Make Timestamp helper.
bool operator<=(const Timestamp &left, const Timestamp &right) noexcept
Compares instances.
TimeSpan operator-(const TimeSpan &timeSpan) noexcept
Changes the sign of the Timestamp.
void toStrAsHHMMSSnsec(std::string &, TimeSpan)
Serializes the timespan according to the HH:MM:SS.sssssssss pattern.
void toStrAsYYYYMMDDHHMMSSusec(std::string &, Timestamp)
Serializes the timestamp using the YYYYMMDDHHMMSSusec format.
bool fromStr(Int8 &, const Char *, size_t)
std::uint32_t UInt32
uInt32.
void toStrAsHHMMSSusec(std::string &, TimeSpan)
Serializes the timespan according to the HH:MM:SS.ssssss pattern.
bool operator!=(const TimeSpan &left, const TimeSpan &right) noexcept
Compares Timespans.
void toStrAsYYYYMMDDHHMMSSmsec(std::string &, Timestamp)
Serializes the timestamp using the YYYYMMDDHHMMSSmsec format.
char Char
Character type alias.
bool operator==(const TimeSpan &left, const TimeSpan &right) noexcept
Compares Timespans.
void toStrAsHHMMSSmsec(std::string &, TimeSpan)
Serializes the timespan according to the HH:MM:SS.sss pattern.
void toStrAsYYYYMMDDHHMMSS(std::string &, Timestamp)
Serializes the timestamp using the YYYYMMDDHHMMSS format.
void toStrAsHHMMSS(std::string &, TimeSpan)
Serializes the timespan according to the HH:MM:SS pattern.
void toStrAsYYYYMMDDHHMMSSpsec(std::string &, Timestamp)
Serializes the timestamp using the YYYYMMDDHHMMSSpsec format.
bool operator<(const TimeSpan &left, const TimeSpan &right) noexcept
Compares Timespans.
void toStrAsYYYYMMDD(std::string &, Timestamp)
Serializes the timestamp using the YYYYMMDD format.
void toStrAsSDHHMMSSnsec(std::string &, TimeSpan)
Serializes the timespan according to the D.HH:MM:SS.sssssssss pattern.
Timestamp operator+(const Timestamp ×tamp, const TimeSpan &timeSpan) noexcept
Adds the time interval.
std::uint64_t UInt64
uInt64.
bool operator>(const TimeSpan &left, const TimeSpan &right) noexcept
Compares Timespans.
void toStr(std::string &, Int8)
Serializes given integer into a string.
void toStrAsYYYYMMDDHHMMSSnsec(std::string &, Timestamp)
Serializes the timestamp using the YYYYMMDDHHMMSSnsec format.
std::ostream & operator<<(std::ostream &os, const Timestamp &value)
Messaging::Timestamp timestamp(const Messaging::FIX::MultiContainer &, Messaging::FIX::Tag)
Retrieves last update time field value.
Miscellaneous time characteristics.
static constexpr Int32 hoursPerDay() noexcept
static constexpr Int32 nanosecondsPerSecond() noexcept
static constexpr Int32 secondsPerMinute() noexcept
static constexpr Int32 minutesPerHour() noexcept
static constexpr Int64 nanosecondsPerDay() noexcept
static constexpr Int32 microsecondsPerSecond() noexcept
static constexpr Int32 millisecondsPerSecond() noexcept
static constexpr Int64 nanosecondsPerMinute() noexcept
static constexpr Int32 nanosecondsPerMicrosecond() noexcept
static constexpr Int32 nanosecondsPerMillisecond() noexcept
static constexpr Int64 nanosecondsPerHour() noexcept