Represents time spans up to microsecond resolution. More...

#include <tntdb/cxxtools/timespan.h>

Inheritance diagram for cxxtools::Timespan:
cxxtools::WeakTimespan< Resolution > cxxtools::WeakTimespan< 1 >

Public Member Functions

 Timespan (int64_t microseconds=0)
 Creates a Timespan.
 Timespan (long seconds, long microseconds)
 Creates a Timespan.
 Timespan (int days, int hours, int minutes, int seconds, int microseconds)
 Creates a Timespan.
bool operator== (const Timespan &ts) const
bool operator!= (const Timespan &ts) const
bool operator> (const Timespan &ts) const
bool operator>= (const Timespan &ts) const
bool operator< (const Timespan &ts) const
bool operator<= (const Timespan &ts) const
Timespan operator+ (const Timespan &d) const
Timespan operator- (const Timespan &d) const
Timespanoperator+= (const Timespan &d)
Timespanoperator-= (const Timespan &d)
Timespan operator- () const
double totalDays () const
 Returns the total number of hours.
double totalHours () const
 Returns the total number of hours.
double totalMinutes () const
 Returns the total number of minutes.
double totalSeconds () const
 Returns the total number of seconds.
double totalMSecs () const
 Returns the total number of milliseconds.
int64_t totalUSecs () const
 Returns the total number of microseconds.

Static Public Member Functions

static Timespan gettimeofday ()
 returns the current time as a timespan value.

Detailed Description

Represents time spans up to microsecond resolution.

Constructor & Destructor Documentation

cxxtools::Timespan::Timespan ( int64_t  microseconds = 0)
inlineexplicit

Creates a Timespan.

cxxtools::Timespan::Timespan ( long  seconds,
long  microseconds 
)
inline

Creates a Timespan.

Useful for creating a Timespan from a struct timeval.

cxxtools::Timespan::Timespan ( int  days,
int  hours,
int  minutes,
int  seconds,
int  microseconds 
)
inline

Creates a Timespan.

Member Function Documentation

static Timespan cxxtools::Timespan::gettimeofday ( )
static

returns the current time as a timespan value.

bool cxxtools::Timespan::operator!= ( const Timespan ts) const
inline
Timespan cxxtools::Timespan::operator+ ( const Timespan d) const
inline
Timespan& cxxtools::Timespan::operator+= ( const Timespan d)
inline
Timespan cxxtools::Timespan::operator- ( const Timespan d) const
inline
Timespan cxxtools::Timespan::operator- ( ) const
inline
Timespan& cxxtools::Timespan::operator-= ( const Timespan d)
inline
bool cxxtools::Timespan::operator< ( const Timespan ts) const
inline
bool cxxtools::Timespan::operator<= ( const Timespan ts) const
inline
bool cxxtools::Timespan::operator== ( const Timespan ts) const
inline
bool cxxtools::Timespan::operator> ( const Timespan ts) const
inline
bool cxxtools::Timespan::operator>= ( const Timespan ts) const
inline
double cxxtools::Timespan::totalDays ( ) const
inline

Returns the total number of hours.

double cxxtools::Timespan::totalHours ( ) const
inline

Returns the total number of hours.

double cxxtools::Timespan::totalMinutes ( ) const
inline

Returns the total number of minutes.

double cxxtools::Timespan::totalMSecs ( ) const
inline

Returns the total number of milliseconds.

double cxxtools::Timespan::totalSeconds ( ) const
inline

Returns the total number of seconds.

int64_t cxxtools::Timespan::totalUSecs ( ) const
inline

Returns the total number of microseconds.


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