xvr2::Chronometer Class Reference

#include <Chronometer.h>

Inheritance diagram for xvr2::Chronometer:

Inheritance graph
[legend]

List of all members.


Detailed Description

This class deals with time counters.

Definition at line 26 of file Chronometer.h.


Public Member Functions

 Chronometer ()
 Default constructor, it does nothing.
void start ()
 This will start the chronometer counter and will reset any previous counter value.
void stop ()
 This will stop the counter.
void resume ()
 If you stop the counter, this methid will resume the count.
void reset ()
 This will reset your counter without stoping it.
long int elapsedHour ()
 This will return the elapsed hours since you called start.
long int elapsedMinute ()
 This will return the elapsed munutes since you called start.
long int elapsedSecond ()
 This will return the elapsed second since you called start.
long int elapsedMillisecond ()
 This will return the elapsed millisecond since you called start.
long int elapsedMicrosecond ()
 This will return the elapsed microsecond since you called start.

Protected Types

enum  DateAMPM { AM, PM }
enum  DateARITHParts { DAYS, HOURS, MINUTES, SECONDS }

Protected Member Functions

virtual void encode ()
virtual int Hour ()
 Returns the current hour.
virtual int Minute ()
 Returns the current minute.
virtual int Second ()
 Returns the current second.
const UInt32 timestamp ()
 Returns time in the following format: HH:MM:SS.
void setTStamp (UInt32 tstamp)
 This member holds the String representation of the current Date.
void decode (const char *format, const char *date_text)
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.
const UInt32 unixTime () const
virtual std::string toString ()
 This will convert the current date object to the following format: YYYY-MM-DD HH:MM:SS.
virtual void add (DateARITHParts component, int value)
virtual const char * getClassName ()
 Returns the name of the current class.

Static Protected Member Functions

static Date Now ()
static void usleep (UInt32 usec)
 This will return how many CPUs are installed in the system.
static void debugmsg (Object *obj, const char *msg, int linenumber=__LINE__, const char *srcfile=__FILE__)
 Will print a debug message to the screen.
static void debugmsgln (Object *obj, const char *msg, int linenumber=__LINE__, const char *srcfile=__FILE__)

Protected Attributes

struct timeval _startedOn
struct timeval _finishedOn
bool _counting
time_t unixtime
 This variable stores the time queried by getCurrentTime();.
std::string * string_representation
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.
std::string __cls_name

Friends

std::ostream & operator<< (std::ostream &stream, const Object &s)

Member Enumeration Documentation

enum xvr2::Date::DateAMPM [inherited]

Enumerator:
AM 
PM 

Definition at line 38 of file Date.h.

enum xvr2::Date::DateARITHParts [inherited]

Enumerator:
DAYS 
HOURS 
MINUTES 
SECONDS 

Definition at line 42 of file Date.h.


Constructor & Destructor Documentation

xvr2::Chronometer::Chronometer (  ) 

Default constructor, it does nothing.


Member Function Documentation

void xvr2::Chronometer::start (  ) 

This will start the chronometer counter and will reset any previous counter value.

void xvr2::Chronometer::stop (  ) 

This will stop the counter.

void xvr2::Chronometer::resume (  ) 

If you stop the counter, this methid will resume the count.

void xvr2::Chronometer::reset (  ) 

This will reset your counter without stoping it.

long int xvr2::Chronometer::elapsedHour (  ) 

This will return the elapsed hours since you called start.

long int xvr2::Chronometer::elapsedMinute (  ) 

This will return the elapsed munutes since you called start.

long int xvr2::Chronometer::elapsedSecond (  ) 

This will return the elapsed second since you called start.

long int xvr2::Chronometer::elapsedMillisecond (  ) 

This will return the elapsed millisecond since you called start.

long int xvr2::Chronometer::elapsedMicrosecond (  ) 

This will return the elapsed microsecond since you called start.

virtual void xvr2::Time::encode (  )  [protected, virtual, inherited]

