CTR Pia
4.11.3
Game Communication Engine
|
Represents the calling context. More...
Public Types | |
typedef void(* | CompletionCallback) (nn::Result result, void *pUserArg) |
This typedef defines the callback function that is executed when the asynchronous operation finishes. More... | |
Public Member Functions | |
CallContext (void) | |
Instantiates the object (constructor). More... | |
~CallContext (void) | |
Destroys the object. More... | |
void | Cancel (void) |
Requests the cancellation of asynchronous processing. More... | |
nn::Result | GetResult () const |
Gets the nn::Result value representing the execution result of the asynchronous process. More... | |
bool | IsCompleted () const |
Determines whether an asynchronous process has completed. More... | |
bool | IsInProgress () const |
Determines whether an asynchronous process is in progress. More... | |
void | RegisterCompletionCallback (CompletionCallback pCallback, void *pUserArg=NULL) |
Sets the callback function executed when asynchronous processing completes. More... | |
Represents the calling context.
The calling context is primarily used to log the execution status of asynchronous functions.
2013-12-16 Removed a previous prohibition on calling the Cancel
function in the CallContext
passed to the Pia API that does not support cancellations.
2013-12-13 Added the IsInProgress
function.
2013-12-13 Made the GetState
function private.
2012-09-21 No longer inherits Event
.
2012-09-20 Added a description of the conditions under which Cancel
can be called.
2012-05-14 Added the CompletionCallback
parameter so values can be specified by applications.
2012-05-14 Initial version.
typedef void(* nn::pia::common::CallContext::CompletionCallback) (nn::Result result, void *pUserArg) |
This typedef
defines the callback function that is executed when the asynchronous operation finishes.
Register the callback using the CompletionCallback
or RegisterCompletionCallback
function so that a callback function is called when asynchronous processing completes.
nn::pia::common::CallContext::CallContext | ( | void | ) |
Instantiates the object (constructor).
The state is set to Available
.
nn::pia::common::CallContext::~CallContext | ( | void | ) |
Destroys the object.
The destructor asserts if the CallContext
state is CallInProgress
when it is called.
void nn::pia::common::CallContext::Cancel | ( | void | ) |
Requests the cancellation of asynchronous processing.
Note that calling this API function does not mean that the asynchronous process is canceled immediately. After this API function is called, you must periodically call the IsCompleted
function to check the state of completion. Wait until true
is returned.
|
inline |
Gets the nn::Result
value representing the execution result of the asynchronous process.
nn::Result
value of the asynchronous process.
|
inline |
Determines whether an asynchronous process has completed.
true
if the asynchronous process has completed (including cases where it has failed); returns false
otherwise.
|
inline |
Determines whether an asynchronous process is in progress.
true
if an asynchronous process is in progress, and false
otherwise. void nn::pia::common::CallContext::RegisterCompletionCallback | ( | CompletionCallback | pCallback, |
void * | pUserArg = NULL |
||
) |
Sets the callback function executed when asynchronous processing completes.
[in] | pCallback | Specifies a pointer to the callback function called when asynchronous processing completes. |
[in] | pUserArg | Specifies the value given in the second argument when calling pCallback. |