PPL
1.2
|
A class for representing and manipulating positive time intervals. More...
#include <Time_defs.hh>
Public Member Functions | |
Time () | |
Zero seconds. More... | |
Time (long centisecs) | |
Constructor taking a number of centiseconds. More... | |
Time (long s, long m) | |
Constructor with seconds and microseconds. More... | |
long | seconds () const |
Returns the number of whole seconds contained in the represented time interval. More... | |
long | microseconds () const |
Returns the number of microseconds that, when added to the number of seconds returned by seconds(), give the represent time interval. More... | |
Time & | operator+= (const Time &y) |
Adds y to *this . More... | |
Time & | operator-= (const Time &y) |
Subtracts y from *this ; if *this is shorter than y , *this is set to the null interval. More... | |
bool | OK () const |
Checks if all the invariants are satisfied. More... | |
Private Attributes | |
long | secs |
Number of seconds. More... | |
long | microsecs |
Number of microseconds. More... | |
Static Private Attributes | |
static const long | USECS_PER_SEC = 1000000L |
Number of microseconds in a second. More... | |
static const long | CSECS_PER_SEC = 100L |
Number of centiseconds in a second. More... | |
A class for representing and manipulating positive time intervals.
Definition at line 75 of file Time_defs.hh.
|
inline |
Zero seconds.
Definition at line 36 of file Time_inlines.hh.
References OK().
|
inlineexplicit |
Constructor taking a number of centiseconds.
Definition at line 42 of file Time_inlines.hh.
References OK().
|
inline |
Constructor with seconds and microseconds.
Definition at line 49 of file Time_inlines.hh.
References microsecs, OK(), secs, and USECS_PER_SEC.
|
inline |
Returns the number of microseconds that, when added to the number of seconds returned by seconds(), give the represent time interval.
Definition at line 65 of file Time_inlines.hh.
References microsecs.
Referenced by Parma_Polyhedra_Library::Implementation::Watchdog::operator<(), and Parma_Polyhedra_Library::Implementation::Watchdog::operator==().
bool Parma_Polyhedra_Library::Implementation::Watchdog::Time::OK | ( | ) | const |
Checks if all the invariants are satisfied.
Definition at line 30 of file Time.cc.
Referenced by Parma_Polyhedra_Library::Implementation::Watchdog::operator!=(), operator+=(), operator-=(), Parma_Polyhedra_Library::Implementation::Watchdog::operator<(), Parma_Polyhedra_Library::Implementation::Watchdog::operator==(), and Time().
Adds y
to *this
.
Definition at line 70 of file Time_inlines.hh.
References microsecs, OK(), secs, and USECS_PER_SEC.
Subtracts y
from *this
; if *this
is shorter than y
, *this
is set to the null interval.
Definition at line 84 of file Time_inlines.hh.
References microsecs, OK(), secs, and USECS_PER_SEC.
|
inline |
Returns the number of whole seconds contained in the represented time interval.
Definition at line 60 of file Time_inlines.hh.
References secs.
Referenced by Parma_Polyhedra_Library::Implementation::Watchdog::operator<(), and Parma_Polyhedra_Library::Implementation::Watchdog::operator==().
|
staticprivate |
Number of centiseconds in a second.
Definition at line 115 of file Time_defs.hh.
|
private |
Number of microseconds.
Definition at line 121 of file Time_defs.hh.
Referenced by microseconds(), operator+=(), operator-=(), and Time().
|
private |
Number of seconds.
Definition at line 118 of file Time_defs.hh.
Referenced by operator+=(), operator-=(), seconds(), and Time().
|
staticprivate |
Number of microseconds in a second.
Definition at line 112 of file Time_defs.hh.
Referenced by operator+=(), operator-=(), and Time().