30ONIXS_CMEMDH_DATA_PACKING_BEGIN(1)
38 return 86400000000000ll;
44 return 3600000000000ll;
172 : ticks_(other.ticks_)
242 ticks_ += other.ticks_;
250 ticks_ -= other.ticks_;
258 ticks_ = other.ticks_;
266 std::swap(ticks_, other.ticks_);
346 throw std::invalid_argument(
"Unknown timespan format pattern specified. ");
356 toStr(str, timeSpan, format);
483 return static_cast<Hour>(
time().hours());
537 std::swap(sinceEpoch_, other.sinceEpoch_);
546 static Ticks toTicks(Year,
Month, Day, Hour, Minute, Second, Nanosecond);
550 static void toDate(Ticks, Year&,
Month&, Day&);
668 throw std::invalid_argument(
"Unknown timestamp format pattern specified. ");
678 toStr(str, timestamp, format);
689 return fromStr(ts, str.c_str(), str.size());
692ONIXS_CMEMDH_DATA_PACKING_END
#define ONIXS_CMEMDH_NAMESPACE_BEGIN
#define ONIXS_CMEMDH_LTWT
#define ONIXS_CMEMDH_LTWT_EXPORTED
#define ONIXS_CMEMDH_NAMESPACE_END
#define ONIXS_CMEMDH_EXPORTED
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.
TimeSpan(Ticks ticks=0)
Initializes timespan from given number of ticks.
Int32 Milliseconds
Integral type for number of milliseconds.
Ticks ticks() const
Number of ticks in given time interval.
TimeSpan & operator=(const TimeSpan &other)
Reinitializes as copy of given instance.
Int32 Minutes
Integral type for number of minutes.
TimeSpan(const TimeSpan &other)
Initializes instance as a copy of the other one.
Int32 seconds() const
Seconds component of time interval.
void swap(TimeSpan &other)
Exchanges with given instance.
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.
Ticks sinceEpoch() const
Number of nanoseconds since the Epoch (01-01-1970).
Month month() const
Month component of given time point.
Year year() const
Year component of given time point.
Day day() const
Day component of given time point.
UInt32 Hour
Integral type presenting hour component.
UInt32 Minute
Integral type presenting minute component.
Minute minute() const
Minute component of given time point.
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.
OnixS::CME::MDH::Month::Enum Month
Type presenting month component.
UInt64 Ticks
Integral type storing internal ticks.
TimeSpan time() const
Time part of timestamp.
Timestamp(Ticks ticks=0)
Initializes from number of ticks since epoch.
Second second() const
Second component of given time point.
UInt32 Microsecond
Integral type presenting 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.
void swap(Timestamp &other)
Exchanges value with other instance.
UInt32 Second
Integral type presenting second component.
UInt32 Day
Integral type presenting day component.
UInt32 Nanosecond
Integral type presenting nanosecond component.
UInt32 Year
Integral type presenting year component.
Millisecond millisecond() const
Millisecond component of given time point.
bool operator>(const FixedPointDecimal< Mantissa, Exponent > &left, const FixedPointDecimal< Mantissa, Exponent > &right)
Compares two fixed-point decimals.
bool operator!=(const FixedPointDecimal< Mantissa, Exponent > &left, const FixedPointDecimal< Mantissa, Exponent > &right)
Compares two fixed-point decimals.
bool fromStr(Decimal &, const Char *, size_t)
Deserializes a decimal number from the given text presentation.
bool operator<=(const FixedPointDecimal< Mantissa, Exponent > &left, const FixedPointDecimal< Mantissa, Exponent > &right)
Compares two fixed-point decimals.
void toStrAsYYYYMMDDHHMMSSmsec(std::string &, Timestamp)
Serializes timestamp in YYYYMMDDHHMMSSmsec format.
char Char
Character type alias.
void toStrAsHHMMSSmsec(std::string &, TimeSpan)
void toStrAsYYYYMMDDHHMMSS(std::string &, Timestamp)
Serializes timestamp in YYYYMMDDHHMMSS format.
bool operator==(const FixedPointDecimal< Mantissa, Exponent > &left, const FixedPointDecimal< Mantissa, Exponent > &right)
Compares two fixed-point decimals.
void toStrAsHHMMSS(std::string &, TimeSpan)
void toStr(std::string &, BookState::Enum)
Serializes book state value into a string.
Timestamp operator+(const Timestamp ×tamp, const TimeSpan &timeSpan)
Adds time interval to given time point.
void toStrAsYYYYMMDD(std::string &, Timestamp)
Serializes timestamp in YYYYMMDD format.
bool operator>=(const FixedPointDecimal< Mantissa, Exponent > &left, const FixedPointDecimal< Mantissa, Exponent > &right)
Compares two fixed-point decimals.
void toStrAsSDHHMMSSnsec(std::string &, TimeSpan)
bool operator<(const FixedPointDecimal< Mantissa, Exponent > &left, const FixedPointDecimal< Mantissa, Exponent > &right)
Compares two fixed-point decimals.
Timestamp operator-(const Timestamp ×tamp, const TimeSpan &timeSpan)
Subtracts time interval from given time point.
void toStrAsYYYYMMDDHHMMSSnsec(std::string &, Timestamp)
Serializes timestamp in YYYYMMDDHHMMSSnsec format.
Identifies months in year.
Enum
Identifies months in year.
Miscellaneous time characteristics.
static Int32 millisecondsPerSecond()
Returns number of milliseconds in single second.
static Int64 nanosecondsPerDay()
Returns number of nanoseconds in single day.
static Int32 minutesPerHour()
Returns number of minutes in single hour.
static Int32 hoursPerDay()
Returns number of hours in single day.
static Int64 nanosecondsPerMinute()
Returns number of nanoseconds in single minute.
static Int32 secondsPerMinute()
Returns number of seconds in single minute.
static Int32 microsecondsPerSecond()
Returns number of microseconds in single second.
static Int32 nanosecondsPerMillisecond()
Returns number of nanoseconds in single millisecond.
static Int32 nanosecondsPerSecond()
Returns number of nanoseconds in single second.
static Int32 nanosecondsPerMicrosecond()
Returns number of nanoseconds in single microsecond.
static Int64 nanosecondsPerHour()
Returns number of nanoseconds in single hour.