OnixS C++ FIX Engine 4.13.0
API Documentation
Loading...
Searching...
No Matches
TimeSpan Class Reference

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)
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 &)
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() [1/6]

TimeSpan ( )

Constructs an uninitialized instance.

◆ TimeSpan() [2/6]

TimeSpan ( TotalSeconds seconds,
Nanoseconds nanoseconds )

Initializes the TimeSpan from seconds and nanoseconds.

◆ TimeSpan() [3/6]

TimeSpan ( TotalSeconds seconds,
Picoseconds picoseconds )

Initializes the TimeSpan from seconds and picoseconds.

◆ TimeSpan() [4/6]

TimeSpan ( Hours hours,
Minutes minutes,
Seconds seconds )

Initializes the TimeSpan from hours, minutes and seconds.

◆ TimeSpan() [5/6]

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

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

◆ TimeSpan() [6/6]

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

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

Member Function Documentation

◆ absolute()

TimeSpan absolute ( ) const

The current absolute time span.

◆ days()

Days days ( ) const

Current days.

◆ hours()

Hours hours ( ) const

Current hours.

◆ max()

TimeSpan max ( )
static

The maximum value of the time span.

◆ microseconds()

Microseconds microseconds ( ) const

Current microseconds.

◆ milliseconds()

Milliseconds milliseconds ( ) const

Current milliseconds.

◆ min()

TimeSpan min ( )
static

The minimum value of the time span.

◆ minutes()

Minutes minutes ( ) const

Current minutes.

◆ nanoseconds()

Nanoseconds nanoseconds ( ) const

Current nanoseconds.

◆ normalize()

void normalize ( )
protected

◆ operator!=()

bool operator!= ( const TimeSpan & ) const

Compares the instance with another one.

◆ operator+=()

TimeSpan & operator+= ( const TimeSpan & )

Increases the instance by another one.

◆ operator-=()

TimeSpan & operator-= ( const TimeSpan & )

Decreases the instance by another one.

◆ operator<()

bool operator< ( const TimeSpan & ) const

Tests whether the instance is less than another one.

◆ operator==()

bool operator== ( const TimeSpan & ) const

Compares the instance with another one.

◆ parse()

TimeSpan parse ( const std::string & )
static

Parses time span from its text presentation.

◆ picoseconds()

Picoseconds picoseconds ( ) const
inline

Current nanoseconds.

Definition at line 213 of file TimeSpan.h.

◆ seconds()

Seconds seconds ( ) const

Current seconds.

◆ toString() [1/2]

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

◆ toString() [2/2]

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

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

◆ totalSeconds()

TotalSeconds totalSeconds ( ) const
inline

The total number of seconds.

Definition at line 206 of file TimeSpan.h.

◆ zero()

TimeSpan zero ( )
static

The zero value of the time span.

◆ TimeManager

friend class TimeManager
friend

Definition at line 196 of file TimeSpan.h.

Member Data Documentation

◆ picoseconds_

Picoseconds picoseconds_
protected

Definition at line 199 of file TimeSpan.h.

◆ seconds_

TotalSeconds seconds_
protected

Definition at line 198 of file TimeSpan.h.