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

Caches console output. This class is used for debugging. Do not use it in production versions of code.
. More...

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

Public Member Functions

void Clear ()
 Clears the string currently being cached.
 
void Flush ()
 Outputs the string currently being cached and then clears it.
 
void Trace (u64 flag) const
 Prints information useful for debugging. More...
 

Static Public Member Functions

static nn::Result CreateInstance (u32 bufferSize)
 Creates an instance (singleton pattern). More...
 
static void DestroyInstance ()
 Destroys the instance (singleton pattern). More...
 
static CachedPrintGetInstance ()
 Gets a pointer to the CachedPrint instance (singleton pattern). More...
 

Detailed Description

Caches console output. This class is used for debugging. Do not use it in production versions of code.
.

Revision History:

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

2012-05-01 Initial version.

Member Function Documentation

static nn::Result nn::pia::common::CachedPrint::CreateInstance ( u32  bufferSize)
static

Creates an instance (singleton pattern).

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

Parameters
[in]bufferSizeSpecifies the size of the buffer to be cached (in bytes). Specify a value equal to or greater than 512.
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.

ResultInvalidArgument Indicates that an argument is invalid. Programming error. Fix your program so that this error is not returned.

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

Destroys the instance (singleton pattern).

This function does nothing and returns if called when an instance has not been created.

static CachedPrint* nn::pia::common::CachedPrint::GetInstance ( )
inlinestatic

Gets a pointer to the CachedPrint instance (singleton pattern).

Returns
Returns a NULL pointer if the instance cannot be created.
void nn::pia::common::CachedPrint::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.