feisty meow concerns codebase  2.140
timely Namespace Reference

#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
 

Detailed Description

#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>

Typedef Documentation

◆ time_number

Definition at line 31 of file earth_time.h.

Enumeration Type Documentation

◆ days

Enumerator
SUNDAY 
MONDAY 
TUESDAY 
WEDNESDAY 
THURSDAY 
FRIDAY 
SATURDAY 

Definition at line 33 of file earth_time.h.

◆ months

Enumerator
JANUARY 
FEBRUARY 
MARCH 
APRIL 
MAY 
JUNE 
JULY 
AUGUST 
SEPTEMBER 
OCTOBER 
NOVEMBER 
DECEMBER 

Definition at line 41 of file earth_time.h.

◆ 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.

Function Documentation

◆ convert()

◆ date_now()

day_in_year timely::date_now ( )

what day on the calendar is it?

Definition at line 394 of file earth_time.cpp.

References now().

◆ day_name()

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().

◆ day_now()

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().

◆ greenwich_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.

◆ limit_day_of_month()

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().

◆ month_name()

const char * timely::month_name ( months  to_name)

Returns the name of the month "to_name".

Definition at line 410 of file earth_time.cpp.

References APRIL, AUGUST, DECEMBER, FEBRUARY, JANUARY, JULY, JUNE, MARCH, MAY, NOVEMBER, OCTOBER, and SEPTEMBER.

Referenced by timely::day_in_year::text_form().

◆ month_now()

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().

◆ now()

◆ short_month_name()

const char * timely::short_month_name ( months  to_name)

Returns a shorter, constant-length (3 characters) month name.

Definition at line 429 of file earth_time.cpp.

References APRIL, AUGUST, DECEMBER, FEBRUARY, JANUARY, JULY, JUNE, MARCH, MAY, NOVEMBER, OCTOBER, and SEPTEMBER.

Referenced by timely::day_in_year::text_form().

◆ time_now()

clock_time timely::time_now ( )

what time is it?

Definition at line 386 of file earth_time.cpp.

References now().

◆ timer_driver_private_handler()

void timely::timer_driver_private_handler ( int  signal_seen)

◆ year_now()

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.

Variable Documentation

◆ __rollover_point

const double timely::__rollover_point = 2.0 * MAXINT32

Definition at line 118 of file time_stamp.cpp.

Referenced by timely::time_stamp::rolling_uptime().

◆ APPROX_DAYS_IN_YEAR

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.

◆ days_in_month

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().

◆ DAYS_IN_YEAR

const time_number timely::DAYS_IN_YEAR = 365

Number of days in a standard year.

Definition at line 68 of file earth_time.h.

◆ HOURS_IN_DAY

const time_number timely::HOURS_IN_DAY = 24

Number of hours in a day.

Definition at line 65 of file earth_time.h.

◆ INITIAL_TIMER_GRANULARITY

const int timely::INITIAL_TIMER_GRANULARITY = 14

◆ julian_days_in_month

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.

◆ julian_leap_days_in_month

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.

◆ leap_days_in_month

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().

◆ LEAP_DAYS_IN_YEAR

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.

◆ LONG_TIME

const int timely::LONG_TIME = 1 * HOUR_ms

Definition at line 56 of file timer_driver.cpp.

◆ MAX_TIMER_PREDICTION

const int timely::MAX_TIMER_PREDICTION = 140

Definition at line 47 of file timer_driver.cpp.

Referenced by timely::timer_driver::handle_system_timer().

◆ MINUTES_IN_DAY

const time_number timely::MINUTES_IN_DAY = 1440

Number of minutes in a day.

Definition at line 66 of file earth_time.h.

◆ MINUTES_IN_HOUR

const time_number timely::MINUTES_IN_HOUR = 60

Number of minutes in an hour.

Definition at line 63 of file earth_time.h.

◆ OUR_SIGNAL

const int timely::OUR_SIGNAL = SIGUSR2

◆ PAUSE_TIME

const int timely::PAUSE_TIME = 200

Definition at line 52 of file timer_driver.cpp.

Referenced by timely::timer_driver::~timer_driver().

◆ SECONDS_IN_DAY

const time_number timely::SECONDS_IN_DAY = 86400

Number of seconds in a day.

Definition at line 67 of file earth_time.h.

◆ SECONDS_IN_HOUR

const time_number timely::SECONDS_IN_HOUR = 3600

Number of seconds in an hour.

Definition at line 64 of file earth_time.h.

◆ SECONDS_IN_MINUTE

const time_number timely::SECONDS_IN_MINUTE = 60

Number of seconds in one minute.

Definition at line 62 of file earth_time.h.