46 return 86400000000000ll;
53 return 3600000000000ll;
299 ticks_ += other.ticks_;
308 ticks_ -= other.ticks_;
317 std::swap(ticks_, other.ticks_);
422 throw std::invalid_argument(
423 "Unknown timespan format pattern specified. ");
437 toStr(str, timeSpan, format);
559 : sinceEpoch_(other.sinceEpoch_)
660 sinceEpoch_ = other.sinceEpoch_;
680 unsigned long long presentation,
887 toStr(str, timestamp, format);
904 const std::string& str)
908 ts, str.c_str(), str.size());
#define ONIXS_HKEX_OMDC_CONSTEXPR
#define ONIXS_HKEX_OMDC_NOTHROW
Represents time interval.
Milliseconds milliseconds() const
Milliseconds component of time interval.
TimeSpan(Days days, Hours hours, Minutes minutes, Seconds seconds, Nanoseconds nanoseconds)
Initializes with given set of values.
Int32 Milliseconds
Integral type for number of milliseconds.
void swap(TimeSpan &other) noexcept
Exchanges with given instance.
Ticks ticks() const
Number of ticks in given time interval.
Int32 Minutes
Integral type for number of minutes.
TimeSpan(Ticks ticks=0) noexcept
Initializes timespan from given number of ticks.
Int32 seconds() const
Seconds component of time interval.
Nanoseconds nanoseconds() const
Nanoseconds component of time interval.
Int32 Nanoseconds
Integral type for number of nanoseconds.
Int32 Seconds
Integral type for number of seconds.
TimeSpan & operator+=(const TimeSpan &other)
Adds time interval to current one.
Microseconds microseconds() const
Microseconds component of time interval.
Days days() const
Days component of time interval.
Int32 Microseconds
Integral type for number of microseconds.
Int32 Hours
Integral type for number of hours.
Int32 Days
Integral type for number of days.
Hours hours() const
Hours component of time interval.
TimeSpan & operator-=(const TimeSpan &other)
Subtracts time interval from current one.
Int64 Ticks
Integral type presenting internal ticks.
TimeSpan(Hours hours, Minutes minutes, Seconds seconds, Nanoseconds nanoseconds)
Initializes with given set of values.
Int32 minutes() const
Minutes component of time interval.
Represents time point without time-zone information.
Microsecond microsecond() const
Microsecond component of given time point.
Month month() const
Month component of given time point.
Year year() const
Year component of given time point.
Timestamp(const Timestamp &other)
Initializes as copy of other instance.
static ONIXS_HKEX_OMDC_API Timestamp now()
Returns current local time.
Day day() const
Day component of given time point.
UInt32 Hour
Integral type presenting hour component.
Timestamp(Ticks ticks=0) noexcept
Initializes from number of ticks since epoch.
UInt32 Minute
Integral type presenting minute component.
Minute minute() const
Minute component of given time point.
static Timestamp parse(unsigned long long presentation, TimestampFormat::Enum format=TimestampFormat::YYYYMMDD)
Parses timestamp from its numeric presentation (like 20201115) only YYYYMMDD is supported.
Hour hour() const
Hour component of given time point.
UInt32 Millisecond
Integral type presenting millisecond component.
Nanosecond nanosecond() const
Nanosecond component of given time point.
Timestamp date() const
Timestamp without a time part.
UInt64 Ticks
Integral type storing internal ticks.
TimeSpan time() const
Time part of timestamp.
Second second() const
Second component of given time point.
UInt32 Microsecond
Integral type presenting microsecond component.
static ONIXS_HKEX_OMDC_API Timestamp utcNow()
Returns current UTC time.
Timestamp(Year year, Month month, Day day, Hour hour=0, Minute minute=0, Second second=0, Nanosecond nanosecond=0)
Explicit time-stamp initialization.
void swap(Timestamp &other)
Exchanges value with other instance.
UInt32 Second
Integral type presenting second component.
UInt32 Day
Integral type presenting day component.
Timestamp & operator=(const Timestamp &other)
Reinitializes as copy of given instance.
UInt32 Nanosecond
Integral type presenting nanosecond component.
UInt32 Year
Integral type presenting year component.
Millisecond millisecond() const
Millisecond component of given time point.
Ticks sinceEpoch() const noexcept
Number of nanoseconds since the Epoch (01-01-1970).
OnixS::HKEX::MarketData::Omdc::Month::Enum Month
Type presenting month component.
ONIXS_HKEX_OMDC_API void toStrAsYYYYMMDDHHMMSS(std::string &, Timestamp)
Serializes timestamp in YYYYMMDDHHMMSS format.
ONIXS_HKEX_OMDC_API void toStrAsHHMMSS(std::string &, TimeSpan)
bool operator>(const StrRef &left, const StrRef &right)
Establishes order over string refs.
Timestamp fromSeconds(UInt32 secondsSinceEpoch)
Create Timestamp from whole seconds since the Epoch.
bool operator<(const StrRef &left, const StrRef &right)
Establishes order over string refs.
bool operator>=(const Timestamp &left, const Timestamp &right)
Establishes order between two instances.
ONIXS_HKEX_OMDC_API void toStrAsYYYYMMDDHHMMSSmsec(std::string &, Timestamp)
Serializes timestamp in YYYYMMDDHHMMSSmsec format.
ONIXS_HKEX_OMDC_API void toStr(std::string &, Side::Enum)
Appends string presentation of object.
ONIXS_HKEX_OMDC_API void toStrAsHHMMSSmsec(std::string &, TimeSpan)
ONIXS_HKEX_OMDC_API bool fromStr(Timestamp &, const char *, size_t)
De-serializes a timestamp from the given string.
ONIXS_HKEX_OMDC_API void toStrAsSDHHMMSSnsec(std::string &, TimeSpan)
bool operator<=(const Timestamp &left, const Timestamp &right)
Establishes order between two instances.
ONIXS_HKEX_OMDC_API void toStrAsYYYYMMDDHHMMSSnsec(std::string &, Timestamp)
Serializes timestamp in YYYYMMDDHHMMSSnsec format.
Timestamp operator+(const Timestamp ×tamp, const TimeSpan &timeSpan)
Adds time interval to given time point.
bool operator==(const PriceLevel &l, const PriceLevel &r) noexcept
compare
bool operator!=(const StrRef &left, const StrRef &right)
Compares with another instance.
ONIXS_HKEX_OMDC_API void toStrAsYYYYMMDD(std::string &, Timestamp)
Serializes timestamp in YYYYMMDD format.
Timestamp operator-(const Timestamp ×tamp, const TimeSpan &timeSpan)
Subtracts time interval from given time point.
Identifies months in year.
Miscellaneous time characteristics.
static constexpr Int32 secondsPerMinute()
Returns number of seconds in single minute.
static constexpr Int32 microsecondsPerSecond()
Returns number of microseconds in single second.
static constexpr Int32 millisecondsPerSecond()
Returns number of milliseconds in single second.
static constexpr Int64 nanosecondsPerMinute()
Returns number of nanoseconds in single minute.
static constexpr Int32 hoursPerDay()
Returns number of hours in single day.
static constexpr Int64 nanosecondsPerHour()
Returns number of nanoseconds in single hour.
static constexpr Int32 nanosecondsPerMicrosecond()
Returns number of nanoseconds in single microsecond.
static constexpr Int64 nanosecondsPerDay()
Returns number of nanoseconds in single day.
static constexpr Int32 minutesPerHour()
Returns number of minutes in single hour.
static constexpr Int32 nanosecondsPerSecond()
Returns number of nanoseconds in single second.
static constexpr Int32 nanosecondsPerMillisecond()
Returns number of nanoseconds in single millisecond.