Public Member Functions | Static Public Attributes | Friends | Related Functions | List of all members
ime::Time Class Reference

Represents a time value. More...

#include <Time.h>

Public Member Functions

 Time ()
 Default constructor. More...
 
Int64 asNanoseconds () const
 Get the time value in nanoseconds. More...
 
Int64 asMicroseconds () const
 Get the time value in microseconds. More...
 
Int32 asMilliseconds () const
 Get the time value in milliseconds. More...
 
float asSeconds () const
 Get the time value in seconds. More...
 
Int64 asMinutes () const
 Get the time value in minutes. More...
 
Int64 asHours () const
 Get the time value in hours. More...
 

Static Public Attributes

static const Time Zero
 Predefined "zero" time value. More...
 

Friends

IME_API Time nanoseconds (Int64)
 
IME_API Time microseconds (Int64)
 
IME_API Time milliseconds (Int32)
 
IME_API Time seconds (float)
 
IME_API Time minutes (Int64)
 
IME_API Time hours (Int64)
 

Related Functions

(Note that these are not member functions.)

IME_API Time nanoseconds (Int64 nanoseconds)
 Construct a time value from a number of nanoseconds. More...
 
IME_API Time microseconds (Int64 microseconds)
 Construct a time value from a number of microseconds. More...
 
IME_API Time milliseconds (Int32 milliseconds)
 Construct a time value from a number of milliseconds. More...
 
IME_API Time seconds (float seconds)
 Construct a time value from a number of seconds. More...
 
IME_API Time minutes (Int64 minutes)
 Construct a time value from a number of minutes. More...
 
IME_API Time hours (Int64 hours)
 Construct a time value from a number of hours. More...
 
IME_API bool operator== (Time left, Time right)
 Overload of == operator to compare two time values. More...
 
IME_API bool operator!= (Time left, Time right)
 Overload of != operator to compare two time values. More...
 
IME_API bool operator< (Time left, Time right)
 Overload of < operator to compare two time values. More...
 
IME_API bool operator> (Time left, Time right)
 Overload of > operator to compare two time values. More...
 
IME_API bool operator<= (Time left, Time right)
 Overload of <= operator to compare two time values. More...
 
IME_API bool operator>= (Time left, Time right)
 Overload of >= operator to compare two time values. More...
 
IME_API Time operator- (Time right)
 Overload of unary - operator to negate a time value. More...
 
IME_API Time operator+ (Time left, Time right)
 Overload of binary + operator to add two time values. More...
 
IME_API Timeoperator+= (Time &left, Time right)
 Overload of binary += operator to add/assign two time values. More...
 
IME_API Time operator- (Time left, Time right)
 Overload of binary - operator to subtract two time values. More...
 
IME_API Timeoperator-= (Time &left, Time right)
 Overload of binary -= operator to subtract/assign two time values. More...
 
IME_API Time operator* (Time left, float right)
 Overload of binary * operator to scale a time value. More...
 
IME_API Time operator* (Time left, Int64 right)
 Overload of binary * operator to scale a time value. More...
 
IME_API Time operator* (float left, Time right)
 Overload of binary * operator to scale a time value. More...
 
IME_API Time operator* (Int64 left, Time right)
 Overload of binary * operator to scale a time value. More...
 
IME_API Timeoperator*= (Time &left, float right)
 Overload of binary *= operator to scale/assign a time value. More...
 
IME_API Timeoperator*= (Time &left, Int64 right)
 Overload of binary *= operator to scale/assign a time value. More...
 
IME_API Time operator/ (Time left, float right)
 Overload of binary / operator to scale a time value. More...
 
IME_API Time operator/ (Time left, Int64 right)
 Overload of binary / operator to scale a time value. More...
 
IME_API Timeoperator/= (Time &left, float right)
 Overload of binary /= operator to scale/assign a time value. More...
 
IME_API Timeoperator/= (Time &left, Int64 right)
 Overload of binary /= operator to scale/assign a time value. More...
 
IME_API float operator/ (Time left, Time right)
 Overload of binary / operator to compute the ratio of two time values. More...
 
IME_API Time operator% (Time left, Time right)
 Overload of binary % operator to compute remainder of a time value. More...
 
