37 return 86400000000000ll;
44 return 3600000000000ll;
191 numericCast<Ticks>(
days) *
193 numericCast<Ticks>(
hours) *
212 numericCast<Ticks>(
hours) *
250 numericCast<Minutes>(
263 numericCast<Seconds>(
276 numericCast<Milliseconds>
289 numericCast<Microseconds>
302 numericCast<Nanoseconds>
319 ticks_ += other.ticks_;
327 ticks_ -= other.ticks_;
335 std::swap(ticks_, other.ticks_);
351 return left.ticks() == right.ticks();
358 return left.ticks() != right.ticks();
365 return left.ticks() < right.ticks();
372 return left.ticks() > right.ticks();
416 toStr(str, timeSpan, format);
483 typedef Ticks FirstArgType;
552 : sinceEpoch_(other.sinceEpoch_)
589 return static_cast<Hour>(
time().hours());
649 sinceEpoch_ = other.sinceEpoch_;
657 std::swap(sinceEpoch_, other.sinceEpoch_);
671 static Ticks toTicks(Year,
Month, Day, Hour, Minute, Second, Nanosecond);
675 static void toDate(Ticks, Year&,
Month&, Day&);
751 timestamp.sinceEpoch() +
762 timestamp.sinceEpoch() -
771 return TimeSpan(left.sinceEpoch() - right.sinceEpoch());
809 toStr(str, timestamp, format);
818inline std::ostream & operator <<(std::ostream & os,
const Timestamp& value)
820 return os <<
toStr(value);
824std::ostream & operator <<(std::ostream & os,
const TimeSpan& value)
826 return os <<
toStr(value);
840 ts, str.c_str(), str.size());
854 ts, str.c_str(), str.size(), format);
866 throw std::runtime_error(
"Error parsing timestamp.");
880 throw std::runtime_error(
"Error parsing timespan.");
888 return toStr(*
this, format);
894 return toStr(*
this, format);
#define ONIXS_CONFLATEDTCP_LTWT_EXPORTED
#define ONIXS_CONFLATEDTCP_LTWT_STRUCT
#define ONIXS_CONFLATEDTCP_LTWT_CLASS
#define ONIXS_CONFLATEDTCP_MESSAGING_NAMESPACE_BEGIN
#define ONIXS_CONFLATEDTCP_MESSAGING_NAMESPACE_END
#define ONIXS_CONFLATEDTCP_PURE
#define ONIXS_CONFLATEDTCP_CONSTEXPR
#define ONIXS_CONFLATEDTCP_EXPORTED
#define ONIXS_CONFLATEDTCP_NOTHROW
#define ONIXS_CONFLATEDTCP_NODISCARD
Nanoseconds nanoseconds() const noexcept
Int32 Milliseconds
Integral type for number of milliseconds.
static TimeSpan fromStr(const std::string &)
De-serializes the timespan from the given string according to the specified pattern.
void swap(TimeSpan &other) noexcept
Swaps.
Int32 Minutes
Integral type for number of minutes.
TimeSpan(Hours hours, Minutes minutes, Seconds seconds, Nanoseconds nanoseconds) noexcept
Initializes with the given set of values.
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
Initializes with the given set of values.
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)
De-serializes a timestamp from the given string.
OnixS::CME::ConflatedTCP::Messaging::Month::Enum Month
Type presenting the month component.
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
void swap(Timestamp &other) noexcept
Exchanges the value.
UInt32 Minute
Integral type presenting the minute component.
TimeSpan time() const noexcept
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)
Explicit time-stamp initialization.
@ Size
Size of the class in bytes.
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.
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 fromStr(Int8 &, const Char *, size_t) noexcept
Deserializes a numeric value from its text representation.
bool operator<=(const Timestamp &left, const Timestamp &right) noexcept
Compares instances.
bool operator>(const StrRef &left, const StrRef &right)
Compares instances.
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 operator<(const StrRef &left, const StrRef &right)
Compares instances.
void toStrAsHHMMSSusec(std::string &, TimeSpan)
Serializes the timespan according to the HH:MM:SS.ssssss pattern.
void toStrAsYYYYMMDDHHMMSSmsec(std::string &, Timestamp)
Serializes the timestamp using the YYYYMMDDHHMMSSmsec format.
char Char
Character type alias.
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.
void toStrAsYYYYMMDD(std::string &, Timestamp)
Serializes the timestamp using the YYYYMMDD format.
bool operator==(const StrRef &left, const StrRef &right)
Compares instances.
void toStrAsSDHHMMSSnsec(std::string &, TimeSpan)
Serializes the timespan according to the D.HH:MM:SS.sssssssss pattern.
void toStr(std::string &str, const Negotiate200 &obj)
Serializes into a string.
bool operator!=(const StrRef &left, const StrRef &right)
Compares instances.
void toStrAsYYYYMMDDHHMMSSnsec(std::string &, Timestamp)
Serializes the timestamp using the YYYYMMDDHHMMSSnsec format.
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