V-ART
Public Member Functions | Static Public Member Functions | Protected Attributes | Friends | List of all members
VART::Time Class Reference

Elapsed time representation. More...

#include <time.h>

Public Member Functions

 Time ()
 Creates an unitialized object. More...
 
 Time (const Time &t)
 Copy constructor. More...
 
 Time (double newSeconds)
 Cast constructor from double. More...
 
void Set ()
 Set to current time. More...
 
unsigned int WholeMicroseconds () const
 Returns the number of whole microseconds in elapsed time. More...
 
unsigned int WholeMilliseconds () const
 Returns the number of whole miliseconds in elapsed time. More...
 
unsigned int WholeSeconds () const
 Returns the number of whole seconds in elapsed time. More...
 
float AsFloat () const
 Returns elapsed time (number of seconds) as float. More...
 
Time operator- (const Time &initialTime) const
 
bool operator>= (const Time &t) const
 
bool operator<= (const Time &t) const
 
bool operator> (const Time &t) const
 
bool operator< (const Time &t) const
 
void operator+= (double secs)
 
void operator-= (const Time &t)
 

Static Public Member Functions

static const TimeNOW ()
 Returns current time. More...
 

Protected Attributes

double seconds
 Number of seconds in elapsed time. More...
 

Friends

std::ostream & operator<< (std::ostream &output, const Time &t)
 

Detailed Description

Elapsed time representation.

Time represents the length of a time interval.

Definition at line 15 of file time.h.

Constructor & Destructor Documentation

VART::Time::Time ( )

Creates an unitialized object.

Definition at line 17 of file time.cpp.

VART::Time::Time ( const Time t)

Copy constructor.

Definition at line 21 of file time.cpp.

VART::Time::Time ( double  newSeconds)

Cast constructor from double.

Definition at line 25 of file time.cpp.

Member Function Documentation

float VART::Time::AsFloat ( ) const
inline

Returns elapsed time (number of seconds) as float.

Definition at line 40 of file time.h.

References seconds.

const VART::Time & VART::Time::NOW ( )
static

Returns current time.

Since Time represents elapsed time, NOW actually is the elapsed time since Epoch. See Set().

Definition at line 68 of file time.cpp.

References Set().

Referenced by VART::BaseAction::ComputePositionIndex().

void VART::Time::operator+= ( double  secs)
inline

Definition at line 47 of file time.h.

References seconds.

VART::Time VART::Time::operator- ( const Time initialTime) const

Definition at line 44 of file time.cpp.

References seconds.

void VART::Time::operator-= ( const Time t)
inline

Definition at line 48 of file time.h.

References seconds.

bool VART::Time::operator< ( const Time t) const
inline

Definition at line 46 of file time.h.

References seconds.

bool VART::Time::operator<= ( const Time t) const
inline

Definition at line 44 of file time.h.

References seconds.

bool VART::Time::operator> ( const Time t) const
inline

Definition at line 45 of file time.h.

References seconds.

bool VART::Time::operator>= ( const Time t) const
inline

Definition at line 43 of file time.h.

References seconds.

void VART::Time::Set ( )

Set to current time.

Makes the active object hold the elapsed time since "the epoch". In sloppy terms, it could be said that this method set the active object to hold current time. "Epoch" is some fixed point in time determined by the operating system (usually 0h of Jan 1, 1970).

Definition at line 49 of file time.cpp.

Referenced by VART::Action::Move(), and NOW().

unsigned int VART::Time::WholeMicroseconds ( ) const

Returns the number of whole microseconds in elapsed time.

Definition at line 29 of file time.cpp.

unsigned int VART::Time::WholeMilliseconds ( ) const

Returns the number of whole miliseconds in elapsed time.

Definition at line 34 of file time.cpp.

unsigned int VART::Time::WholeSeconds ( ) const

Returns the number of whole seconds in elapsed time.

Definition at line 39 of file time.cpp.

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  output,
const Time t 
)
friend

Member Data Documentation

double VART::Time::seconds
protected

Number of seconds in elapsed time.

Definition at line 57 of file time.h.

Referenced by AsFloat(), operator+=(), operator-(), operator-=(), operator<(), VART::operator<<(), operator<=(), operator>(), and operator>=().


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