Utility Library
C4Completable.h

class Completable

Objects inherit from the Completable class when they perform a time-consuming task and wish to provide a mechanism for notifying the user of the object when such a task has been completed.
Definition

template <class classType, typename dataType = void *> class Completable

Member Functions
Completable::GetCompletionProc Returns the completion procedure for an object.
Completable::SetCompletionProc Sets the completion procedure for an object.
Completable::GetCompletionData Returns the data value that is passed to the completion procedure.
Completable::SetCompletionData Sets the data value that is passed to the completion procedure.
Completable::CallCompletionProc Invokes the completion procedure for an object.
Template Parameters
classType The type of the class which performs a completable action. This parameter should be the type of the class which inherits directly from the Completable class.
dataType The type of the user-defined data which is passed to the completion procedure encapsulated by the Completable class. The data itself is specified by calling Completable::SetCompletionProc or Completable::SetCompletionData.
Constructor

Completable();

The constructor has protected access takes no parameters. The Completable class can only exist as a base class for another class.
Description
The Completable class encapsulates a completion procedure pointer and a data value which is passed to this completion procedure. The completion procedure is invoked when the Completable::CallCompletionProc function is called. This usually happens when a subclass of Completable completes a time consuming task and wishes to notify some other piece of code.

Upon construction, the completion procedure is set to nullptr, causing calls to Completable::CallCompletionProc to have no effect.