24 #ifndef PPL_Time_defs_hh
25 #define PPL_Time_defs_hh 1
31 namespace Implementation {
42 bool operator<(
const Time& x,
const Time& y);
51 bool operator>(
const Time& x,
const Time& y);
60 Time
operator+(
const Time& x,
const Time& y);
66 Time
operator-(
const Time& x,
const Time& y);
81 explicit Time(
long centisecs);
126 #endif // !defined(PPL_Time_defs_hh)
long microseconds() const
Returns the number of microseconds that, when added to the number of seconds returned by seconds()...
static const long USECS_PER_SEC
Number of microseconds in a second.
Time & operator+=(const Time &y)
Adds y to *this.
Time operator+(const Time &x, const Time &y)
Returns the sum of x and y.
bool operator<(const Time &x, const Time &y)
Returns true if and only if x is shorter than y.
Time operator-(const Time &x, const Time &y)
Returns the difference of x and y or the null interval, if x is shorter than y.
A class for representing and manipulating positive time intervals.
bool operator==(const Time &x, const Time &y)
Returns true if and only if x and y are equal.
Time & operator-=(const Time &y)
Subtracts y from *this; if *this is shorter than y, *this is set to the null interval.
The entire library is confined to this namespace.
static const long CSECS_PER_SEC
Number of centiseconds in a second.
long secs
Number of seconds.
bool operator>(const Time &x, const Time &y)
Returns true if and only if x is longer than y.
long microsecs
Number of microseconds.
bool operator!=(const Time &x, const Time &y)
Returns true if and only if x and y are different.
bool operator>=(const Time &x, const Time &y)
Returns true if and only if x is longer than or equal to y.
long seconds() const
Returns the number of whole seconds contained in the represented time interval.
bool OK() const
Checks if all the invariants are satisfied.
bool operator<=(const Time &x, const Time &y)
Returns true if and only if x is shorter than or equal to y.