code::Time Class Reference

List of all members.

Detailed Description

Simple representation of a point on the universal time-line.

code::Time contains seconds since 1970-Jan-01-00:00:00, a special date otherwise known as "epoch".

Author:
Lulin Song

Charles Kerr

See also:
TimeInterval


Public Member Functions

 Time ()
 The default time is epoch; that is, 1970 Jan 01 00:00:00.
 ~Time ()
int compareTo (const Time &t) const
 Return a number less than, equal to, or greater than zero if this time is less than, equal to, or greater than t.
bool operator< (const Time &t) const
 less-than comparison operator
bool operator> (const Time &t) const
 greater-than comparison operator
bool operator<= (const Time &t) const
 less-than-or-equal-to comparison operator
bool operator>= (const Time &t) const
 greater-than-or-equal-to comparison operator
bool operator== (const Time &t) const
 equality comparison operator
bool operator!= (const Time &t) const
 inequality comparison operator
TimeInterval operator- (const Time &b) const
 subtraction operator for two objects of type Time
Timeoperator+= (const TimeInterval &ti)
 additive assignment
Timeoperator-= (const TimeInterval &ti)
 subtractive assignment
Time operator+ (const TimeInterval &ti) const
 addition operator
Time operator- (const TimeInterval &ti) const
 subtraction operator for a Time and a TimeInterval
time_t getSecondsSinceEpoch () const
 Return the internal representation.
double getFractional () const
 Returns the fractional part of this Time.
std::string getString (bool hasSpace=true) const
 Gets a UTC std::string.

Static Public Member Functions

static Time SecondsSinceEpoch (time_t t, double f=0)
 Return a Time explicitly defined in seconds.
static Time CurrentTime ()
 Return Time corresponding to current state of system clock.
static Time LastPossibleTime ()
 Return the last possible time representable by this Time object.
static int compare (const Time &a, const Time &b)
 Return a number less than, equal to, or greater than zero if a is less than, equal to, or greater than b.


Constructor & Destructor Documentation

code::Time::Time (  )  [inline]

The default time is epoch; that is, 1970 Jan 01 00:00:00.

code::Time::~Time (  )  [inline]


Member Function Documentation

static int code::Time::compare ( const Time a,
const Time b 
) [inline, static]

Return a number less than, equal to, or greater than zero if a is less than, equal to, or greater than b.

int code::Time::compareTo ( const Time t  )  const [inline]

Return a number less than, equal to, or greater than zero if this time is less than, equal to, or greater than t.

static Time code::Time::CurrentTime (  )  [static]

Return Time corresponding to current state of system clock.

double code::Time::getFractional (  )  const [inline]

Returns the fractional part of this Time.

time_t code::Time::getSecondsSinceEpoch (  )  const [inline]

Return the internal representation.

std::string code::Time::getString ( bool  hasSpace = true  )  const

Gets a UTC std::string.

Parameters:
withSpace,: if it is true, the returned string looks like [2001 02/28 16:00:00 UTC] with space, otherwise it looks like [2001-02/28-16:00:00-UTC] without space which is prefered by XML file.

static Time code::Time::LastPossibleTime (  )  [inline, static]

Return the last possible time representable by this Time object.

On 32-bit machines, for example, this would correspond to [2038-01/19-03:14:07-UTC] plus a fraction of 0.9999 seconds.

bool code::Time::operator!= ( const Time t  )  const [inline]

inequality comparison operator

Time code::Time::operator+ ( const TimeInterval ti  )  const [inline]

addition operator

Time& code::Time::operator+= ( const TimeInterval ti  )  [inline]

additive assignment

Time code::Time::operator- ( const TimeInterval ti  )  const [inline]

subtraction operator for a Time and a TimeInterval

TimeInterval code::Time::operator- ( const Time b  )  const [inline]

subtraction operator for two objects of type Time

Time& code::Time::operator-= ( const TimeInterval ti  )  [inline]

subtractive assignment

bool code::Time::operator< ( const Time t  )  const [inline]

less-than comparison operator

bool code::Time::operator<= ( const Time t  )  const [inline]

less-than-or-equal-to comparison operator

bool code::Time::operator== ( const Time t  )  const [inline]

equality comparison operator

bool code::Time::operator> ( const Time t  )  const [inline]

greater-than comparison operator

bool code::Time::operator>= ( const Time t  )  const [inline]

greater-than-or-equal-to comparison operator

static Time code::Time::SecondsSinceEpoch ( time_t  t,
double  f = 0 
) [inline, static]

Return a Time explicitly defined in seconds.


Generated on Fri May 4 13:40:12 2012 for WDSS-IIw2 by  doxygen 1.4.7