Completable::SetCompletionCallback
Defined in:
Sets the completion callback function for an object.
TSCompletable.h
Prototype
void SetCompletionCallback(CompletionCallback *callback);
void SetCompletionCallback(CompletionCallback *callback, void *cookie);
Parameters
callback |
A pointer to the completion callback function. The function passed will be invoked whenever Completable::HandleCompletion is called (usually from a subclass). The callback parameter may be nullptr , in which case the object has no completion callback function, and calls to Completable::HandleCompletion have no effect.
|
cookie |
The cookie that is passed to the completion callback function as its last parameter. |
Description
The SetCompletionCallback
function sets the completion callback function for an object that inherits from the Completable
class template. The CompletionCallback
type is defined as
typedef void CompletionCallback(classType *, void *);
classType
is the template parameter for the Completable
class template. When a subclass completes a task and needs to notify the user of the object that the task has completed, it calls the Completable::HandleCompletion
function.
See Also
Completable::GetCompletionCallback
Completable::GetCompletionCookie