IME_API Timeoperator%= (Time &left, Time right)
 Overload of binary %= operator to compute/assign remainder of a time value. More...
 

Detailed Description

Represents a time value.

Definition at line 35 of file Time.h.

Constructor & Destructor Documentation

◆ Time()

ime::Time::Time ( )

Default constructor.

Sets the time value to zero

Member Function Documentation

◆ asHours()

Int64 ime::Time::asHours ( ) const

Get the time value in hours.

Returns
The time value in hours

◆ asMicroseconds()

Int64 ime::Time::asMicroseconds ( ) const

Get the time value in microseconds.

Returns
The time value in microseconds

◆ asMilliseconds()

Int32 ime::Time::asMilliseconds ( ) const

Get the time value in milliseconds.

Returns
The time value in milliseconds

◆ asMinutes()

Int64 ime::Time::asMinutes ( ) const

Get the time value in minutes.

Returns
The time value in minutes

◆ asNanoseconds()

Int64 ime::Time::asNanoseconds ( ) const

Get the time value in nanoseconds.

Returns
The time value in nanoseconds

◆ asSeconds()

float ime::Time::asSeconds ( ) const

Get the time value in seconds.

Returns
The time value in seconds

Friends And Related Function Documentation

◆ hours()

IME_API Time hours ( Int64  hours)
related

Construct a time value from a number of hours.

Parameters
hoursNumber of hours
Returns
The time value constructed from the amount of hours

◆ microseconds()

IME_API Time microseconds ( Int64  microseconds)
related

Construct a time value from a number of microseconds.

Parameters
microsecondsNumber of microseconds
Returns
The time value constructed from the amount of microseconds

◆ milliseconds()

IME_API Time milliseconds ( Int32  milliseconds)
related

Construct a time value from a number of milliseconds.

Parameters
millisecondsNumber of milliseconds
Returns
The time value constructed from the amount of milliseconds

◆ minutes()

IME_API Time minutes ( Int64  minutes)
related

Construct a time value from a number of minutes.

Parameters
minutesNumber of minutes
Returns
The time value constructed from the amount of minutes

◆ nanoseconds()

IME_API Time nanoseconds ( Int64  nanoseconds)
related

Construct a time value from a number of nanoseconds.

Parameters
nanosecondsNumber of nanoseconds
Returns
The time value constructed from the amount of nanoseconds

◆ operator!=()

IME_API bool operator!= ( Time  left,
Time  right 
)
related

Overload of != operator to compare two time values.

Parameters
leftLeft operand (a time)
rightRight operand (a time)
Returns
True if left is not equal to right

◆ operator%()

IME_API Time operator% ( Time  left,
Time  right 
)
related

Overload of binary % operator to compute remainder of a time value.

Parameters
leftLeft operand (a time)
rightRight operand (a time)
Returns
left modulo right

◆ operator%=()

IME_API Time & operator%= ( Time left,
Time  right 
)
related

Overload of binary %= operator to compute/assign remainder of a time value.

Parameters
leftLeft operand (a time)
rightRight operand (a time)
Returns
left modulo right

◆ operator*() [1/4]

IME_API Time operator* ( float  left,
Time  right 
)
related

Overload of binary * operator to scale a time value.

Parameters
leftLeft operand (a number)
rightRight operand (a time)
Returns
left multiplied by right

◆ operator*() [2/4]

IME_API Time operator* ( Int64  left,
Time  right 
)
related

Overload of binary * operator to scale a time value.

Parameters
leftLeft operand (a number)
rightRight operand (a time)
Returns
left multiplied by right

◆ operator*() [3/4]

IME_API Time operator* ( Time  left,
float  right 
)
related

Overload of binary * operator to scale a time value.

Parameters
leftLeft operand (a time)
rightRight operand (a number)
Returns
left multiplied by right

◆ operator*() [4/4]

IME_API Time operator* ( Time  left,
Int64  right 
)
related

Overload of binary * operator to scale a time value.

Parameters
leftLeft operand (a time)
rightRight operand (a number)
Returns
left multiplied by right

◆ operator*=() [1/2]

IME_API Time & operator*= ( Time left,
float  right 
)
related

Overload of binary *= operator to scale/assign a time value.

Parameters
leftLeft operand (a time)
rightRight operand (a number)
Returns
left multiplied by right

