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.

References WFMath::TimeDiff::operator+, WFMath::TimeDiff::operator+=, WFMath::TimeDiff::operator-(), and WFMath::TimeDiff::operator-=.

Referenced by epochStart().

Member Function Documentation

◆ epochStart()

TimeStamp WFMath::TimeStamp::epochStart ( )
static

set a TimeStamp to Jan 1, 1970

Definition at line 154 of file timestamp.cpp.

References TimeStamp().

◆ now()

TimeStamp WFMath::TimeStamp::now ( )
static

set a TimeStamp to the current time

Definition at line 130 of file timestamp.cpp.


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