OnixS C++ Eurex T7 Market and Reference Data Interface (EMDI, RDI, EOBI) Handlers  8.0.0
API documentation
TimeSpan Class Reference

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

Collaboration diagram for TimeSpan:

Public Member Functions

 TimeSpan ()
 
 TimeSpan (int hours, int minutes, int seconds, int nanoseconds=0)
 
 TimeSpan (int days, int hours, int minutes, int seconds, int nanoseconds)
 
 TimeSpan (long long totalSeconds, int nanoseconds)
 
 TimeSpan (const TimeSpan &other)
 
long long totalSeconds () const
 
int days () const
 
int hours () const
 
int minutes () const
 
int seconds () const
 
int milliseconds () const
 
int microseconds () const
 
int nanoseconds () const
 
bool operator== (const TimeSpan &other) const
 
bool operator!= (const TimeSpan &other) const
 
bool operator< (const TimeSpan &other) const
 
bool operator> (const TimeSpan &other) const
 
TimeSpanoperator+= (const TimeSpan &other)
 
TimeSpanoperator-= (const TimeSpan &other)
 
TimeSpanoperator= (const TimeSpan &other)
 
void toString (std::string &str, TimeSpanFormat format=TimeSpanFormats::SDHHMMSSnsec) const
 
std::string toString (TimeSpanFormat format=TimeSpanFormats::SDHHMMSSnsec) const
 

Static Public Member Functions

static TimeSpan deserialize (const std::string &str)
 

Static Public Attributes

static const TimeSpan Zero
 

Detailed Description

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

Definition at line 52 of file TimeSpan.h.

Constructor & Destructor Documentation

TimeSpan ( )

Initializes zero span.

Definition at line 65 of file TimeSpan.cpp.

TimeSpan ( int  hours,
int  minutes,
int  seconds,
int  nanoseconds = 0 
)

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 70 of file TimeSpan.cpp.

TimeSpan ( int  days,
int  hours,
int  minutes,
int  seconds,
int  nanoseconds 
)

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 81 of file TimeSpan.cpp.

TimeSpan ( long long  totalSeconds,
int  nanoseconds 
)

Initializes time interval from total number seconds and its fractional (nanosecond) part.

Definition at line 93 of file TimeSpan.cpp.

TimeSpan ( const TimeSpan other)

Initializes as clone of other instance.

Definition at line 105 of file TimeSpan.cpp.

Member Function Documentation

int days ( ) const

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

Definition at line 113 of file TimeSpan.cpp.

TimeSpan deserialize ( const std::string &  str)
static

De-serializes time interval from its text presentation.

Definition at line 243 of file TimeSpan.cpp.

int hours ( ) const

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

Definition at line 119 of file TimeSpan.cpp.

int microseconds ( ) const

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

Definition at line 143 of file TimeSpan.cpp.

int milliseconds ( ) const

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

Definition at line 137 of file TimeSpan.cpp.

int minutes ( ) const

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

Definition at line 125 of file TimeSpan.cpp.

int nanoseconds ( ) const
inline

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

Definition at line 157 of file TimeSpan.h.

bool operator!= ( const TimeSpan other) const

Compares with other instance for in-equality.

Definition at line 156 of file TimeSpan.cpp.

TimeSpan & operator+= ( const TimeSpan other)

Adds time interval to current one.

Definition at line 177 of file TimeSpan.cpp.

TimeSpan & operator-= ( const TimeSpan other)

Subtracts time interval from current one.

Definition at line 189 of file TimeSpan.cpp.

bool operator< ( const TimeSpan other) const

Checks whether time interval less than other one.

Definition at line 163 of file TimeSpan.cpp.

TimeSpan & operator= ( const TimeSpan other)

Re-assigns time interval from other one.

Definition at line 200 of file TimeSpan.cpp.

bool operator== ( const TimeSpan other) const

Compares with other instance for equality.

Definition at line 149 of file TimeSpan.cpp.

bool operator> ( const TimeSpan other) const

Checks whether time interval greater than other one.

Definition at line 170 of file TimeSpan.cpp.

int seconds ( ) const

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

Definition at line 131 of file TimeSpan.cpp.

void toString ( std::string &  str,
TimeSpanFormat  format = TimeSpanFormats::SDHHMMSSnsec 
) const

Serializes time stamp into text presentation using specified time-span presentation format.

Definition at line 210 of file TimeSpan.cpp.

std::string toString ( TimeSpanFormat  format = TimeSpanFormats::SDHHMMSSnsec) const
inline

Serializes time stamp into text presentation using specified time-span presentation format.

Definition at line 162 of file TimeSpan.h.

long long totalSeconds ( ) const
inline

Whole number of seconds in time interval.

Definition at line 152 of file TimeSpan.h.

Member Data Documentation

const TimeSpan Zero
static

Time interval of zero length.

Definition at line 145 of file TimeSpan.h.


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