CTR Pia  4.11.3
Game Communication Engine
nn::pia::transport::TransportAnalyzer Class Reference

The TransportAnalyzer class reports on packet analysis results, RTT, packet loss rates, and so on.
. More...

+ Inheritance diagram for nn::pia::transport::TransportAnalyzer:

Public Types

typedef void(* AnalysisPrintCallback) (const char *pStr)
 Defines the type of the print callback used for transport analysis data. More...
 

Public Member Functions

const struct TransportAnalysisDataGetTransportAnalysisData () const
 Gets the data.
 
AnalysisPrintCallback RegisterPrintCallback (AnalysisPrintCallback pCallback)
 Registers the print callback. More...
 
nn::Result SetMarker (const char *pComment)
 Outputs a string to the console to delimit flags. More...
 
void Trace (u64 flag) const
 Prints information that is useful for debugging. More...
 
nn::Result Update ()
 Updates the data. More...
 

Static Public Member Functions

static TransportAnalyzerGetInstance ()
 Gets the TransportAnalyzer class instance (singleton pattern). This function returns a NULL pointer if the instance has not yet been created using the CreateInstance function. This function is thread-safe. More...
 

Detailed Description

The TransportAnalyzer class reports on packet analysis results, RTT, packet loss rates, and so on.
.

Revision History:

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

2014-07-01 Added a feature that lets you pass analysis data as a text string to a user-defined function.

2013-11-25 Added the SetMarker function.

2013-11-14 Made the CreateInstance, DestroyInstance, Initialize, Finalize, Startup, and Cleanup functions private.

2013-11-14 Made changes so that instances are implicitly created within PiaTransport.

2013-10-29 Initial version.

Member Typedef Documentation

typedef void(* nn::pia::transport::TransportAnalyzer::AnalysisPrintCallback) (const char *pStr)

Defines the type of the print callback used for transport analysis data.

Use this type when you want to pass an output string containing transport analysis data to a user-defined function.

Parameters
[in]pStrTakes the transport analysis data as a text string. Does not add a newline character.

Member Function Documentation

static TransportAnalyzer* nn::pia::transport::TransportAnalyzer::GetInstance ( void  )
inlinestatic

Gets the TransportAnalyzer class instance (singleton pattern). This function returns a NULL pointer if the instance has not yet been created using the CreateInstance function. This function is thread-safe.

Returns
Returns a pointer to the TransportAnalyzer instance.
See also
CreateInstance, DestroyInstance
AnalysisPrintCallback nn::pia::transport::TransportAnalyzer::RegisterPrintCallback ( AnalysisPrintCallback  pCallback)

Registers the print callback.

Parameters
[in]pCallbackSpecifies a pointer to the callback function to register.
Returns
Returns the print callback that was registered before this function was called.
nn::Result nn::pia::transport::TransportAnalyzer::SetMarker ( const char *  pComment)

Outputs a string to the console to delimit flags.

Parameters
[in]pCommentA pointer to the string that is the name of the delimiter line. The string cannot include whitespace characters. Also, NULL cannot be specified.
Error Return Values:

ResultInvalidArgument Specifies that an argument is invalid. NULL pointers and strings that include whitespace characters cannot be provided as arguments. Programming error. Fix your program so that this error is not returned.

ResultInvalidState Indicates that the function was called at the wrong time. Programming error. Fix your program so that this error is not returned.

void nn::pia::transport::TransportAnalyzer::Trace ( u64  flag) const

Prints information that is useful for debugging.

Parameters
[in]flagSpecifies the bitwise OR of trace flags. For more information, see the TraceFlag type.
nn::Result nn::pia::transport::TransportAnalyzer::Update ( )

Updates the data.

The application does not need to call this API function if (A) a positive value has been set for the analysisInterval member variable in the Transport::Setting structure and (B) automatic printing of analysis data is enabled. When the application gets analysis data when the automatic printing feature is disabled and a value of 0 is set for the analysisInterval member variable, update the data by calling this API function explicitly.

Returns
Returns a Result value for which the IsSuccess function returns true if the procedure was successful. You must make sure that the implementation of this function in your application does not return any errors.
Error Return Values:

ResultNotInitialized Indicates that the TransportAnalyzer instance is not initialized. Programming error. Fix your program so that this error is not returned.

ResultInvalidState Indicates that the function was called at the wrong time. Programming error. Fix your program so that this error is not returned.