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

This class is the trace class. More...

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

Public Member Functions

void ClearFlag (u64 flags)
 Disables the specified trace flags. More...
 
void ClearFlag (void)
 Clears all trace flags, except for TRACE_FLAG_ALWAYS.
 
bool IsFlagSet (u64 flag) const
 Indicates whether the specified flags are set. More...
 
bool IsPrintTime () const
 Gets whether time display is enabled or disabled. More...
 
void ResetBaseTime ()
 Resets the base time for the time display to the current time.
 
void SetFlag (u64 flags)
 Enables trace flags. More...
 
void SetPrintTime (bool isPrint)
 Enables and disables the time display. When enabled, it displays the time passed from the base time in units of milliseconds, such as "[Pia:12345]...". More...
 

Static Public Member Functions

static nn::Result CreateInstance (void)
 Creates the Trace class instance (singleton pattern). More...
 
static void DestroyInstance (void)
 Destroys the Trace class instance (singleton pattern). More...
 
static TraceGetInstance (void)
 Gets the Trace class instance (singleton pattern). More...
 

Detailed Description

This class is the trace class.

Trace code is disabled in release builds.


Revision History:

2014-09-18 Changed the specifications so that ResultAlreadyExists is returned if you call CreateInstance() when an instance already exists.

2013-11-21 Reorganized the trace flags. The bit positions of the flags are now different from what they were before.

2013-07-18 Changed the operations of IsFlagSet. The function now returns true if multiple flags are specified and any of the flags are raised.

2012-06-07 TraceFlag and its value were changed from enumerated to u64 constants.

2012-05-30 Times can now also be printed.

2012-04-19 Initial version.

Member Function Documentation

void nn::pia::common::Trace::ClearFlag ( u64  flags)
inline

Disables the specified trace flags.

Disables the specified trace flags. However, TRACE_FLAG_ALWAYS is excluded.

Parameters
[in]flagsSpecifies the bitwise OR of the TraceFlag values to disable.
static nn::Result nn::pia::common::Trace::CreateInstance ( void  )
static

Creates the Trace class instance (singleton pattern).

Call this member function after calling nn::pia::common::BeginSetup, but before calling nn::pia::common::EndSetup.

Returns
Returns a Result value that indicates success if the instance is created successfully. You must make sure that the implementation of this function in your application does not return any errors.
Error Return Values:

ResultAlreadyExists Indicates that an instance has already been created. Programming error. Fix your program so that this error is not returned.

ResultNotInitialized The common module has not been initialized. Programming error. Fix your program so that this error is not returned.

ResultInvalidState Indicates that the function was not called between the BeginSetup and EndSetup functions. Programming error. Fix your program so that this error is not returned.

static void nn::pia::common::Trace::DestroyInstance ( void  )
static

Destroys the Trace class instance (singleton pattern).

Destroys the Trace class instance. This function returns without performing any action if it is called before an instance has been created.

static Trace* nn::pia::common::Trace::GetInstance ( void  )
inlinestatic

Gets the Trace class instance (singleton pattern).

Returns a NULL pointer if the instance has not yet been created using the CreateInstance() function.

Returns
Returns a pointer to the Trace instance.
bool nn::pia::common::Trace::IsFlagSet ( u64  flag) const
inline

Indicates whether the specified flags are set.

The result of IsFlagSet(TRACE_NEVER) is true. Returns true if any of the specified flags are raised when multiple flags have been specified by argument.

Returns
Returns true if the particular flag is set, and false if not.
Parameters
[in]flagSpecifies the trace flags to query.
bool nn::pia::common::Trace::IsPrintTime ( ) const
inline

Gets whether time display is enabled or disabled.

Returns
Returns true if times are printed.
void nn::pia::common::Trace::SetFlag ( u64  flags)
inline

Enables trace flags.

Use this method to enable additional trace flags.

Parameters
[in]flagsSpecifies the bitwise OR of the TraceFlag values to enable.
void nn::pia::common::Trace::SetPrintTime ( bool  isPrint)
inline

Enables and disables the time display. When enabled, it displays the time passed from the base time in units of milliseconds, such as "[Pia:12345]...".

Parameters
[in]isPrintSpecify true to display the time.