#include <time_value.h>
Public Member Functions | |
~time_value () | |
time_value () | |
time_value (long seconds, long microseconds=0) | |
time_value (int seconds) | |
time_value (double seconds) | |
time_value (const char *str) | |
time_value (const time_value &) | |
time_value & | operator= (const time_value &rhs) |
time_value & | operator= (double) |
time_value & | operator= (long sec) |
long | get_seconds () const |
operator double () const | |
int | get_time_of_day () |
std::string | representation () const |
time_value & | operator+= (const time_value &) |
time_value | operator+ (const time_value &) const |
time_value & | operator-= (const time_value &) |
time_value | operator- (const time_value &) const |
time_value | operator- () const |
time_value & | operator*= (double) |
time_value | operator* (double) const |
time_value & | operator*= (long) |
time_value | operator* (long) const |
bool | operator== (const time_value &) const |
bool | operator!= (const time_value &) const |
bool | operator< (const time_value &) const |
bool | operator<= (const time_value &) const |
bool | operator> (const time_value &) const |
bool | operator>= (const time_value &) const |
Static Public Member Functions | |
static time_value | now () |
Private Member Functions | |
bool | in_normal_form () const |
The time_value class is used to represent a time in seconds and microseconds.
Definition at line 30 of file time_value.h.
plumbing::time_value::~time_value | ( | ) | [inline] |
The destructor.
It isn't virtual. Thou shalt not derive from this class.
Definition at line 39 of file time_value.h.
plumbing::time_value::time_value | ( | ) | [inline] |
The default constructor.
The object will be initialized to exactly 0.0 seconds.
Definition at line 46 of file time_value.h.
plumbing::time_value::time_value | ( | long | seconds, | |
long | microseconds = 0 | |||
) |
The constructor.
seconds | The time value in seconds | |
microseconds | The time value in microseconds. If this isn't in normal form (0..999999) it will be normalized - which is why this method is not inline. |
Definition at line 29 of file time_value.cc.
plumbing::time_value::time_value | ( | int | seconds | ) | [inline] |
The constructor.
seconds | The time value in seconds |
Definition at line 66 of file time_value.h.
plumbing::time_value::time_value | ( | double | seconds | ) |
The constructor.
seconds | The value in seconds. It will be rounded to the closest microsecond. |
Definition at line 63 of file time_value.cc.
plumbing::time_value::time_value | ( | const char * | str | ) |
The constructor.
str | String to parse for time value. Will be set to zero on error. |
Definition at line 101 of file time_value.cc.
plumbing::time_value::time_value | ( | const time_value & | rhs | ) |
The copy constructor.
Definition at line 93 of file time_value.cc.
long plumbing::time_value::get_seconds | ( | ) | const [inline] |
The get_seconds method is used to obtain the number of whole seconds in this time value.
Definition at line 125 of file time_value.h.
int plumbing::time_value::get_time_of_day | ( | ) |
The get_time_of_day method may be used to set the value of this time to be the value returned by the settimeofdae system call.
Definition at line 281 of file time_value.cc.
bool plumbing::time_value::in_normal_form | ( | ) | const [inline, private] |
The in_normal_form method is used within asserts to guarantee that the internal data structure contains value values.
Definition at line 184 of file time_value.h.
plumbing::time_value plumbing::time_value::now | ( | ) | [static] |
The now class method may be used to obtain the current time.
Definition at line 291 of file time_value.cc.
plumbing::time_value::operator double | ( | ) | const |
The double operator may be used to cast a time value into a real number of seconds.
Definition at line 119 of file time_value.cc.
bool plumbing::time_value::operator!= | ( | const time_value & | rhs | ) | const |
Definition at line 189 of file time_value.cc.
plumbing::time_value plumbing::time_value::operator* | ( | long | x | ) | const |
Definition at line 261 of file time_value.cc.
plumbing::time_value plumbing::time_value::operator* | ( | double | x | ) | const |
Definition at line 245 of file time_value.cc.
plumbing::time_value & plumbing::time_value::operator*= | ( | long | x | ) |
Definition at line 253 of file time_value.cc.
plumbing::time_value & plumbing::time_value::operator*= | ( | double | x | ) |
Definition at line 237 of file time_value.cc.
plumbing::time_value plumbing::time_value::operator+ | ( | const time_value & | rhs | ) | const |
Definition at line 144 of file time_value.cc.
plumbing::time_value & plumbing::time_value::operator+= | ( | const time_value & | rhs | ) |
Definition at line 127 of file time_value.cc.
plumbing::time_value plumbing::time_value::operator- | ( | ) | const |
Definition at line 269 of file time_value.cc.
plumbing::time_value plumbing::time_value::operator- | ( | const time_value & | rhs | ) | const |
Definition at line 171 of file time_value.cc.
plumbing::time_value & plumbing::time_value::operator-= | ( | const time_value & | rhs | ) |
Definition at line 154 of file time_value.cc.
bool plumbing::time_value::operator< | ( | const time_value & | rhs | ) | const |
Definition at line 197 of file time_value.cc.
bool plumbing::time_value::operator<= | ( | const time_value & | rhs | ) | const |
Definition at line 207 of file time_value.cc.
time_value& plumbing::time_value::operator= | ( | long | sec | ) | [inline] |
The assignment operator.
Definition at line 114 of file time_value.h.
plumbing::time_value & plumbing::time_value::operator= | ( | double | sec | ) |
The assignment operator.
Definition at line 109 of file time_value.cc.
time_value& plumbing::time_value::operator= | ( | const time_value & | rhs | ) | [inline] |
The assignment operator.
Definition at line 95 of file time_value.h.
bool plumbing::time_value::operator== | ( | const time_value & | rhs | ) | const |
Definition at line 181 of file time_value.cc.
bool plumbing::time_value::operator> | ( | const time_value & | rhs | ) | const |
Definition at line 217 of file time_value.cc.
bool plumbing::time_value::operator>= | ( | const time_value & | rhs | ) | const |
Definition at line 227 of file time_value.cc.
std::string plumbing::time_value::representation | ( | ) | const |
The representation method is used to form a human-readable representation of the time value.
Definition at line 301 of file time_value.cc.