OnixS C++ FIX Engine  4.2.0
API Documentation
TimeSpan Class Reference

#include <OnixS/FIXEngine/FIX/TimeSpan.h>

Public Member Functions

 TimeSpan ()
 
 TimeSpan (TotalSeconds seconds, Nanoseconds nanoseconds)
 
 TimeSpan (TotalSeconds seconds, Picoseconds picoseconds)
 
 TimeSpan (Hours hours, Minutes minutes, Seconds seconds)
 
 TimeSpan (Days days, Hours hours, Minutes minutes, Seconds seconds, Nanoseconds nanoseconds)
 
 TimeSpan (Days days, Hours hours, Minutes minutes, Seconds seconds, Picoseconds picooseconds)
 
 TimeSpan (const TimeSpan &other)
 
TotalSeconds totalSeconds () const
 
Days days () const
 
Hours hours () const
 
Minutes minutes () const
 
Seconds seconds () const
 
Milliseconds milliseconds () const
 
Microseconds microseconds () const
 
Nanoseconds nanoseconds () const
 
Picoseconds picoseconds () const
 
TimeSpan absolute () const
 
bool operator== (const TimeSpan &) const
 
bool operator!= (const TimeSpan &) const
 
bool operator< (const TimeSpan &) const
 
TimeSpanoperator+= (const TimeSpan &)
 
TimeSpanoperator-= (const TimeSpan &)
 
TimeSpanoperator= (const TimeSpan &)
 
std::string toString (TimeSpanFormat::Enum=TimeSpanFormat::HHMMSSNsec) const
 
void toString (std::string &, TimeSpanFormat::Enum=TimeSpanFormat::HHMMSSNsec) const
 

Static Public Member Functions

static TimeSpan min ()
 
static TimeSpan max ()
 
static TimeSpan zero ()
 
static TimeSpan parse (const std::string &)
 

Protected Member Functions

void normalize ()
 

Protected Attributes

TotalSeconds seconds_
 
Picoseconds picoseconds_
 

Friends

class TimeManager
 

Detailed Description

Definition at line 93 of file TimeSpan.h.

Constructor & Destructor Documentation

TimeSpan ( )

Constructs uninitialized instance.

TimeSpan ( TotalSeconds  seconds,
Nanoseconds  nanoseconds 
)

Initializes TimeSpan from seconds and nanoseconds.

TimeSpan ( TotalSeconds  seconds,
Picoseconds  picoseconds 
)

Initializes TimeSpan from seconds and picoseconds.

TimeSpan ( Hours  hours,
Minutes  minutes,
Seconds  seconds 
)

Initializes TimeSpan from hours, minutes and seconds.

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

Initializes TimeSpan from days, hours, minutes, seconds and nanoseconds.

TimeSpan ( Days  days,
Hours  hours,
Minutes  minutes,
Seconds  seconds,
Picoseconds  picooseconds 
)

Initializes TimeSpan from days, hours, minutes, seconds and picoseconds.

TimeSpan ( const TimeSpan other)

Initializes TimeSpan from other instance.

Member Function Documentation

TimeSpan absolute ( ) const

Current absolute time span.

Days days ( ) const

Current days.

Hours hours ( ) const

Current hours.

static TimeSpan max ( )
static

Maximum value of the time span.

Microseconds microseconds ( ) const

Current microseconds.

Milliseconds milliseconds ( ) const

Current milliseconds.

static TimeSpan min ( )
static

Minimum value of the time span.

Minutes minutes ( ) const

Current minutes.

Nanoseconds nanoseconds ( ) const

Current nanoseconds.

void normalize ( )
protected
bool operator!= ( const TimeSpan ) const

Compares instance with another one.

TimeSpan& operator+= ( const TimeSpan )

Increases instance by another one.

TimeSpan& operator-= ( const TimeSpan )

Decreases instance by another one.

bool operator< ( const TimeSpan ) const

Tests whether instance is less than another one.

TimeSpan& operator= ( const TimeSpan )

Assigns current time span from other instance.

bool operator== ( const TimeSpan ) const

Compares instance with another one.

static TimeSpan parse ( const std::string &  )
static

Parses time span from its text presentation.

Picoseconds picoseconds ( ) const
inline

Current nanoseconds.

Definition at line 219 of file TimeSpan.h.

Seconds seconds ( ) const

Current seconds.

std::string toString ( TimeSpanFormat::Enum  = TimeSpanFormat::HHMMSSNsec) const

Returns time span text presentation in requested format ("HH:MM:SS.sssssssss" by default).

void toString ( std::string &  ,
TimeSpanFormat::Enum  = TimeSpanFormat::HHMMSSNsec 
) const
TotalSeconds totalSeconds ( ) const
inline

Total number of seconds.

Definition at line 212 of file TimeSpan.h.

static TimeSpan zero ( )
static

Zero value of the time span.

Friends And Related Function Documentation

friend class TimeManager
friend

Definition at line 202 of file TimeSpan.h.

Member Data Documentation

Picoseconds picoseconds_
protected

Definition at line 205 of file TimeSpan.h.

TotalSeconds seconds_
protected

Definition at line 204 of file TimeSpan.h.


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