timely Namespace Reference

A set of methods for rendering calendrical and clock times. 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...

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

int limit_day_of_month (int &day, int days_in_month, int days_in_prev_month)
time_locus convert (const tm &to_convert, int ms)
time_locus now ()
 returns our current locus in the time continuum.
time_locus greenwich_now ()
 returns Greenwich Mean Time (their now).
clock_time time_now ()
 what time is it?
days day_now ()
 Returns the current local day.
months month_now ()
 returns the local month.
int year_now ()
 what year is it?
day_in_year date_now ()
 what day on the calendar is it?
const char * day_name (days to_name)
 Returns the name of the day "to_name".
const char * month_name (months to_name)
 Returns the name of the month "to_name".
const char * short_month_name (months to_name)
 Returns a shorter, constant-length (3 characters) month name.
void timer_driver_private_handler (int signal_seen)

Variables

const int 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.
const int 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.
const int 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.
const int 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.
const int SECONDS_IN_MINUTE = 60
 Number of seconds in one minute.
const int MINUTES_IN_HOUR = 60
 Number of minutes in an hour.
const int HOURS_IN_DAY = 24
 Number of hours in a day.
const int DAYS_IN_YEAR = 365
 Number of days in a standard year.
const int LEAP_DAYS_IN_YEAR = 366
 Number of days in a leap year.
const double APPROX_DAYS_IN_YEAR = 365.2424
 A more accurate measure of the number of days in a year.
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

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>


Enumeration Type Documentation

Enumerator:
SUNDAY 
MONDAY 
TUESDAY 
WEDNESDAY 
THURSDAY 
FRIDAY 
SATURDAY 

Definition at line 28 of file earth_time.h.

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

Definition at line 36 of file earth_time.h.

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 68 of file earth_time.h.


Function Documentation

time_locus timely::convert ( const tm &  to_convert,
int  ms 
)
day_in_year timely::date_now (  ) 

what day on the calendar is it?

const char * timely::day_name ( days  to_name  ) 

Returns the name of the day "to_name".

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

days timely::day_now (  ) 

Returns the current local day.

time_locus timely::greenwich_now (  ) 

returns Greenwich Mean Time (their now).

int timely::limit_day_of_month ( int &  day,
int  days_in_month,
int  days_in_prev_month 
)

Definition at line 199 of file earth_time.cpp.

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

const char * timely::month_name ( months  to_name  ) 

Returns the name of the month "to_name".

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

months timely::month_now (  ) 

returns the local month.

time_locus timely::now (  ) 
const char * timely::short_month_name ( months  to_name  ) 

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

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

clock_time timely::time_now (  ) 

what time is it?

void timely::timer_driver_private_handler ( int  signal_seen  ) 
int timely::year_now (  ) 

what year is it?


Variable Documentation

const double timely::__rollover_point = 2.0 * MAXINT32

Definition at line 110 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 62 of file earth_time.h.

const int 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 31 of file earth_time.cpp.

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

const int timely::DAYS_IN_YEAR = 365

Number of days in a standard year.

Definition at line 60 of file earth_time.h.

const int timely::HOURS_IN_DAY = 24

Number of hours in a day.

Definition at line 59 of file earth_time.h.

const int 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 37 of file earth_time.cpp.

const int 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 41 of file earth_time.cpp.

const int 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 34 of file earth_time.cpp.

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

const int timely::LEAP_DAYS_IN_YEAR = 366

Number of days in a leap year.

Definition at line 61 of file earth_time.h.

const int timely::LONG_TIME = 1 * HOUR_ms

Definition at line 56 of file timer_driver.cpp.

Definition at line 47 of file timer_driver.cpp.

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

const int timely::MINUTES_IN_HOUR = 60

Number of minutes in an hour.

Definition at line 58 of file earth_time.h.

const int timely::OUR_SIGNAL = SIGUSR2
const int timely::PAUSE_TIME = 200

Definition at line 52 of file timer_driver.cpp.

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

const int timely::SECONDS_IN_MINUTE = 60

Number of seconds in one minute.

Definition at line 57 of file earth_time.h.

Generated on Sat Jan 28 04:26:03 2012 for hoople2 project by  doxygen 1.6.3