27 #include <OnixS/CboeCFE/Trading/BOE/Compiler.h> 44 ONIXS_BATS_BOE_CONSTEXPR
47 return 86400000000000ll;
51 ONIXS_BATS_BOE_CONSTEXPR
54 return 3600000000000ll;
58 ONIXS_BATS_BOE_CONSTEXPR
65 ONIXS_BATS_BOE_CONSTEXPR
72 ONIXS_BATS_BOE_CONSTEXPR
79 ONIXS_BATS_BOE_CONSTEXPR
86 ONIXS_BATS_BOE_CONSTEXPR
93 ONIXS_BATS_BOE_CONSTEXPR
100 ONIXS_BATS_BOE_CONSTEXPR
107 ONIXS_BATS_BOE_CONSTEXPR
114 ONIXS_BATS_BOE_CONSTEXPR
151 explicit TimeSpan(Ticks ticks = 0) ONIXS_BATS_BOE_NOTHROW
168 Nanoseconds nanoseconds)
170 static_cast<Ticks>(days) *
172 static_cast<Ticks>(hours) *
174 static_cast<Ticks>(minutes) *
176 static_cast<Ticks>(seconds) *
193 Nanoseconds nanoseconds)
195 static_cast<Ticks>(hours) *
197 static_cast<Ticks>(minutes) *
199 static_cast<Ticks>(seconds) *
232 static_cast<Minutes
>(
244 static_cast<Seconds
>(
256 static_cast<Milliseconds
> 268 static_cast<Microseconds
> 280 static_cast<Nanoseconds
> 300 ticks_ += other.ticks_;
309 ticks_ -= other.ticks_;
316 ONIXS_BATS_BOE_NOTHROW
318 std::swap(ticks_, other.ticks_);
368 ONIXS_CBOE_CFE_BOE_API
373 ONIXS_CBOE_CFE_BOE_API
378 ONIXS_CBOE_CFE_BOE_API
423 throw std::invalid_argument(
424 "Unknown timespan format pattern specified. ");
438 toStr(str, timeSpan, format);
501 ONIXS_CBOE_CFE_BOE_API
506 ONIXS_CBOE_CFE_BOE_API
513 Ticks ticks = 0) ONIXS_BATS_BOE_NOTHROW
530 Nanosecond nanosecond = 0)
534 hour, minute, second, nanosecond)
542 : sinceEpoch_(other.sinceEpoch_)
549 Year year;
Month month; Day day;
551 toDate(sinceEpoch_, year, month, day);
559 Year year;
Month month; Day day;
561 toDate(sinceEpoch_, year, month, day);
569 Year year;
Month month; Day day;
571 toDate(sinceEpoch_, year, month, day);
579 return static_cast<Hour
>(time().hours());
585 return static_cast<Minute
>(time().minutes());
591 return static_cast<Second
>(time().seconds());
597 return static_cast<Millisecond
>(time().milliseconds());
603 return static_cast<Microsecond
>(time().microseconds());
609 return static_cast<Nanosecond
>(time().nanoseconds());
633 ONIXS_BATS_BOE_NOTHROW
643 sinceEpoch_ = other.sinceEpoch_;
663 ONIXS_CBOE_CFE_BOE_API
667 Hour, Minute, Second,
671 ONIXS_CBOE_CFE_BOE_API
673 void toDate(Ticks, Year&,
Month&, Day&);
800 ONIXS_CBOE_CFE_BOE_API
809 ONIXS_CBOE_CFE_BOE_API
818 ONIXS_CBOE_CFE_BOE_API
827 ONIXS_CBOE_CFE_BOE_API
855 ONIXS_CBOE_CFE_BOE_API
873 toStr(str, timestamp, format);
879 ONIXS_CBOE_CFE_BOE_API
890 const std::string& str)
894 ts, str.c_str(), str.size());
Day day() const
Day component of given time point.
static ONIXS_BATS_BOE_CONSTEXPR Int32 hoursPerDay()
Returns number of hours in single day.
UInt32 Microsecond
Integral type presenting microsecond component.
Int32 Hours
Integral type for number of hours.
Identifies months in year.
Minute minute() const
Minute component of given time point.
Timestamp(Year year, Month month, Day day, Hour hour=0, Minute minute=0, Second second=0, Nanosecond nanosecond=0)
Represents time point without time-zone information.
Int64 Ticks
Integral type presenting internal ticks.
static ONIXS_BATS_BOE_CONSTEXPR Int32 microsecondsPerSecond()
Returns number of microseconds in single second.
bool operator<=(const FixedPointDecimal< Mantissa, Exponent > &left, const FixedPointDecimal< Mantissa, Exponent > &right)
Compares two fixed-point decimals.
Int32 Nanoseconds
Integral type for number of nanoseconds.
bool operator<(const FixedPointDecimal< Mantissa, Exponent > &left, const FixedPointDecimal< Mantissa, Exponent > &right)
Compares two fixed-point decimals.
static ONIXS_BATS_BOE_CONSTEXPR Int64 nanosecondsPerMinute()
Returns number of nanoseconds in single minute.
static ONIXS_BATS_BOE_CONSTEXPR Int32 millisecondsPerSecond()
Returns number of milliseconds in single second.
Microseconds microseconds() const
bool operator>(const FixedPointDecimal< Mantissa, Exponent > &left, const FixedPointDecimal< Mantissa, Exponent > &right)
Compares two fixed-point decimals.
TimeSpan(Days days, Hours hours, Minutes minutes, Seconds seconds, Nanoseconds nanoseconds)
Hour hour() const
Hour component of given time point.
ONIXS_CBOE_CFE_BOE_API void toStrAsYYYYMMDD(std::string &, Timestamp)
Serializes timestamp in YYYYMMDD format.
Ticks sinceEpoch() const ONIXS_BATS_BOE_NOTHROW
Number of nanoseconds since the Epoch (01-01-1970).
TimeSpan(Hours hours, Minutes minutes, Seconds seconds, Nanoseconds nanoseconds)
Year year() const
Year component of given time point.
ONIXS_CBOE_CFE_BOE_API void toStrAsYYYYMMDDHHMMSS(std::string &, Timestamp)
Serializes timestamp in YYYYMMDDHHMMSS format.
UInt32 Hour
Integral type presenting hour component.
Miscellaneous time characteristics.
UInt32 Nanosecond
Integral type presenting nanosecond component.
UInt64 Ticks
Integral type storing internal ticks.
ONIXS_CBOE_CFE_BOE_API void toStrAsYYYYMMDDHHMMSSmsec(std::string &, Timestamp)
Serializes timestamp in YYYYMMDDHHMMSSmsec format.
static ONIXS_BATS_BOE_CONSTEXPR Int32 nanosecondsPerMillisecond()
Returns number of nanoseconds in single millisecond.
Int32 Microseconds
Integral type for number of microseconds.
UInt32 Year
Integral type presenting year component.
void toStr(std::string &str, const FixedPointDecimal< Mantissa, Exponent > &number)
Serializes fixed-point decimal into a string.
Nanoseconds nanoseconds() const
Milliseconds milliseconds() const
static ONIXS_BATS_BOE_CONSTEXPR Int32 minutesPerHour()
Returns number of minutes in single hour.
Microsecond microsecond() const
Microsecond component of given time point.
Timestamp operator-(const Timestamp ×tamp, const TimeSpan &timeSpan)
Subtracts time interval from given time point.
void swap(TimeSpan &other) ONIXS_BATS_BOE_NOTHROW
Exchanges with given instance.
UInt32 Minute
Integral type presenting minute component.
Timestamp(Ticks ticks=0) ONIXS_BATS_BOE_NOTHROW
Initializes from number of ticks since epoch.
Int32 Milliseconds
Integral type for number of milliseconds.
bool operator>=(const FixedPointDecimal< Mantissa, Exponent > &left, const FixedPointDecimal< Mantissa, Exponent > &right)
Compares two fixed-point decimals.
UInt32 Second
Integral type presenting second component.
static ONIXS_BATS_BOE_CONSTEXPR Int64 nanosecondsPerHour()
Returns number of nanoseconds in single hour.
Timestamp date() const
Timestamp without a time part.
static ONIXS_BATS_BOE_CONSTEXPR Int32 nanosecondsPerSecond()
Returns number of nanoseconds in single second.
ONIXS_CBOE_CFE_BOE_API void toStrAsSDHHMMSSnsec(std::string &, TimeSpan)
OnixS::CboeCFE::Trading::BOE::Month::Enum Month
Type presenting month component.
bool operator==(const FixedPointDecimal< Mantissa, Exponent > &left, const FixedPointDecimal< Mantissa, Exponent > &right)
Compares two fixed-point decimals.
Millisecond millisecond() const
Millisecond component of given time point.
ONIXS_CBOE_CFE_BOE_API void toStrAsYYYYMMDDHHMMSSnsec(std::string &, Timestamp)
Serializes timestamp in YYYYMMDDHHMMSSnsec format.
ONIXS_CBOE_CFE_BOE_API void toStrAsHHMMSSmsec(std::string &, TimeSpan)
bool operator!=(const FixedPointDecimal< Mantissa, Exponent > &left, const FixedPointDecimal< Mantissa, Exponent > &right)
Compares two fixed-point decimals.
ONIXS_CBOE_CFE_BOE_API void toStrAsHHMMSS(std::string &, TimeSpan)
Second second() const
Second component of given time point.
TimeSpan time() const
Time part of timestamp.
static ONIXS_BATS_BOE_CONSTEXPR Int64 nanosecondsPerDay()
Returns number of nanoseconds in single day.
Timestamp(const Timestamp &other)
Initializes as copy of other instance.
Int32 Days
Integral type for number of days.
void swap(Timestamp &other)
Exchanges value with other instance.
Int32 Minutes
Integral type for number of minutes.
UInt32 Day
Integral type presenting day component.
Timestamp operator+(const Timestamp ×tamp, const TimeSpan &timeSpan)
Adds time interval to given time point.
Int32 Seconds
Integral type for number of seconds.
static ONIXS_BATS_BOE_CONSTEXPR Int32 nanosecondsPerMicrosecond()
Returns number of nanoseconds in single microsecond.
ONIXS_CBOE_CFE_BOE_API bool fromStr(Timestamp &, const char *, size_t)
De-serializes a timestamp from the given string.
Nanosecond nanosecond() const
Nanosecond component of given time point.
static ONIXS_BATS_BOE_CONSTEXPR Int32 secondsPerMinute()
Returns number of seconds in single minute.
Month month() const
Month component of given time point.
UInt32 Millisecond
Integral type presenting millisecond component.
TimeSpan(Ticks ticks=0) ONIXS_BATS_BOE_NOTHROW
Initializes timespan from given number of ticks.