GenericCallback is the base class for callbacks. The reason this base class exists, is that a normal Callback requires the class type where the callback function resides to be known. This is problematic for ie. framework widgets like AbstractButton, on which it should be possible to register a callback on object types that are user-specific and thus unknown to AbstractButton. This is solved by having AbstractButton contain a pointer to a GenericCallback instead. This pointer must then be initialized to point on an instance of Callback, created by the user, which is initialized with the appropriate object type.
Note: As with Callback, this class exists in four versions to support callback functions taking zero, one, two or three arguments.
|virtual void||execute() =0|
|Calls the member function.|
|virtual bool||isValid() const =0|
|Function to check whether the Callback has been initialized with values.|
|Finalizes an instance of the GenericCallback<void> class.|
|virtual void execute||(||)||=0|
Calls the member function.
Do not call execute unless isValid() returns true (ie. a pointer to the object and the function has been set).
|virtual bool isValid||(||)||const =0|
Function to check whether the Callback has been initialized with values.
true If the callback is valid (i.e. safe to call execute).