Om  1.0.0
A universal framework for multimedia simulation
Public Member Functions | Static Public Member Functions | List of all members
om::time::Time Class Reference

A class that represents a high-resolution time interval. More...

#include <omTime.h>

Public Member Functions

 Time ()
 Create a Time object that represents a time interval of 0 seconds. More...
 
 Time (int newNanoseconds)
 Create a Time object that represents the specified interval of time in nanoseconds. More...
 
 Time (Int64 newNanoseconds)
 Create a Time object that represents the specified interval of time in nanoseconds. More...
 
 Time (Float newSeconds)
 Create a Time object that represents the specified interval of time in seconds. More...
 
 Time (Double newSeconds)
 Create a Time object that represents the specified interval of time in seconds. More...
 
Double getSeconds () const
 Return the number of seconds that this Time object represents. More...
 
Int64 getNanoseconds () const
 Return the number of nanoseconds that this Time object represents. More...
 
 operator Double () const
 Convert this Time object into a floating point representation. More...
 
Bool operator== (const Time &other) const
 Return whether or not this Time object represents the same time as another. More...
 
Bool operator!= (const Time &other) const
 Return whether or not this Time object represents a different time than another. More...
 
Bool operator< (const Time &other) const
 Return whether or not this Time object represents an earlier time than another. More...
 
Bool operator> (const Time &other) const
 Return whether or not this Time object represents a later time than another. More...
 
Bool operator<= (const Time &other) const
 Return whether or not this Time object represents an earlier or equal time than another. More...
 
Bool operator>= (const Time &other) const
 Return whether or not this Time object represents a later or equal time than another. More...
 
Time operator+ (const Time &other) const
 Return the time interval represented by the sum of this time interval and another. More...
 
Timeoperator+= (const Time &other)
 Add the specified time interval to this time interval, modifying it. More...
 
Time operator- (const Time &other) const
 Return the time interval represented by the difference between this time interval and another. More...
 
Timeoperator-= (const Time &other)
 Subtract the specified time interval from this time interval, modifying it. More...
 
data::String toString () const
 Return a string representation of this time object. More...
 
 operator data::String () const
 Convert this time object to a string representation. More...
 

Static Public Member Functions

static Time getCurrent ()
 Return a time object that represents the current system time. More...
 

Detailed Description

A class that represents a high-resolution time interval.

The time is stored internally as a 64-bit signed integer that indicates the number of nanoseconds in the time interval.

Constructor & Destructor Documentation

om::time::Time::Time ( )
inline

Create a Time object that represents a time interval of 0 seconds.

om::time::Time::Time ( int  newNanoseconds)
inline

Create a Time object that represents the specified interval of time in nanoseconds.

This overload is provided to allow initialization with 0, which might cause ambiguities.

om::time::Time::Time ( Int64  newNanoseconds)
inline

Create a Time object that represents the specified interval of time in nanoseconds.

om::time::Time::Time ( Float  newSeconds)
inline

Create a Time object that represents the specified interval of time in seconds.

The time is specified by a single floating-point value that gives the number of seconds in the time interval.

om::time::Time::Time ( Double  newSeconds)
inline

Create a Time object that represents the specified interval of time in seconds.

The time is specified by a single floating-point value that gives the number of seconds in the time interval.

Member Function Documentation

Double om::time::Time::getSeconds ( ) const
inline

Return the number of seconds that this Time object represents.

Int64 om::time::Time::getNanoseconds ( ) const
inline

Return the number of nanoseconds that this Time object represents.

om::time::Time::operator Double ( ) const
inline

Convert this Time object into a floating point representation.

Doing this may reduce the accuracy of the time interval due to the inaccuracies of floating-point formats.Convert this Time object into a double floating point representation. Doing this may reduce the accuracy of the time interval due to the inaccuracies of floating-point formats.

Bool om::time::Time::operator== ( const Time other) const
inline

Return whether or not this Time object represents the same time as another.

Bool om::time::Time::operator!= ( const Time other) const
inline

Return whether or not this Time object represents a different time than another.

Bool om::time::Time::operator< ( const Time other) const
inline

Return whether or not this Time object represents an earlier time than another.

Bool om::time::Time::operator> ( const Time other) const
inline

Return whether or not this Time object represents a later time than another.

Bool om::time::Time::operator<= ( const Time other) const
inline

Return whether or not this Time object represents an earlier or equal time than another.

Bool om::time::Time::operator>= ( const Time other) const
inline

Return whether or not this Time object represents a later or equal time than another.

Time om::time::Time::operator+ ( const Time other) const
inline

Return the time interval represented by the sum of this time interval and another.

Time& om::time::Time::operator+= ( const Time other)
inline

Add the specified time interval to this time interval, modifying it.

Time om::time::Time::operator- ( const Time other) const
inline

Return the time interval represented by the difference between this time interval and another.

Time& om::time::Time::operator-= ( const Time other)
inline

Subtract the specified time interval from this time interval, modifying it.

data::String om::time::Time::toString ( ) const
inline

Return a string representation of this time object.

om::time::Time::operator data::String ( ) const
inline

Convert this time object to a string representation.

static Time om::time::Time::getCurrent ( )
inlinestatic

Return a time object that represents the current system time.

The time is specified as the time since the Epoch, 1970-01-01 00:00:00 +0000 (UTC).


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