TCallBackWithArg Class Reference

class TCallBackWithArg

This description is cloned from TCallBack in e32std.h. The only difference between TCallBack and TCallBackWithArg is that the callback of the latter takes 3 arguments. TCallBackWithArg encapsulates a general call-back function. The class encapsulates: 1. a pointer to a function which takes 3 arguments, TAny*, TInt, and TAny* and returns a TInt. 2. a pointer which is passed to the function every time it is called. The pointer can point to any object. This pointer is required in the constructor but can be NULL if not used. 3. The TInt and the other TAny* arguments are passed in when invoking the callback function. Do not let the names of the 3 callback arguments dictate their uses. Feel free to store anything you want or ignore anyone that is not needed.

The callback function can be a static function of a class, e.g. static TInt X::Foo(TAny*, TInt, TAny*) or it can be a function which is not a member of any class, e.g. TInt Foo(TAny *, TInt, TAny*).

Constructor & Destructor Documentation

TCallBackWithArg()

TCallBackWithArg ( ) [inline]

Default contructor sets the callback function to NULL. This way a not yet initialized callback object will just do nothing.

TCallBackWithArg(TInt(*)(TAny *aObj, TInt aEvent, TAny *aData), TAny *)

TCallBackWithArg ( TInt (*)( TAny *aObj, TInt aEvent, TAny *aData) aFunction,
TAny * aObj
) [inline]

Parameters

TInt (*)( TAny *aObj, TInt aEvent, TAny *aData) aFunction
TAny * aObj

Member Functions Documentation

CallBack(TInt, TAny *)

TInt CallBack ( TInt aEvent = ECallBackId_None,
TAny * aData = NULL
) const [inline]

Parameters

TInt aEvent = ECallBackId_None
TAny * aData = NULL

Member Data Documentation

TInt(* iFunction

TInt (* iFunction

A pointer to the callback function.

TAny * iObj

TAny * iObj

the first argument in the callback function.