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.
- T1 The type of the first argument in the member function, or void if none.
- T2 The type of the second argument in the member function, or void if none.
Note: As with Callback, this class exists in four versions to support callback functions taking zero, one, two or three arguments.
|virtual void||execute(T1 val1, T2 val2) =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 void> class.|
|virtual void execute||(||T1||val1 ,||=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).
|val1||This value will be passed as the first argument in the function call.|
|val2||This value will be passed as the second argument in the function call.|
|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).
Finalizes an instance of the void> class.