CTR Pia  4.11.3
Game Communication Engine
nn::pia::common::Time Class Reference

Class that represents time. More...

+ Inheritance diagram for nn::pia::common::Time:

Public Member Functions

 Time ()
 Instantiates the object with default parameters (default constructor).
 
 Time (const Time &rhs)
 Copy constructor. More...
 
bool operator!= (const Time &rhs) const
 Equality operator. Determines whether two Time objects differ. More...
 
Time operator+ (const TimeSpan &span) const
 Calculates a Time object holding the amount of time added to this instance. More...
 
Timeoperator+= (const TimeSpan &span)
 Adds time to this instance's time. More...
 
Time operator- (const TimeSpan &span) const
 Calculates a Time object holding the amount of time subtracted from this instance. More...
 
TimeSpan operator- (const Time &rhs) const
 Calculates a time delta. More...
 
Timeoperator-= (const TimeSpan &span)
 Subtracts time from this instance. More...
 
bool operator< (const Time &rhs) const
 Comparison operator. Returns true if this instance is earlier. More...
 
bool operator<= (const Time &rhs) const
 Comparison operator. Returns true if this instance is earlier or equal. More...
 
Timeoperator= (const Time &rhs)
 Assignment operator. More...
 
bool operator== (const Time &rhs) const
 Equality operator. Determines whether two Time objects are equal. More...
 
bool operator> (const Time &rhs) const
 Comparison operator. Returns true if this instance is later. More...
 
bool operator>= (const Time &rhs) const
 Comparison operator. Returns true if this instance is later or equal. More...
 
void SetNow ()
 Makes this object represent the current time.
 
void Trace (u64 flag) const
 Prints information useful for debugging. More...
 

Static Public Member Functions

static Time GetTime ()
 Gets a Time instance representing the current time. More...
 

Detailed Description

Class that represents time.


Revision History:

2012-06-06 Made the class inherit from RootObject.

2012-04-20 Changed the internal representation to be a direct representation of a system tick. Consequently, removed Time(u64) and operator u64, which handled the raw values directly.

2012-04-20 Added a TimeSpan class to represent time spans (deltas). The arguments and return values of operators that handle time spans have been changed to instances of the TimeSpan class.

2012-04-20 Added the SetNow function.

2012-04-20 Removed ConvertFromSeconds and ConvertToSeconds functions, and gave equivalent functionality to TimeSpan::SetFromSec(f32) and TimeSpan::GetSecF32 functions.

2012-04-13 Changed the specifications of GetTime function to return the time elapsed since the nn::pia::common::Initialize function was called.

2012-04-13 Removed the Reset function.

2012-04-13 The nn::pia::common::Initialize and nn::pia::common::Finalize functions now initialize and finalize the Time class.

2012-04-04 Initial version.

Constructor & Destructor Documentation

nn::pia::common::Time::Time ( const Time rhs)
inline

Copy constructor.

Parameters
[in]rhsA Time instance that holds the value used to initialize this instance.

Member Function Documentation

static Time nn::pia::common::Time::GetTime ( )
inlinestatic

Gets a Time instance representing the current time.

Returns
A Time instance representing the current time.
bool nn::pia::common::Time::operator!= ( const Time rhs) const
inline

Equality operator. Determines whether two Time objects differ.

Parameters
[in]rhsThe Time instance to compare with.
Returns
true if they represent different times, and false otherwise.
Time nn::pia::common::Time::operator+ ( const TimeSpan span) const
inline

Calculates a Time object holding the amount of time added to this instance.

Parameters
[in]spanThe time to add.
Returns
A Time representing the amount of time that was added.
Time& nn::pia::common::Time::operator+= ( const TimeSpan span)
inline

Adds time to this instance's time.

Parameters
[in]spanThe time to add.
Returns
Returns a reference to this instance.
Time nn::pia::common::Time::operator- ( const TimeSpan span) const
inline

Calculates a Time object holding the amount of time subtracted from this instance.

Parameters
[in]spanThe time to subtract.
Returns
A Time representing the amount of time that was subtracted.
TimeSpan nn::pia::common::Time::operator- ( const Time rhs) const
inline

Calculates a time delta.

Parameters
[in]rhsThe base time.
Returns
A TimeSpan object representing the time delta.
Time& nn::pia::common::Time::operator-= ( const TimeSpan span)
inline

Subtracts time from this instance.

Parameters
[in]spanThe time to subtract.
Returns
Returns a reference to this instance.
bool nn::pia::common::Time::operator< ( const Time rhs) const
inline

Comparison operator. Returns true if this instance is earlier.

Parameters
[in]rhsThe Time instance to compare with.
Returns
true if this instance is earlier, and false otherwise.
bool nn::pia::common::Time::operator<= ( const Time rhs) const
inline

Comparison operator. Returns true if this instance is earlier or equal.

Parameters
[in]rhsThe Time instance to compare with.
Returns
true if this instance is earlier or equal, and false otherwise.
Time& nn::pia::common::Time::operator= ( const Time rhs)
inline

Assignment operator.

Parameters
[in]rhsThe Time instance to assign to this instance.
Returns
Returns a reference to this instance.
bool nn::pia::common::Time::operator== ( const Time rhs) const
inline

Equality operator. Determines whether two Time objects are equal.

Parameters
[in]rhsThe Time instance to compare with.
Returns
Returns true if they represent the same time, and false otherwise.
bool nn::pia::common::Time::operator> ( const Time rhs) const
inline

Comparison operator. Returns true if this instance is later.

Parameters
[in]rhsThe Time instance to compare with.
Returns
true if this instance is later, and false otherwise.
bool nn::pia::common::Time::operator>= ( const Time rhs) const
inline

Comparison operator. Returns true if this instance is later or equal.

Parameters
[in]rhsThe Time instance to compare with.
Returns
true if this instance is later or equal, and false otherwise.
void nn::pia::common::Time::Trace ( u64  flag) const

Prints information useful for debugging.

Parameters
[in]flagSpecifies the bitwise OR of trace flags. For more information, see the TraceFlag type.