OnixS C++ CME Streamlined Market Data Handler  1.0.0.4
API documentation
TimeSpan Class Reference

#include <Time.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)
 
 TimeSpan (Days days, Hours hours, Minutes minutes, Seconds seconds, Nanoseconds nanoseconds)
 
 TimeSpan (Hours hours, Minutes minutes, Seconds seconds, Nanoseconds nanoseconds)
 
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)
 
TimeSpanoperator= (const TimeSpan &other)
 
void swap (TimeSpan &other)
 

Detailed Description

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

Definition at line 104 of file Time.h.

Member Typedef Documentation

typedef Int32 Days

Integral type for number of days.

Definition at line 111 of file Time.h.

typedef Int32 Hours

Integral type for number of hours.

Definition at line 114 of file Time.h.

Integral type for number of microseconds.

Definition at line 126 of file Time.h.

Integral type for number of milliseconds.

Definition at line 123 of file Time.h.

typedef Int32 Minutes

Integral type for number of minutes.

Definition at line 117 of file Time.h.

typedef Int32 Nanoseconds

Integral type for number of nanoseconds.

Definition at line 129 of file Time.h.

typedef Int32 Seconds

Integral type for number of seconds.

Definition at line 120 of file Time.h.

typedef Int64 Ticks

Integral type presenting internal ticks.

Definition at line 108 of file Time.h.

Constructor & Destructor Documentation

TimeSpan ( Ticks  ticks = 0)
inlineexplicit

Initializes timespan from given number of ticks.

Definition at line 132 of file Time.h.

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

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 144 of file Time.h.

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

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 170 of file Time.h.

Member Function Documentation

Days days ( ) const
inline

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

Definition at line 188 of file Time.h.

Hours hours ( ) const
inline

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

Definition at line 198 of file Time.h.

Microseconds microseconds ( ) const
inline

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

Definition at line 246 of file Time.h.

Milliseconds milliseconds ( ) const
inline

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

Definition at line 234 of file Time.h.

Int32 minutes ( ) const
inline

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

Definition at line 210 of file Time.h.

Nanoseconds nanoseconds ( ) const
inline

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

Definition at line 258 of file Time.h.

TimeSpan& operator+= ( const TimeSpan other)
inline

Adds time interval to current one.

Definition at line 278 of file Time.h.

TimeSpan& operator-= ( const TimeSpan other)
inline

Subtracts time interval from current one.

Definition at line 288 of file Time.h.

TimeSpan& operator= ( const TimeSpan other)
inline

Reinitializes as copy of given instance.

Definition at line 298 of file Time.h.

Int32 seconds ( ) const
inline

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

Definition at line 222 of file Time.h.

void swap ( TimeSpan other)
inline

Exchanges with given instance.

Definition at line 308 of file Time.h.

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 271 of file Time.h.


The documentation for this class was generated from the following file: