OnixS C++ Eurex T7 Market and Reference Data (EMDI, MDI, RDI, EOBI) Handlers 19.0.3
Users' manual and API documentation
Loading...
Searching...
No Matches
TimeSpan Class Reference

#include <OnixS/Eurex/MarketData/Timestamp.h>

Public Types

typedef Int64 Ticks
typedef Int32 Days
typedef Int32 Hours
typedef Int32 Minutes
typedef Int32 Seconds
typedef Int32 Milliseconds
typedef Int32 Microseconds
typedef Int32 Nanoseconds

Public Member Functions

 TimeSpan (Ticks ticks=0) noexcept
constexpr TimeSpan (Days days, Hours hours, Minutes minutes, Seconds seconds, Nanoseconds nanoseconds) noexcept
constexpr TimeSpan (Hours hours, Minutes minutes, Seconds seconds, Nanoseconds nanoseconds) noexcept
Days days () const
Hours hours () const
Int32 minutes () const
Int32 seconds () const
Milliseconds milliseconds () const
Microseconds microseconds () const
Nanoseconds nanoseconds () const
Ticks ticks () const
TimeSpanoperator+= (const TimeSpan &other)
TimeSpanoperator-= (const TimeSpan &other)
void swap (TimeSpan &other) noexcept

Detailed Description

Represents time interval. Used primarily to present time-only stamps and to measure time intervals between two timestamps.

Definition at line 117 of file Timestamp.h.

Member Typedef Documentation

◆ Days

typedef Int32 Days

Integral type for number of days.

Definition at line 124 of file Timestamp.h.

◆ Hours

typedef Int32 Hours

Integral type for number of hours.

Definition at line 127 of file Timestamp.h.

◆ Microseconds

Integral type for number of microseconds.

Definition at line 139 of file Timestamp.h.

◆ Milliseconds

Integral type for number of milliseconds.

Definition at line 136 of file Timestamp.h.

◆ Minutes

typedef Int32 Minutes

Integral type for number of minutes.

Definition at line 130 of file Timestamp.h.

◆ Nanoseconds

typedef Int32 Nanoseconds

Integral type for number of nanoseconds.

Definition at line 142 of file Timestamp.h.

◆ Seconds

typedef Int32 Seconds

Integral type for number of seconds.

Definition at line 133 of file Timestamp.h.

◆ Ticks

typedef Int64 Ticks

Integral type presenting internal ticks.

Definition at line 121 of file Timestamp.h.

Constructor & Destructor Documentation

◆ TimeSpan() [1/3]

TimeSpan ( Ticks ticks = 0)
inlineexplicitnoexcept

Initializes timespan from given number of ticks.

Definition at line 145 of file Timestamp.h.

◆ TimeSpan() [2/3]

TimeSpan ( Days days,
Hours hours,
Minutes minutes,
Seconds seconds,
Nanoseconds nanoseconds )
inlineconstexprnoexcept

Initializes with given set of values.

Input parameters are treated as quantities, but not as a time stamp. Therefore, there's no requirement to fit in a certain range like hours must fit into [0, 24) range. After initialization time span will be normalized.

Definition at line 157 of file Timestamp.h.

◆ TimeSpan() [3/3]

TimeSpan ( Hours hours,
Minutes minutes,
Seconds seconds,
Nanoseconds nanoseconds )
inlineconstexprnoexcept

Initializes with given set of values.

Input parameters are treated as quantities, but not as a time stamp. Therefore, there's no requirement to fit in a certain range like hours must fit into [0, 24) range. After initialization time span will be normalized.

Definition at line 174 of file Timestamp.h.

Member Function Documentation

◆ days()

Days days ( ) const
inline

Days component of time interval. Whole number of days in time interval.

Definition at line 185 of file Timestamp.h.

◆ hours()

Hours hours ( ) const
inline

Hours component of time interval. Values are in range from -23 through 23.

Definition at line 195 of file Timestamp.h.

◆ microseconds()

Microseconds microseconds ( ) const
inline

Microseconds component of time interval. Values are in range from -999999 through 999999.

Definition at line 243 of file Timestamp.h.

◆ milliseconds()

Milliseconds milliseconds ( ) const
inline

Milliseconds component of time interval. Values are in range from -999 through 999.

Definition at line 231 of file Timestamp.h.

◆ minutes()

Int32 minutes ( ) const
inline

Minutes component of time interval. Values are in range from -59 through 59.

Definition at line 207 of file Timestamp.h.

◆ nanoseconds()

Nanoseconds nanoseconds ( ) const
inline

Nanoseconds component of time interval. Values are in range from -999999999 through 999999999.

Definition at line 250 of file Timestamp.h.

◆ operator+=()

TimeSpan & operator+= ( const TimeSpan & other)
inline

Adds time interval to current one.

Definition at line 267 of file Timestamp.h.

◆ operator-=()

TimeSpan & operator-= ( const TimeSpan & other)
inline

Subtracts time interval from current one.

Definition at line 276 of file Timestamp.h.

◆ seconds()

Int32 seconds ( ) const
inline

Seconds component of time interval. Values are in range from -59 through 59.

Definition at line 219 of file Timestamp.h.

◆ swap()

void swap ( TimeSpan & other)
inlinenoexcept

Exchanges with given instance.

Definition at line 285 of file Timestamp.h.

◆ ticks()

Ticks ticks ( ) const
inline

Number of ticks in given time interval.

Ticks are the lowest time quantity used to measure time intervals. In current implementation ticks are nanoseconds.

Definition at line 260 of file Timestamp.h.