Public Member Functions | Static Public Member Functions | Static Public Attributes | Friends
icl_core::TimeSpan Class Reference

Repesents absolute times. More...

#include <TimeSpan.h>

Inheritance diagram for icl_core::TimeSpan:
Inheritance graph
[legend]

List of all members.

Public Member Functions

TimeSpanfromMSec (int64_t msec)
 Set the time span to msec milliseconds.
TimeSpanfromSec (int64_t sec)
 Set the time span to sec seconds.
TimeSpanfromUSec (int64_t usec)
 Set the time span to usec microseconds.
bool operator!= (const TimeSpan &other) const
TimeSpanoperator+= (const TimeSpan &span)
 Adds a TimeSpan.
TimeSpanoperator-= (const TimeSpan &span)
 Substracts a TimeSpan.
bool operator< (const TimeSpan &other) 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
 TimeSpan (int64_t sec=0, int32_t nsec=0)
 TimeSpan (const struct timespec &time_span)
 Constructs a time span from a struct timespec.
int64_t toMSec () const
 May result in an overflow if seconds are too large.
int64_t toNSec () const
int64_t toUSec () const
 May result in an overflow if seconds are too large.
int32_t tsNSec () const
int64_t tsSec () const
int32_t tsUSec () const

Static Public Member Functions

static TimeSpan createFromMSec (int64_t msec)
 Create a time span with msec milliseconds.
static TimeSpan createFromSec (int64_t sec)
 Create a time span with sec seconds.
static TimeSpan createFromUSec (int64_t usec)
 Create a time span with usec microseconds.

Static Public Attributes

static const TimeSpan cZERO

Friends

class TimeStamp

Detailed Description

Repesents absolute times.

Use this class whenever you want to deal with times, as it provides a number of operators and functions.

Definition at line 46 of file TimeSpan.h.


Constructor & Destructor Documentation

icl_core::TimeSpan::TimeSpan ( int64_t  sec = 0,
int32_t  nsec = 0 
) [explicit]

Constructs a time span from a second and nanosecond value.

Parameters:
secThe second part of the newly constructed time span.
nsecThe nanosecond part of the time span.

Definition at line 34 of file TimeSpan.cpp.

icl_core::TimeSpan::TimeSpan ( const struct timespec time_span)

Constructs a time span from a struct timespec.

Definition at line 38 of file TimeSpan.cpp.


Member Function Documentation

Create a time span with msec milliseconds.

Definition at line 92 of file TimeSpan.cpp.

Create a time span with sec seconds.

Definition at line 87 of file TimeSpan.cpp.

Create a time span with usec microseconds.

Definition at line 97 of file TimeSpan.cpp.

Set the time span to msec milliseconds.

Definition at line 71 of file TimeSpan.cpp.

Set the time span to sec seconds.

Definition at line 63 of file TimeSpan.cpp.

Set the time span to usec microseconds.

Definition at line 79 of file TimeSpan.cpp.

bool icl_core::TimeSpan::operator!= ( const TimeSpan other) const

Compares two variables of type TimeSpan.

Returns:
true if they are not equal.

Definition at line 118 of file TimeSpan.cpp.

TimeSpan & icl_core::TimeSpan::operator+= ( const TimeSpan span)

Adds a TimeSpan.

Definition at line 102 of file TimeSpan.cpp.

TimeSpan & icl_core::TimeSpan::operator-= ( const TimeSpan span)

Substracts a TimeSpan.

Definition at line 110 of file TimeSpan.cpp.

bool icl_core::TimeSpan::operator< ( const TimeSpan other) const

Compares two variables of type TimeSpan.

Returns:
true if the first one is earlier than the second one.

Definition at line 128 of file TimeSpan.cpp.

bool icl_core::TimeSpan::operator<= ( const TimeSpan other) const

Compares two variables of type TimeSpan.

Returns:
true if the first one is earlier than or equal to the second one.

Definition at line 138 of file TimeSpan.cpp.

bool icl_core::TimeSpan::operator== ( const TimeSpan other) const

Compares two variables of type TimeSpan.

Returns:
true if they are equal.

Definition at line 123 of file TimeSpan.cpp.

bool icl_core::TimeSpan::operator> ( const TimeSpan other) const

Compares two variables of type TimeSpan.

Returns:
true if the first one is later than the second one.

Definition at line 133 of file TimeSpan.cpp.

bool icl_core::TimeSpan::operator>= ( const TimeSpan other) const

Compares two variables of type TimeSpan.

Returns:
true if the first one is later than or equal to the second one.

Definition at line 143 of file TimeSpan.cpp.

May result in an overflow if seconds are too large.

Definition at line 163 of file TimeSpan.cpp.

Returns the timespan as nanoseconds. The conversion may result in an overflow if the seconds are too large.

Definition at line 173 of file TimeSpan.cpp.

May result in an overflow if seconds are too large.

Definition at line 168 of file TimeSpan.cpp.

Definition at line 153 of file TimeSpan.cpp.

Definition at line 148 of file TimeSpan.cpp.

Definition at line 158 of file TimeSpan.cpp.


Friends And Related Function Documentation

friend class TimeStamp [friend]

Definition at line 48 of file TimeSpan.h.


Member Data Documentation

Definition at line 159 of file TimeSpan.h.


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


fzi_icl_core
Author(s):
autogenerated on Thu Jun 6 2019 20:22:26