Reimplemented from xvr2::Date.

virtual int xvr2::Time::Hour (  )  [virtual, inherited]

Returns the current hour.

virtual int xvr2::Time::Minute (  )  [virtual, inherited]

Returns the current minute.

virtual int xvr2::Time::Second (  )  [virtual, inherited]

Returns the current second.

const UInt32 xvr2::Time::timestamp (  )  [inherited]

Returns time in the following format: HH:MM:SS.

This will return the time as a Unix formatted timestamp counting the seconds from january 1st 1970

void xvr2::Date::setTStamp ( UInt32  tstamp  )  [protected, inherited]

This member holds the String representation of the current Date.

void xvr2::Date::decode ( const char *  format,
const char *  date_text 
) [protected, inherited]

virtual time_t xvr2::Date::getCurrentTime (  )  [virtual, inherited]

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

const UInt32 xvr2::Date::unixTime (  )  [inherited]

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

const UInt32 xvr2::Date::unixTime (  )  const [inherited]

virtual std::string xvr2::Date::toString (  )  [virtual, inherited]

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

Reimplemented from xvr2::Object.

virtual void xvr2::Date::add ( DateARITHParts  component,
int  value 
) [virtual, inherited]

static Date xvr2::Date::Now (  )  [static, inherited]

static void xvr2::System::usleep ( UInt32  usec  )  [static, inherited]

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

This will return the CPU speed in megahertz Will return the total amount of system memory Will return the total amount of free system memory Will freeze the software for usec microseconds

virtual const char* xvr2::Object::getClassName (  )  [virtual, inherited]

Returns the name of the current class.

static void xvr2::Object::debugmsg ( Object obj,
const char *  msg,
int  linenumber = __LINE__,
const char *  srcfile = __FILE__ 
) [static, inherited]

Will print a debug message to the screen.

static void xvr2::Object::debugmsgln ( Object obj,
const char *  msg,
int  linenumber = __LINE__,
const char *  srcfile = __FILE__ 
) [static, inherited]


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  stream,
const Object s 
) [friend, inherited]


Member Data Documentation

struct timeval xvr2::Chronometer::_startedOn [read, protected]

Definition at line 28 of file Chronometer.h.

struct timeval xvr2::Chronometer::_finishedOn [read, protected]

Definition at line 29 of file Chronometer.h.

bool xvr2::Chronometer::_counting [protected]

Definition at line 30 of file Chronometer.h.

time_t xvr2::Date::unixtime [protected, inherited]

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

Definition at line 29 of file Date.h.

std::string* xvr2::Date::string_representation [protected, inherited]

Definition at line 36 of file Date.h.

int xvr2::Date::hour [inherited]

This member stores the hour 0-23.

Definition at line 49 of file Date.h.

int xvr2::Date::hr12hour [inherited]

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

Definition at line 51 of file Date.h.

int xvr2::Date::minute [inherited]

This member stores the minute 0-59.

Definition at line 53 of file Date.h.

int xvr2::Date::second [inherited]

This member stores the second 0-59.

Definition at line 55 of file Date.h.

int xvr2::Date::dayofweek [inherited]

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

..

Definition at line 57 of file Date.h.

int xvr2::Date::dayofyear [inherited]

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

Definition at line 59 of file Date.h.

int xvr2::Date::dayofmonth [inherited]

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

Definition at line 61 of file Date.h.

int xvr2::Date::month [inherited]

This member stores the month 1-12.

Definition at line 63 of file Date.h.

int xvr2::Date::year [inherited]

This member stores the year 1960 - ????

Definition at line 65 of file Date.h.

int xvr2::Date::hr12ampm [inherited]

This member knows whether the timing is AM or PM.

Definition at line 67 of file Date.h.

std::string xvr2::Object::__cls_name [protected, inherited]

Definition at line 30 of file Object.h.


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

Generated on Fri Jun 20 22:55:50 2008 for X-VR2 SDK by  doxygen 1.5.5