feisty meow concerns codebase
2.140
|
#include <time.h> More...
Classes | |
class | clock_time |
A specific point in time as represented by a 24 hour clock. More... | |
class | day_in_year |
An object that represents a particular day in a year. More... | |
class | time_locus |
An object that represents a particular point in time. More... | |
class | stopwatch |
A class for measuring event durations in real time. More... | |
class | time_control |
Provides some functions that affect time, or ones perception of time. More... | |
class | time_stamp |
Represents a point in time relative to the operating system startup time. More... | |
class | timeable |
timeable is the base for objects that can be hooked into timer events. More... | |
class | timer_driver |
Provides platform-independent timer support. More... | |
Typedefs | |
typedef basis::signed_long | time_number |
Enumerations | |
enum | days { SUNDAY , MONDAY , TUESDAY , WEDNESDAY , THURSDAY , FRIDAY , SATURDAY } |
enum | months { JANUARY , FEBRUARY , MARCH , APRIL , MAY , JUNE , JULY , AUGUST , SEPTEMBER , OCTOBER , NOVEMBER , DECEMBER } |
enum | time_zones { LOCAL_ZONE , GREENWICH_ZONE } |
An enumeration of time zones, both relative and absolute. More... | |
Functions | |
time_number | limit_day_of_month (time_number &day, time_number days_in_month, time_number days_in_prev_month) |
time_locus | convert (time_number seconds, time_number useconds, const tm &cal_values) |
time_locus | now () |
returns our current locus in the time continuum. More... | |
time_locus | greenwich_now () |
returns Greenwich Mean Time (their now). More... | |
clock_time | time_now () |
what time is it? More... | |
days | day_now () |
Returns the current local day. More... | |
months | month_now () |
returns the local month. More... | |
time_number | year_now () |
what year is it? More... | |
day_in_year | date_now () |
what day on the calendar is it? More... | |
const char * | day_name (days to_name) |
Returns the name of the day "to_name". More... | |
const char * | month_name (months to_name) |
Returns the name of the month "to_name". More... | |
const char * | short_month_name (months to_name) |
Returns a shorter, constant-length (3 characters) month name. More... | |
void | timer_driver_private_handler (int signal_seen) |
Variables | |
const time_number | days_in_month [12] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } |
The number of days in each month in the standard year. More... | |
const time_number | leap_days_in_month [12] = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } |
The number of days in each month in a leap year. More... | |
const time_number | julian_days_in_month [12] = { 31, 29, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30 } |
Number of days in each month based on the julian calendar. More... | |
const time_number | julian_leap_days_in_month [12] = { 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30 } |
Number of days in each month of a leap year in the julian calendar. More... | |
const time_number | SECONDS_IN_MINUTE = 60 |
Number of seconds in one minute. More... | |
const time_number | MINUTES_IN_HOUR = 60 |
Number of minutes in an hour. More... | |
const time_number | SECONDS_IN_HOUR = 3600 |
Number of seconds in an hour. More... | |
const time_number | HOURS_IN_DAY = 24 |
Number of hours in a day. More... | |
const time_number | MINUTES_IN_DAY = 1440 |
Number of minutes in a day. More... | |
const time_number | SECONDS_IN_DAY = 86400 |
Number of seconds in a day. More... | |
const time_number | DAYS_IN_YEAR = 365 |
Number of days in a standard year. More... | |
const time_number | LEAP_DAYS_IN_YEAR = 366 |
Number of days in a leap year. More... | |
const double | APPROX_DAYS_IN_YEAR = 365.2424 |
A more accurate measure of the number of days in a year. More... | |
const double | __rollover_point = 2.0 * MAXINT32 |
const int | INITIAL_TIMER_GRANULARITY = 14 |
const int | MAX_TIMER_PREDICTION = 140 |
const int | PAUSE_TIME = 200 |
const int | LONG_TIME = 1 * HOUR_ms |
const int | OUR_SIGNAL = SIGUSR2 |
#include <time.h>
A set of methods for rendering calendrical and clock times.
It is based on the Gregorian calendar currently in use by the USA and other countries.
#include <basis/astring.h> include <basis/contracts.h> include <basis/definitions.h>
Definition at line 31 of file earth_time.h.
enum timely::days |
Enumerator | |
---|---|
SUNDAY | |
MONDAY | |
TUESDAY | |
WEDNESDAY | |
THURSDAY | |
FRIDAY | |
SATURDAY |
Definition at line 33 of file earth_time.h.
enum timely::months |
Enumerator | |
---|---|
JANUARY | |
FEBRUARY | |
MARCH | |
APRIL | |
MAY | |
JUNE | |
JULY | |
AUGUST | |
SEPTEMBER | |
OCTOBER | |
NOVEMBER | |
DECEMBER |
Definition at line 41 of file earth_time.h.
enum timely::time_zones |
An enumeration of time zones, both relative and absolute.
Enumerator | |
---|---|
LOCAL_ZONE | The time zone this computer is configured to report. |
GREENWICH_ZONE | The time zone of Greenwich Mean Time. |
Definition at line 76 of file earth_time.h.
time_locus timely::convert | ( | time_number | seconds, |
time_number | useconds, | ||
const tm & | cal_values | ||
) |
Definition at line 326 of file earth_time.cpp.
References timely::day_in_year::day_in_month, timely::day_in_year::day_of_week, timely::day_in_year::day_of_year, FUNCDEF, timely::clock_time::hour, LOG, timely::clock_time::microsecond, timely::clock_time::millisecond, timely::clock_time::minute, timely::day_in_year::month, basis::astring::s(), timely::clock_time::second, timely::time_locus::text_form_long(), and timely::time_locus::year.
Referenced by greenwich_now(), sockets::internet_address::ip_appropriate_number(), now(), structures::version::v_build(), structures::version::v_major(), structures::version::v_minor(), and structures::version::v_revision().
day_in_year timely::date_now | ( | ) |
const char * timely::day_name | ( | days | to_name | ) |
Returns the name of the day "to_name".
Definition at line 396 of file earth_time.cpp.
References FRIDAY, MONDAY, SATURDAY, SUNDAY, THURSDAY, TUESDAY, and WEDNESDAY.
Referenced by timely::day_in_year::text_form().
days timely::day_now | ( | ) |
Returns the current local day.
Definition at line 388 of file earth_time.cpp.
References timely::day_in_year::day_of_week, and now().
time_locus timely::greenwich_now | ( | ) |
returns Greenwich Mean Time (their now).
Definition at line 369 of file earth_time.cpp.
References convert(), FUNCDEF, LOG, and NULL_POINTER.
time_number timely::limit_day_of_month | ( | time_number & | day, |
time_number | days_in_month, | ||
time_number | days_in_prev_month | ||
) |
Definition at line 217 of file earth_time.cpp.
References days_in_month.
Referenced by timely::day_in_year::normalize().
const char * timely::month_name | ( | months | to_name | ) |
months timely::month_now | ( | ) |
returns the local month.
Definition at line 390 of file earth_time.cpp.
References timely::day_in_year::month, and now().
time_locus timely::now | ( | ) |
returns our current locus in the time continuum.
Definition at line 352 of file earth_time.cpp.
References convert(), FUNCDEF, LOG, and NULL_POINTER.
Referenced by org.gffs.cache.TimedOutLRUCache< KeyType, DataType >::clearStale(), date_now(), day_now(), octopi::octopus::evaluate(), org.gffs.cache.TimedOutLRUCache< KeyType, DataType >::get(), timely::timer_driver::handle_system_timer(), month_now(), timely::time_stamp::notarize(), filesystem::file_time::readable_text_form(), time_now(), and year_now().
const char * timely::short_month_name | ( | months | to_name | ) |
clock_time timely::time_now | ( | ) |
void timely::timer_driver_private_handler | ( | int | signal_seen | ) |
Definition at line 82 of file timer_driver.cpp.
References DEFINE_CLASS_NAME, FUNCDEF, LOG, OUR_SIGNAL, and program_wide_timer.
Referenced by timely::timer_driver::timer_driver().
time_number timely::year_now | ( | ) |
what year is it?
Definition at line 392 of file earth_time.cpp.
References now(), and timely::time_locus::year.
const double timely::__rollover_point = 2.0 * MAXINT32 |
Definition at line 118 of file time_stamp.cpp.
Referenced by timely::time_stamp::rolling_uptime().
const double timely::APPROX_DAYS_IN_YEAR = 365.2424 |
A more accurate measure of the number of days in a year.
This is the more accurate mean length of time in 24 hour days between vernal equinoxes. it's about 11 minutes shy of 365.25 days.
Definition at line 70 of file earth_time.h.
const time_number timely::days_in_month = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } |
The number of days in each month in the standard year.
Definition at line 48 of file earth_time.cpp.
Referenced by limit_day_of_month(), and timely::day_in_year::normalize().
const time_number timely::DAYS_IN_YEAR = 365 |
Number of days in a standard year.
Definition at line 68 of file earth_time.h.
const time_number timely::HOURS_IN_DAY = 24 |
Number of hours in a day.
Definition at line 65 of file earth_time.h.
const int timely::INITIAL_TIMER_GRANULARITY = 14 |
Definition at line 43 of file timer_driver.cpp.
Referenced by timely::timer_driver::handle_system_timer(), and timely::timer_driver::timer_driver().
const time_number timely::julian_days_in_month = { 31, 29, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30 } |
Number of days in each month based on the julian calendar.
Definition at line 54 of file earth_time.cpp.
const time_number timely::julian_leap_days_in_month = { 31, 30, 31, 30, 31, 30, 31, 30, 31, 30, 31, 30 } |
Number of days in each month of a leap year in the julian calendar.
Definition at line 58 of file earth_time.cpp.
const time_number timely::leap_days_in_month = { 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 } |
The number of days in each month in a leap year.
Definition at line 51 of file earth_time.cpp.
Referenced by timely::day_in_year::normalize().
const time_number timely::LEAP_DAYS_IN_YEAR = 366 |
Number of days in a leap year.
Definition at line 69 of file earth_time.h.
const int timely::LONG_TIME = 1 * HOUR_ms |
Definition at line 56 of file timer_driver.cpp.
const int timely::MAX_TIMER_PREDICTION = 140 |
Definition at line 47 of file timer_driver.cpp.
Referenced by timely::timer_driver::handle_system_timer().
const time_number timely::MINUTES_IN_DAY = 1440 |
Number of minutes in a day.
Definition at line 66 of file earth_time.h.
const time_number timely::MINUTES_IN_HOUR = 60 |
Number of minutes in an hour.
Definition at line 63 of file earth_time.h.
const int timely::OUR_SIGNAL = SIGUSR2 |
Definition at line 66 of file timer_driver.cpp.
Referenced by timely::timer_driver::timer_driver(), timer_driver_private_handler(), and timely::timer_driver::~timer_driver().
const int timely::PAUSE_TIME = 200 |
Definition at line 52 of file timer_driver.cpp.
Referenced by timely::timer_driver::~timer_driver().
const time_number timely::SECONDS_IN_DAY = 86400 |
Number of seconds in a day.
Definition at line 67 of file earth_time.h.
const time_number timely::SECONDS_IN_HOUR = 3600 |
Number of seconds in an hour.
Definition at line 64 of file earth_time.h.
const time_number timely::SECONDS_IN_MINUTE = 60 |
Number of seconds in one minute.
Definition at line 62 of file earth_time.h.