Repesents time values. More...
#include <TimeBase.h>
Public Member Functions | |
int64_t | days () const |
Use this function if you want to express the time in days. More... | |
int64_t | hours () const |
int32_t | microSeconds () const |
int32_t | milliSeconds () const |
int64_t | minutes () const |
int32_t | nanoSeconds () const |
void | normalizeTime () |
bool | operator!= (const TimeBase &other) const |
TimeBase & | operator+= (const TimeBase &span) |
Adds a TimeSpan. More... | |
TimeBase & | operator-= (const TimeBase &span) |
Substracts a TimeSpan. More... | |
bool | operator< (const TimeBase &other) const |
bool | operator<= (const TimeBase &other) const |
bool | operator== (const TimeBase &other) const |
bool | operator> (const TimeBase &other) const |
bool | operator>= (const TimeBase &other) const |
int64_t | seconds () const |
struct timespec | systemTimespec () const |
int32_t | tbNSec () const |
Returns the nanosecond part of this time. More... | |
int64_t | tbSec () const |
Returns the second part of this time. More... | |
struct timespec | timespec () const |
Protected Member Functions | |
void | fromTimespec (const struct timespec &time) |
TimeBase (int64_t secs=0, int32_t nsecs=0) | |
TimeBase (const struct timespec &time) | |
Static Protected Member Functions | |
static TimeBase | maxTime () |
Protected Attributes | |
int32_t | nsecs |
int64_t | secs |
Repesents time values.
You should not use this class directly. Use the subclasses TimeStamp and TimeSpan instead.
Definition at line 59 of file TimeBase.h.
Definition at line 239 of file TimeBase.cpp.
|
protected |
Definition at line 246 of file TimeBase.cpp.
|
inline |
Use this function if you want to express the time in days.
Definition at line 107 of file TimeBase.h.
|
protected |
Definition at line 253 of file TimeBase.cpp.
|
inline |
Use this function if you want to express the time in hours, minutes and seconds.
Definition at line 115 of file TimeBase.h.
|
staticprotected |
Definition at line 232 of file TimeBase.cpp.
|
inline |
Use this function if you want to express the time in hours, minutes, seconds, milliseconds and microseconds.
Definition at line 147 of file TimeBase.h.
|
inline |
Use this function if you want to express the time in hours, minutes, seconds and milliseconds.
Definition at line 139 of file TimeBase.h.
|
inline |
Use this function if you want to express the time in hours, minutes and seconds.
Definition at line 123 of file TimeBase.h.
|
inline |
Use this function if you want to express the time in hours, minutes, seconds, milliseconds, microseconds and nanoseconds.
Definition at line 155 of file TimeBase.h.
void icl_core::TimeBase::normalizeTime | ( | ) |
Normalizes this time so that the nanosecond part is between 0 and sign(sec)999999999.
Definition at line 83 of file TimeBase.cpp.
bool icl_core::TimeBase::operator!= | ( | const TimeBase & | other | ) | const |
Compares two variables of type TimeBase.
true
if they are not equal. Definition at line 53 of file TimeBase.cpp.
Adds a TimeSpan.
Definition at line 37 of file TimeBase.cpp.
Substracts a TimeSpan.
Definition at line 45 of file TimeBase.cpp.
bool icl_core::TimeBase::operator< | ( | const TimeBase & | other | ) | const |
Compares two variables of type TimeBase.
true
if the first one is earlier than the second one. Definition at line 63 of file TimeBase.cpp.
bool icl_core::TimeBase::operator<= | ( | const TimeBase & | other | ) | const |
Compares two variables of type TimeBase.
true
if the first one is earlier than or equal to the second one. Definition at line 73 of file TimeBase.cpp.
bool icl_core::TimeBase::operator== | ( | const TimeBase & | other | ) | const |
Compares two variables of type TimeBase.
true
if they are equal. Definition at line 58 of file TimeBase.cpp.
bool icl_core::TimeBase::operator> | ( | const TimeBase & | other | ) | const |
Compares two variables of type TimeBase.
true
if the first one is later than the second one. Definition at line 68 of file TimeBase.cpp.
bool icl_core::TimeBase::operator>= | ( | const TimeBase & | other | ) | const |
Compares two variables of type TimeBase.
true
if the first one is later than or equal to the second one. Definition at line 78 of file TimeBase.cpp.
|
inline |
Use this function if you want to express the time in hours, minutes and seconds.
Definition at line 131 of file TimeBase.h.
struct timespec icl_core::TimeBase::systemTimespec | ( | ) | const |
Convert to struct timespec
. The base time for this conversion is the system clock, which may differ from the world clock on some systems.
Definition at line 121 of file TimeBase.cpp.
|
inline |
Returns the nanosecond part of this time.
Definition at line 163 of file TimeBase.h.
|
inline |
Returns the second part of this time.
Definition at line 161 of file TimeBase.h.
struct timespec icl_core::TimeBase::timespec | ( | ) | const |
Convert to struct timespec
. The base time for this conversion is the global clock (i.e. 0 = 1970-01-01 00:00:00).
Definition at line 113 of file TimeBase.cpp.
|
protected |
Definition at line 289 of file TimeBase.h.
|
protected |
Definition at line 288 of file TimeBase.h.