class TCallBack |
Encapsulates a general call-back function.
The class encapsulates:
1. a pointer to a function which takes an argument of type 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. It can also be NULL.
The callback function can be a static function of a class, e.g. TInt X::Foo(TAny *) or it can be a function which is not a member of any class, e.g. TInt Foo(TAny *).
When used with the CIdle and the CPeriodic classes, the callback function is intended to be called repeatedly; the encapsulated pointer is passed on each call. Typically, the pointer refers to an object which records the state of the task across each call. When used with CIdle , the callback function should also return a true (non-zero) value if it is intended to be called again, otherwise it should return a false (zero) value.
Public Member Functions | |
---|---|
TCallBack () | |
TCallBack ( TInt (*)( TAny *aPtr)) | |
TCallBack ( TInt (*)( TAny *aPtr), TAny *) | |
TInt | CallBack () |
Public Attributes | |
---|---|
TInt (* | iFunction |
TAny * | iPtr |
TCallBack | ( | TInt (*)( TAny *aPtr) | aFunction | ) | [inline] |
Constructs the callback object with the specified callback function.
TCallBack | ( | TInt (*)( TAny *aPtr) | aFunction, |
TAny * | aPtr | ||
) | [inline] |
Constructs the callback object with the specified callback function and a pointer to any object.
TAny * | iPtr |
A pointer that is passed to the callback function when the function is called.
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.