#include <earth_time.h>
Inheritance diagram for earth_time::clock_time:


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 (int h=0, int m=0, int s=0, int ms=0, int us=0) | |
| Constructs a clock_time object given all the parts. | |
| virtual void | pack (byte_array &packed_form) const |
| Packs a clock time into an array of bytes. | |
| virtual bool | unpack (byte_array &packed_form) |
| Unpacks a clock time from an array of bytes. | |
| bool | operator< (const clock_time &to_compare) const |
| Returns true if this clock_time is earlier than "to_compare". | |
| bool | operator== (const clock_time &to_compare) const |
| Returns true if this clock_time is equal to "to_compare". | |
| istring | text_form (int how=MERIDIAN) const |
| Prints the clock_time according to "how". | |
| void | text_form (istring &to_stuff, int how=MERIDIAN) const |
| Prints the time into "to_stuff" given "how". | |
Static Public Member Functions | |
| static int | normalize (clock_time &to_fix) |
Public Attributes | |
| int | hour |
| The hour represented in military time: 0 through 23. | |
| int | minute |
| The number of minutes after the hour. | |
| int | second |
| The number of seconds after the current minute. | |
| int | millisecond |
| The number of milliseconds elapsed in this second. | |
| int | microsecond |
| Number of microseconds elapsed in this millisecond. | |
Definition at line 76 of file earth_time.h.
An enumeration of time formatting modes used when printing the time.
Definition at line 101 of file earth_time.h.
| earth_time::clock_time::clock_time | ( | int | h = 0, |
|
| int | m = 0, |
|||
| int | s = 0, |
|||
| int | ms = 0, |
|||
| int | us = 0 | |||
| ) | [inline] |
| void earth_time::clock_time::pack | ( | byte_array & | packed_form | ) | const [virtual] |
Packs a clock time into an array of bytes.
Implements packable.
Reimplemented in earth_time::time_locus.
Definition at line 47 of file earth_time.cpp.
References basis::attach(), hour, microsecond, millisecond, minute, and second.
| bool earth_time::clock_time::unpack | ( | byte_array & | packed_form | ) | [virtual] |
Unpacks a clock time from an array of bytes.
Implements packable.
Reimplemented in earth_time::time_locus.
Definition at line 56 of file earth_time.cpp.
References basis::detach(), hour, microsecond, millisecond, minute, and second.
Referenced by earth_time::time_locus::unpack().
| bool earth_time::clock_time::operator< | ( | const clock_time & | to_compare | ) | const |
Returns true if this clock_time is earlier than "to_compare".
Definition at line 70 of file earth_time.cpp.
References EASY_LT, hour, microsecond, millisecond, minute, and second.
| bool earth_time::clock_time::operator== | ( | const clock_time & | to_compare | ) | const |
Returns true if this clock_time is equal to "to_compare".
Definition at line 80 of file earth_time.cpp.
References hour, microsecond, millisecond, minute, and second.
| istring earth_time::clock_time::text_form | ( | int | how = MERIDIAN |
) | const |
Prints the clock_time according to "how".
"how" is a combination of time_formats.
Definition at line 89 of file earth_time.cpp.
Referenced by run_test_27().
| void earth_time::clock_time::text_form | ( | istring & | 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 96 of file earth_time.cpp.
References hour, MERIDIAN, MILITARY, millisecond, MILLISECONDS, minute, second, and SECONDS.
| int earth_time::clock_time::normalize | ( | clock_time & | to_fix | ) | [static] |
Definition at line 128 of file earth_time.cpp.
References hour, limit_value, microsecond, millisecond, minute, and second.
Referenced by earth_time::time_locus::normalize().
The hour represented in military time: 0 through 23.
Definition at line 79 of file earth_time.h.
Referenced by earth_time::convert(), normalize(), operator<(), operator==(), pack(), earth_time::set_time(), text_form(), and unpack().
The number of minutes after the hour.
Definition at line 80 of file earth_time.h.
Referenced by earth_time::convert(), normalize(), operator<(), operator==(), pack(), earth_time::set_time(), text_form(), and unpack().
The number of seconds after the current minute.
Definition at line 81 of file earth_time.h.
Referenced by earth_time::convert(), normalize(), operator<(), operator==(), pack(), earth_time::set_time(), text_form(), and unpack().
The number of milliseconds elapsed in this second.
Definition at line 82 of file earth_time.h.
Referenced by earth_time::convert(), normalize(), operator<(), operator==(), pack(), text_form(), and unpack().
Number of microseconds elapsed in this millisecond.
Definition at line 83 of file earth_time.h.
Referenced by earth_time::convert(), normalize(), operator<(), operator==(), pack(), and unpack().
1.5.1