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


Public Types | |
| enum | locus_formats { LONG_YEAR = 0x1, SHORT_YEAR = 0x2 } |
| Enumerates the ways to show the year. More... | |
Public Member Functions | |
| time_locus (const clock_time &ct=clock_time(), const day_in_year &ytd=day_in_year(), int year_in=0) | |
| Constructs a location in time given its components. | |
| virtual void | pack (byte_array &packed_form) const |
| Packs a time_locus object into an array of bytes. | |
| virtual bool | unpack (byte_array &packed_form) |
| Unpacks a time_locus object from an array of bytes. | |
| bool | operator< (const time_locus &to_compare) const |
| Returns true if this time_locus is earlier than "to_compare". | |
| bool | operator== (const time_locus &to_compare) const |
| Returns true if this time_locus is equal to "to_compare". | |
| istring | text_form (int t=clock_time::MERIDIAN, int d=day_in_year::SHORT_MONTH, int y=LONG_YEAR) const |
| void | text_form (istring &to_stuff, int t=clock_time::MERIDIAN, int d=day_in_year::SHORT_MONTH, int y=LONG_YEAR) const |
| Prints out the time_locus given the way to print each component. | |
Static Public Member Functions | |
| static int | normalize (time_locus &to_fix) |
| Same as text_form() above, but stores into "to_stuff". normalizes the time_locus for its clock time and date. | |
Public Attributes | |
| int | year |
| The year, using the gregorian calendar. | |
It contains both a time of day and the day in the year.
Definition at line 173 of file earth_time.h.
Enumerates the ways to show the year.
| LONG_YEAR | default: full four digit year (problems in 9999). |
| SHORT_YEAR | use only last two digits of year. ugh--Y2K danger. |
Definition at line 194 of file earth_time.h.
| earth_time::time_locus::time_locus | ( | const clock_time & | ct = clock_time(), |
|
| const day_in_year & | ytd = day_in_year(), |
|||
| int | year_in = 0 | |||
| ) | [inline] |
| void earth_time::time_locus::pack | ( | byte_array & | packed_form | ) | const [virtual] |
Packs a time_locus object into an array of bytes.
Reimplemented from earth_time::clock_time.
Definition at line 231 of file earth_time.cpp.
References basis::attach(), pack(), and year.
Referenced by occurrence::pack().
| bool earth_time::time_locus::unpack | ( | byte_array & | packed_form | ) | [virtual] |
Unpacks a time_locus object from an array of bytes.
Reimplemented from earth_time::clock_time.
Definition at line 238 of file earth_time.cpp.
References basis::detach(), earth_time::day_in_year::unpack(), earth_time::clock_time::unpack(), and year.
Referenced by occurrence::unpack().
| bool earth_time::time_locus::operator< | ( | const time_locus & | to_compare | ) | const |
Returns true if this time_locus is earlier than "to_compare".
Definition at line 253 of file earth_time.cpp.
| bool earth_time::time_locus::operator== | ( | const time_locus & | to_compare | ) | const |
Returns true if this time_locus is equal to "to_compare".
Definition at line 262 of file earth_time.cpp.
References year.
| istring earth_time::time_locus::text_form | ( | int | t = clock_time::MERIDIAN, |
|
| int | d = day_in_year::SHORT_MONTH, |
|||
| int | y = LONG_YEAR | |||
| ) | const |
| void earth_time::time_locus::text_form | ( | istring & | to_stuff, | |
| int | t = clock_time::MERIDIAN, |
|||
| int | d = day_in_year::SHORT_MONTH, |
|||
| int | y = LONG_YEAR | |||
| ) | const |
Prints out the time_locus given the way to print each component.
Definition at line 269 of file earth_time.cpp.
References SHORT_YEAR, text_form(), text_form(), and year.
| int earth_time::time_locus::normalize | ( | time_locus & | to_fix | ) | [static] |
Same as text_form() above, but stores into "to_stuff". normalizes the time_locus for its clock time and date.
Definition at line 289 of file earth_time.cpp.
References earth_time::day_in_year::day_in_month, earth_time::day_in_year::normalize(), earth_time::clock_time::normalize(), and year.
The year, using the gregorian calendar.
Definition at line 176 of file earth_time.h.
Referenced by earth_time::convert(), normalize(), operator<(), operator==(), pack(), earth_time::set_time(), text_form(), unpack(), and earth_time::year_now().
1.5.1