◆ operator*=() [2/2]

IME_API Time & operator*= ( Time left,
Int64  right 
)
related

Overload of binary *= operator to scale/assign a time value.

Parameters
leftLeft operand (a time)
rightRight operand (a number)
Returns
left multiplied by right

◆ operator+()

IME_API Time operator+ ( Time  left,
Time  right 
)
related

Overload of binary + operator to add two time values.

Parameters
leftLeft operand (a time)
rightRight operand (a time)
Returns
The sum of left and right

◆ operator+=()

IME_API Time & operator+= ( Time left,
Time  right 
)
related

Overload of binary += operator to add/assign two time values.

Parameters
leftLeft operand (a time)
rightRight operand (a time)
Returns
The sum of left and right

◆ operator-() [1/2]

IME_API Time operator- ( Time  left,
Time  right 
)
related

Overload of binary - operator to subtract two time values.

Parameters
leftLeft operand (a time)
rightRight operand (a time)
Returns
Difference of the two times values

◆ operator-() [2/2]

IME_API Time operator- ( Time  right)
related

Overload of unary - operator to negate a time value.

Parameters
rightRight operand (a time)
Returns
The opposite of the time value

◆ operator-=()

IME_API Time & operator-= ( Time left,
Time  right 
)
related

Overload of binary -= operator to subtract/assign two time values.

Parameters
leftLeft operand (a time)
rightRight operand (a time)
Returns
Difference of the two time values

◆ operator/() [1/3]

IME_API Time operator/ ( Time  left,
float  right 
)
related

Overload of binary / operator to scale a time value.

Parameters
leftLeft operand (a time)
rightRight operand (a number)
Returns
left divided by right

◆ operator/() [2/3]

IME_API Time operator/ ( Time  left,
Int64  right 
)
related

Overload of binary / operator to scale a time value.

Parameters
leftLeft operand (a time)
rightRight operand (a number)
Returns
left divided by right

◆ operator/() [3/3]

IME_API float operator/ ( Time  left,
Time  right 
)
related

Overload of binary / operator to compute the ratio of two time values.

Parameters
leftLeft operand (a time)
rightRight operand (a time)
Returns
left divided by right

◆ operator/=() [1/2]

IME_API Time & operator/= ( Time left,
float  right 
)
related

Overload of binary /= operator to scale/assign a time value.

Parameters
leftLeft operand (a time)
rightRight operand (a number)
Returns
left divided by right

◆ operator/=() [2/2]

IME_API Time & operator/= ( Time left,
Int64  right 
)
related

Overload of binary /= operator to scale/assign a time value.

Parameters
leftLeft operand (a time)
rightRight operand (a number)
Returns
left divided by right

◆ operator<()

IME_API bool operator< ( Time  left,
Time  right 
)
related

Overload of < operator to compare two time values.

Parameters
leftLeft operand (a time)
rightRight operand (a time)
Returns
True if left is less than right

◆ operator<=()

IME_API bool operator<= ( Time  left,
Time  right 
)
related

Overload of <= operator to compare two time values.

Parameters
leftLeft operand (a time)
rightRight operand (a time)
Returns
True if left is lesser or equal than right

◆ operator==()

IME_API bool operator== ( Time  left,
Time  right 
)
related

Overload of == operator to compare two time values.

Parameters
leftLeft operand (a time)
rightRight operand (a time)
Returns
True if left is equal to right

◆ operator>()

IME_API bool operator> ( Time  left,
Time  right 
)
related

Overload of > operator to compare two time values.

Parameters
leftLeft operand (a time)
rightRight operand (a time)
Returns
True if left is greater than right

◆ operator>=()

IME_API bool operator>= ( Time  left,
Time  right 
)
related

Overload of >= operator to compare two time values.

Parameters
leftLeft operand (a time)
rightRight operand (a time)
Returns
True if left is greater or equal than right

◆ seconds()

IME_API Time seconds ( float  seconds)
related

Construct a time value from a number of seconds.

Parameters
secondsNumber of seconds
Returns
The time value constructed from the amount of seconds

Member Data Documentation

◆ Zero

const Time ime::Time::Zero
static

Predefined "zero" time value.

Definition at line 81 of file Time.h.


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