Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields  

clawsoft::Date Class Reference

#include <Date.h>

Inheritance diagram for clawsoft::Date:

Inheritance graph
[legend]
Collaboration diagram for clawsoft::Date:

Collaboration graph
[legend]

Detailed Description

This class implements the basic date/time handling facilities.


Public Methods

 Date ()
 Default constructor, this will initialize the value of unixtime.

 Date (Uint32 __unixtime)
 This constructor will initialize every member to its unixtime equivalent.

 Date (int __y, int __m, int __dw, int __dm, int __h, int __mi, int __s=0)
 This will initialize every one of this class members to the following values:
year: __y
month: __m
day of week: __dw
day of month: __dm
hour: __h
minute: __mi
second: __s.


virtual time_t getCurrentTime ()
 This method will update the value of unixtime and all the other broken-time values.

const Uint32 unixTime ()
 This methid will give you the numeric representation of the date in the unix time format.

virtual const StringtoString ()
 This will convert the current date object to the following format: YYYY-MM-DD HH:MM:SS.

const char * getClassName ()
 Returns the name of the current class.


Static Public Methods

int installedCPUs ()
 This will return how many CPUs are installed in the system.

double cpuSpeed ()
 This will return the CPU speed in megahertz.

int totalMemory ()
 Will return the total amount of system memory.

int freeMemory ()
 Will return the total amount of free system memory.

void usleep (Uint32 usec)
 Will freeze the software for usec microseconds.


Data Fields

int hour
 This member stores the hour 0-23.

int hr12hour
 This member will show the hour using non-24hr format.

int minute
 This member stores the minute 0-59.

int second
 This member stores the second 0-59.

int dayofweek
 This member stores the day of the week e.g Monday, Tuesday, Wednesday...

int dayofyear
 This member stores the days elapsed since january first of the current year.

int dayofmonth
 This member stores the day of the month 1-31.

int month
 This member stores the month 1-12.

int year
 This member stores the year 1960 - ????

int hr12ampm
 This member knows whether the timing is AM or PM.


Protected Methods

void setClassName (const char *n)
 Call this method when you need to set the name of the class you're creating, typically in it's constructor, remember that you must set the classname for every class you create, that way you can have more information while debugging.


Protected Attributes

time_t unixtime
 This variable stores the time queried by getCurrentTime();.

String drep
 This member holds the String representation of the current Date.


Constructor & Destructor Documentation

clawsoft::Date::Date  
 

Default constructor, this will initialize the value of unixtime.

clawsoft::Date::Date Uint32    __unixtime
 

This constructor will initialize every member to its unixtime equivalent.

Unixtime is the number of seconds since January 1st 1970

clawsoft::Date::Date int    __y,
int    __m,
int    __dw,
int    __dm,
int    __h,
int    __mi,
int    __s = 0
 

This will initialize every one of this class members to the following values:
year: __y
month: __m
day of week: __dw
day of month: __dm
hour: __h
minute: __mi
second: __s.


Member Function Documentation

double clawsoft::System::cpuSpeed   [static, inherited]
 

This will return the CPU speed in megahertz.

int clawsoft::System::freeMemory   [static, inherited]
 

Will return the total amount of free system memory.

const char * clawsoft::Object::getClassName   [inherited]
 

Returns the name of the current class.

time_t clawsoft::Date::getCurrentTime   [virtual]
 

This method will update the value of unixtime and all the other broken-time values.

int clawsoft::System::installedCPUs   [static, inherited]
 

This will return how many CPUs are installed in the system.

void clawsoft::Object::setClassName const char *    n [protected, inherited]
 

Call this method when you need to set the name of the class you're creating, typically in it's constructor, remember that you must set the classname for every class you create, that way you can have more information while debugging.

const String & clawsoft::Date::toString   [virtual]
 

This will convert the current date object to the following format: YYYY-MM-DD HH:MM:SS.

Reimplemented in clawsoft::Time.

int clawsoft::System::totalMemory   [static, inherited]
 

Will return the total amount of system memory.

const Uint32 clawsoft::Date::unixTime  
 

This methid will give you the numeric representation of the date in the unix time format.

void clawsoft::System::usleep Uint32    usec [static, inherited]
 

Will freeze the software for usec microseconds.


Field Documentation

int clawsoft::Date::dayofmonth
 

This member stores the day of the month 1-31.

int clawsoft::Date::dayofweek
 

This member stores the day of the week e.g Monday, Tuesday, Wednesday...

int clawsoft::Date::dayofyear
 

This member stores the days elapsed since january first of the current year.

String clawsoft::Date::drep [protected]
 

This member holds the String representation of the current Date.

int clawsoft::Date::hour
 

This member stores the hour 0-23.

int clawsoft::Date::hr12ampm
 

This member knows whether the timing is AM or PM.

int clawsoft::Date::hr12hour
 

This member will show the hour using non-24hr format.

int clawsoft::Date::minute
 

This member stores the minute 0-59.

int clawsoft::Date::month
 

This member stores the month 1-12.

int clawsoft::Date::second
 

This member stores the second 0-59.

time_t clawsoft::Date::unixtime [protected]
 

This variable stores the time queried by getCurrentTime();.

int clawsoft::Date::year
 

This member stores the year 1960 - ????


The documentation for this class was generated from the following files:

Authors:

Juan V. Guerrero
Jannette C. Mejia
Juan C. Guevara

Powered by:

SourceForgeLogo