Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

WFMath::TimeDiff Class Reference

The difference between two timestamps. More...

#include <timestamp.h>

List of all members.

Public Member Functions

 TimeDiff ()
 construct an uninitialized TimeDiff

 TimeDiff (long msec)
 construct a TimeDiff of a given number of milliseconds

long milliseconds () const
 Get the value of a TimeDiff in milliseconds.

std::pair< long, long > full_time () const
 Get the value of a TimeDiff in (seconds, microseconds).

TimeDiff operator- () const
 negate a TimeDiff


Friends

TimeDiff & operator+= (TimeDiff &, const TimeDiff &)
 increment a TimeDiff

TimeDiff & operator-= (TimeDiff &, const TimeDiff &)
 decrement a TimeDiff

TimeDiff operator+ (const TimeDiff &a, const TimeDiff &b)
 add two TimeDiff instances

TimeDiff operator- (const TimeDiff &a, const TimeDiff &b)
 subtract two TimeDiff instances

TimeStampoperator+= (TimeStamp &, const TimeDiff &)
 advance a TimeStamp by a TimeDiff

TimeStampoperator-= (TimeStamp &, const TimeDiff &)
 regress a TimeStamp by a TimeDiff

TimeStamp operator+ (const TimeStamp &a, const TimeDiff &msec)
 find the result of advancing a TimeStamp

TimeStamp operator- (const TimeStamp &a, const TimeDiff &msec)
 find the result of regressing a TimeStamp

TimeDiff operator- (const TimeStamp &a, const TimeStamp &b)
 find the time difference between two time stamps


Detailed Description

The difference between two timestamps.

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 (<, <=, >, >=, ==, !=).


Member Function Documentation

long WFMath::TimeDiff::milliseconds   const
 

Get the value of a TimeDiff in milliseconds.

WARNING! This function does not check for overflow, if the number of milliseconds is large


The documentation for this class was generated from the following file:
Generated on Wed May 28 09:20:34 2003 for WFMath by doxygen1.3-rc3