feisty meow concerns codebase
2.140
|
A specific point in time as represented by a 24 hour clock. More...
#include <earth_time.h>
Public Types | |
enum | time_formats { MERIDIAN = 0x1 , MILITARY = 0x2 , NO_AM_PM = 0x4 , SECONDS = 0x8 , MILLISECONDS = 0x10 } |
An enumeration of time formatting modes used when printing the time. More... | |
Public Member Functions | |
clock_time (time_number h=0, time_number m=0, time_number s=0, time_number ms=0, time_number us=0) | |
Constructs a clock_time object given all the parts. More... | |
~clock_time () | |
int | packed_size () const |
Estimates the space needed for the packed structure. More... | |
virtual void | pack (basis::byte_array &packed_form) const |
Packs a clock time into an array of bytes. More... | |
virtual bool | unpack (basis::byte_array &packed_form) |
Unpacks a clock time from an array of bytes. More... | |
bool | operator< (const clock_time &to_compare) const |
Returns true if this clock_time is earlier than "to_compare". More... | |
bool | operator== (const clock_time &to_compare) const |
Returns true if this clock_time is equal to "to_compare". More... | |
basis::astring | text_form (int how=MERIDIAN) const |
Prints the clock_time according to "how". More... | |
void | text_form (basis::astring &to_stuff, int how=MERIDIAN) const |
Prints the time into "to_stuff" given "how". More... | |
Static Public Member Functions | |
static time_number | normalize (clock_time &to_fix) |
Public Attributes | |
time_number | hour |
The hour represented in military time: 0 through 23. More... | |
time_number | minute |
The number of minutes after the hour. More... | |
time_number | second |
The number of seconds after the current minute. More... | |
time_number | millisecond |
The number of milliseconds elapsed in this second. More... | |
time_number | microsecond |
Number of microseconds elapsed in this millisecond. More... | |
A specific point in time as represented by a 24 hour clock.
Definition at line 84 of file earth_time.h.
An enumeration of time formatting modes used when printing the time.
Definition at line 112 of file earth_time.h.
|
inline |
Constructs a clock_time object given all the parts.
Definition at line 94 of file earth_time.h.
|
inline |
Definition at line 97 of file earth_time.h.
|
static |
Definition at line 144 of file earth_time.cpp.
References hour, limit_value, microsecond, millisecond, minute, and second.
bool timely::clock_time::operator< | ( | const clock_time & | to_compare | ) | const |
Returns true if this clock_time is earlier than "to_compare".
Definition at line 86 of file earth_time.cpp.
References EASY_LT, hour, microsecond, millisecond, minute, and second.
bool timely::clock_time::operator== | ( | const clock_time & | to_compare | ) | const |
Returns true if this clock_time is equal to "to_compare".
Definition at line 96 of file earth_time.cpp.
References hour, microsecond, millisecond, minute, and second.
|
virtual |
Packs a clock time into an array of bytes.
Implements basis::packable.
Reimplemented in timely::time_locus.
Definition at line 63 of file earth_time.cpp.
References basis::attach().
|
inlinevirtual |
Estimates the space needed for the packed structure.
Implements basis::packable.
Reimplemented in timely::time_locus.
Definition at line 99 of file earth_time.h.
References structures::PACKED_SIZE_INT32.
Referenced by timely::time_locus::packed_size().
void timely::clock_time::text_form | ( | basis::astring & | to_stuff, |
int | how = MERIDIAN |
||
) | const |
Prints the time into "to_stuff" given "how".
note that "to_stuff" will be appended to; the existing contents are retained.
Definition at line 112 of file earth_time.cpp.
Prints the clock_time according to "how".
"how" is a combination of time_formats.
Definition at line 105 of file earth_time.cpp.
|
virtual |
Unpacks a clock time from an array of bytes.
Implements basis::packable.
Reimplemented in timely::time_locus.
Definition at line 72 of file earth_time.cpp.
References basis::detach().
time_number timely::clock_time::hour |
The hour represented in military time: 0 through 23.
Definition at line 87 of file earth_time.h.
Referenced by timely::convert(), normalize(), operator<(), operator==(), and timely::time_control::set_time().
time_number timely::clock_time::microsecond |
Number of microseconds elapsed in this millisecond.
Definition at line 91 of file earth_time.h.
Referenced by timely::convert(), normalize(), operator<(), and operator==().
time_number timely::clock_time::millisecond |
The number of milliseconds elapsed in this second.
Definition at line 90 of file earth_time.h.
Referenced by timely::convert(), normalize(), operator<(), and operator==().
time_number timely::clock_time::minute |
The number of minutes after the hour.
Definition at line 88 of file earth_time.h.
Referenced by timely::convert(), normalize(), operator<(), operator==(), and timely::time_control::set_time().
time_number timely::clock_time::second |
The number of seconds after the current minute.
Definition at line 89 of file earth_time.h.
Referenced by timely::convert(), normalize(), operator<(), operator==(), and timely::time_control::set_time().