|
Developer Documentation |
|
Centre for Vision, Speech & Signal Processing |
Comments:
SMALL OBJECT.
NB. The virtual timer uses the clock() system call. This
means virtual timing will only make sense for the first
36 minutes. After that the timer will wrap.
Variables:
- long sec;
-
Seconds since 12:00 January 1, 1970.
- long usec;
-
microseconds.
Methods:
- DateC()
-
Default constructor.
Sets time to 0.
- DateC(BooleanT setval,BooleanT useVirt = FALSE)
-
Constructor.
If 'setval' is FALSE an invalid date is created.
otherwise the date is set to now.
if useVirt is TRUE a virtual time is used.
- DateC(RealT val)
-
Construct from a real in seconds.
- DateC(IntT year,IntT month,IntT day,IntT hour = 0,IntT min = 0,IntT sec = 0,IntT usec = 0)
-
Constructer.
- DateC(istream & in)
-
Construct from a stream
- DateC(long xsec,long xusec)
-
Construct from two longs..
- DateC(const DateC & val)
-
Copy constructor
- DateC(const StringC &)
-
String constructor
Expects data in sec:usec format
as produced by Text() method.
- BooleanT IsLeapYear(int year)
-
Is give year a leap year ?
- int YearToDaysSince1970(int year)
-
Convert year to days since 1970
- BooleanT IsValid() const
-
Is a valid date ?
- BooleanT IsZero() const
-
Is time zero ?
- void SetInvalid()
-
Make this date invalid.
- void SetToNow(BooleanT useVirt = FALSE)
-
Set value of variable to now!
- long MaxUSeconds() const
-
Maximum mircro seconds.
- long Resolution() const
-
Get resolution of timer in microseconds.
NB. This assumes 100Hz by default.
- void NormalisePos()
-
Normalise time representation after addition
- void NormaliseNeg()
-
Normalise time representation after subtraction
- BooleanT operator==(const DateC & oth) const
-
Compair times.
- BooleanT operator!=(const DateC & oth) const
-
Compair times.
- BooleanT operator>(const DateC & oth) const
-
Compair times.
- BooleanT operator<(const DateC & oth) const
-
Compair times.
- BooleanT operator>=(const DateC & oth) const
-
Compair times.
- BooleanT operator<=(const DateC & oth) const
-
Compair times.
- DateC operator+(const DateC & oth) const
-
Add times.
- DateC operator-(const DateC & oth) const
-
Subtract times.
- const DateC & operator-=(const DateC & val)
-
Inplace subtraction.
- const DateC & operator-=(double val)
-
Inplace subtraction.
- const DateC & operator+=(const DateC & val)
-
Inplace addition.
- const DateC & operator+=(double val)
-
Inplace addition.
- StringC Text() const
-
Get the time in string form.
This currently prints the time in the form
sec:usec.
- StringC CTime() const
-
Returns results equivelent to calling ctime().
- StringC CTimeShort() const
-
Returns a short string containing date/time.
- long USeconds() const
-
Get micro seconds.
- long TotalSeconds() const
-
Get total seconds.
- double Double() const
-
Get time in double form.
- IntT Seconds() const
-
Return number of seconds after minuite. 0,61 (61 for leap seconds.)
- IntT Minute() const
-
Get minute.
- IntT Hour() const
-
Hours since midnight. 0-23
- IntT Month() const
-
Get month 1-31
- IntT Year() const
-
Get year.
- IntT DayInMonth() const
-
Get day in month. 1,31
- IntT DayInYear() const
-
Get day of year. 0-365
- IntT DayInWeek() const
-
Get day of week. Since sunday, 0-6
- BooleanT DaylightSaving() const
-
Are we daylight saveing ?
True = yes
- BooleanT Wait() const
-
Wait until this time.
- BooleanT Sleep(RealT delay)
-
Pause execution for 'delay' seconds.
- void Save(ostream & out) const
-
Write to a stream.
|
Programmer:Charles Galambos, Documentation by CxxDoc: Tue Mar 20 10:49:27 2001
|