wfmath 1.0.3
A math library for the Worldforge system.
WFMath::TimeStamp Class Reference

A time stamp. More...

#include <timestamp.h>

Public Member Functions

 TimeStamp ()
 Construct an uninitialized TimeStamp. More...
 
bool isValid () const
 

Static Public Member Functions

static TimeStamp now ()
 set a TimeStamp to the current time More...
 
static TimeStamp epochStart ()
 set a TimeStamp to Jan 1, 1970 More...
 

Friends

bool operator< (const TimeStamp &a, const TimeStamp &b)
 
bool operator== (const TimeStamp &a, const TimeStamp &b)
 
std::ostream & operator<< (std::ostream &os, const TimeStamp &)
 
std::istream & operator>> (std::istream &is, TimeStamp &)
 
TimeStampoperator+= (TimeStamp &, const TimeDiff &)
 
TimeStampoperator-= (TimeStamp &, const TimeDiff &)
 
TimeStamp operator+ (const TimeStamp &a, const TimeDiff &msec)
 
TimeStamp operator- (const TimeStamp &a, const TimeDiff &msec)
 
TimeDiff operator- (const TimeStamp &a, const TimeStamp &b)
 

Detailed Description

A time stamp.

This class implements the 'generic' subset of the interface in the fake class Shape, with the exception of the stream operators. It also has the full set of comparison operators (<, <=, >, >=, ==, !=).

Definition at line 117 of file timestamp.h.

Constructor & Destructor Documentation

◆ TimeStamp()

WFMath::TimeStamp::TimeStamp ( )
inline

Construct an uninitialized TimeStamp.

Definition at line 133 of file timestamp.h.

Member Function Documentation

◆ epochStart()

TimeStamp WFMath::TimeStamp::epochStart ( )
static

set a TimeStamp to Jan 1, 1970

Definition at line 154 of file timestamp.cpp.

◆ isValid()

bool WFMath::TimeStamp::isValid ( ) const
inline

Definition at line 142 of file timestamp.h.

◆ now()

TimeStamp WFMath::TimeStamp::now ( )
static

set a TimeStamp to the current time

Definition at line 130 of file timestamp.cpp.

Friends And Related Function Documentation

◆ operator+

TimeStamp operator+ ( const TimeStamp a,
const TimeDiff msec 
)
friend

Definition at line 212 of file timestamp.cpp.

◆ operator+=

TimeStamp & operator+= ( TimeStamp a,
const TimeDiff d 
)
friend

Definition at line 190 of file timestamp.cpp.

◆ operator- [1/2]

TimeStamp operator- ( const TimeStamp a,
const TimeDiff msec 
)
friend

Definition at line 218 of file timestamp.cpp.

◆ operator- [2/2]

TimeDiff operator- ( const TimeStamp a,
const TimeStamp b 
)
friend

Definition at line 224 of file timestamp.cpp.

◆ operator-=

TimeStamp & operator-= ( TimeStamp a,
const TimeDiff d 
)
friend

Definition at line 201 of file timestamp.cpp.

◆ operator<

bool operator< ( const TimeStamp a,
const TimeStamp b 
)
friend

Definition at line 176 of file timestamp.cpp.

◆ operator==

bool operator== ( const TimeStamp a,
const TimeStamp b 
)
friend

Definition at line 184 of file timestamp.cpp.


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