Original Symbian headers
Selected EUSER, Window Server, networking, graphics and device declarations
Loading...
Searching...
No Matches
TCallBack Class Reference

Encapsulates a general call-back function. More...

#include <e32std.h>

Public Member Functions

 TCallBack ()
 Default constructor.
 
 TCallBack (TInt(*aFunction)(TAny *aPtr))
 Constructs the callback object with the specified callback function.
 
 TCallBack (TInt(*aFunction)(TAny *aPtr), TAny *aPtr)
 Constructs the callback object with the specified callback function and a pointer to any object.
 
TInt CallBack () const
 Calls the callback function.
 

Public Attributes

TInt(* iFunction )(TAny *aPtr)
 A pointer to the callback function.
 
TAny * iPtr
 A pointer that is passed to the callback function when the function is called.
 

Detailed Description

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.

See also
CIdle
CPeriodic
API status
Published to all clients. Released API.

Definition at line 69 of file e32std.h.

Constructor & Destructor Documentation

◆ TCallBack() [1/3]

TCallBack::TCallBack ( )
inline

Default constructor.

Sets the function pointer to Null.

(generated from Symbian Developer Library)

◆ TCallBack() [2/3]

TCallBack::TCallBack ( TInt(*)(TAny *aPtr)  aFunction)
inline

Constructs the callback object with the specified callback function.

Parameters
aFunctionA pointer to the callback function. It takes an argument of type TAny* and returns a TInt. It must be either a static member of a class or a function which is not a member of any class.

(generated from Symbian Developer Library)

◆ TCallBack() [3/3]

TCallBack::TCallBack ( TInt(*)(TAny *aPtr)  aFunction,
TAny *  aPtr 
)
inline

Constructs the callback object with the specified callback function and a pointer to any object.

Parameters
aFunctionA pointer to the callback function. It takes an argument of type TAny* and returns a TInt. It must be either a static member of a class or a function which is not a member of any class.
aPtrA pointer which is always passed to the callback function.

(generated from Symbian Developer Library)

Member Function Documentation

◆ CallBack()

TInt TCallBack::CallBack ( ) const
inline

Calls the callback function.

CIdle CPeriodic

(generated from Symbian Developer Library)

Member Data Documentation

◆ iFunction

TInt(* TCallBack::iFunction) (TAny *aPtr)

A pointer to the callback function.

Definition at line 81 of file e32std.h.

◆ iPtr

TAny* TCallBack::iPtr

A pointer that is passed to the callback function when the function is called.

Definition at line 88 of file e32std.h.


The documentation for this class was generated from the following files: