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

An active object that performs its processing through an associated call back function, and which is only performed once. More...

#include <e32base.h>

Inheritance diagram for CAsyncCallBack:
CAsyncOneShot CActive CBase

Public Member Functions

IMPORT_C CAsyncCallBack (TInt aPriority)
 Constructor taking a priority value.
 
IMPORT_C CAsyncCallBack (const TCallBack &aCallBack, TInt aPriority)
 Constructor taking a priority value and a callback.
 
IMPORT_C void Set (const TCallBack &aCallBack)
 Sets the call back.
 
IMPORT_C void CallBack ()
 Queues this active object to be run, if it is not already queued.
 
virtual IMPORT_C ~CAsyncCallBack ()
 Destructor.
 
- Public Member Functions inherited from CAsyncOneShot
IMPORT_C CAsyncOneShot (TInt aPriority)
 Constructor taking a priority value.
 
virtual IMPORT_C void DoCancel ()
 Implements cancellation of an outstanding request.
 
virtual IMPORT_C void Call ()
 Queues this active object to be run once.
 
virtual IMPORT_C ~CAsyncOneShot ()
 Frees resources prior to destruction.
 
RThread & Thread ()
 Gets a handle to the current thread.
 
- Public Member Functions inherited from CActive
IMPORT_C ~CActive ()
 Frees resources prior to destruction.
 
IMPORT_C void Cancel ()
 Cancels the wait for completion of an outstanding request.
 
IMPORT_C void Deque ()
 Removes the active object from the active scheduler's list of active objects.
 
IMPORT_C void SetPriority (TInt aPriority)
 Sets the priority of the active object.
 
TBool IsActive () const
 Determines whether the active object has a request outstanding.
 
TBool IsAdded () const
 Determines whether the active object has been added to the active scheduler's list of active objects.
 
TInt Priority () const
 Gets the priority of the active object.
 
- Public Member Functions inherited from CBase
 CBase ()
 Default constructor.
 
virtual IMPORT_C ~CBase ()
 Virtual destructor.
 
TAny * operator new (TUint aSize, TAny *aBase) __NO_THROW
 Initialises the object to binary zeroes.
 
TAny * operator new (TUint aSize) __NO_THROW
 Allocates the object from the heap and then initialises its contents to binary zeroes.
 
TAny * operator new (TUint aSize, TLeave)
 Allocates the object from the heap and then initialises its contents to binary zeroes.
 
TAny * operator new (TUint aSize, TUint aExtraSize) __NO_THROW
 Allocates the object from the heap and then initialises its contents to binary zeroes.
 
TAny * operator new (TUint aSize, TLeave, TUint aExtraSize)
 Allocates the object from the heap and then initialises its contents to binary zeroes.
 

Protected Member Functions

virtual void RunL ()
 Handles an active object's request completion event.
 
- Protected Member Functions inherited from CActive
IMPORT_C CActive (TInt aPriority)
 Constructs the active object with the specified priority.
 
IMPORT_C void SetActive ()
 Indicates that the active object has issued a request and that it is now outstanding.
 
virtual IMPORT_C TInt RunError (TInt aError)
 Handles a leave occurring in the request completion event handler RunL().
 
virtual IMPORT_C TInt Extension_ (TUint aExtensionId, TAny *&a0, TAny *a1)
 Extension function.
 

Protected Attributes

TCallBack iCallBack
 The callback object that encapsulates the callback function.
 

Additional Inherited Members

- Public Types inherited from CActive
enum  TPriority {
  EPriorityIdle =-100 , EPriorityLow =-20 , EPriorityStandard =0 , EPriorityUserInput =10 ,
  EPriorityHigh =20
}
 Defines standard priorities for active objects. More...
 
- Static Public Member Functions inherited from CBase
static IMPORT_C void Delete (CBase *aPtr)
 Deletes the specified object.
 
- Public Attributes inherited from CActive
TRequestStatus iStatus
 The request status associated with an asynchronous request.
 

Detailed Description

An active object that performs its processing through an associated call back function, and which is only performed once.

API status
Published to all clients. Released API.

Definition at line 1851 of file e32base.h.

Constructor & Destructor Documentation

◆ CAsyncCallBack() [1/2]

IMPORT_C CAsyncCallBack::CAsyncCallBack ( TInt  aPriority)

Constructor taking a priority value.

Specifically, the constructor sets this active object's priority value through a call to the base class constructor in its ctor list.

No call back is set, which means that it must be set subsequently through a call to the Set() function.

CAsyncCallBack::Set

Parameters
aPriorityThe active object priority value. CActive::TPriority defines a standard set of priorities.

(generated from Symbian Developer Library)

◆ CAsyncCallBack() [2/2]

IMPORT_C CAsyncCallBack::CAsyncCallBack ( const TCallBack &  aCallBack,
TInt  aPriority 
)

Constructor taking a priority value and a callback.

Specifically, the constructor:

  1. sets this active object's priority value through a call to the base class constructor in its ctor list
  2. sets the callback; the function encapsulated by the callback is called when this active object is scheduled to run.
Parameters
aCallBackA reference to a callback object encapsulating a function which is called when this active object is ready to run. The constructor takes a copy of this callback object, which means that it can be safely discarded after construction.
aPriorityThe active object priority value.

(generated from Symbian Developer Library)

◆ ~CAsyncCallBack()

IMPORT_C CAsyncCallBack::~CAsyncCallBack ( )
virtual

Destructor.

(generated from Symbian Developer Library)

Member Function Documentation

◆ CallBack()

IMPORT_C void CAsyncCallBack::CallBack ( )

Queues this active object to be run, if it is not already queued.

(generated from Symbian Developer Library)

◆ RunL()

virtual void CAsyncCallBack::RunL ( )
protectedvirtual

Handles an active object's request completion event.

A derived class must provide an implementation to handle the completed request. If appropriate, it may issue another request.

The function is called by the active scheduler when a request completion event occurs, i.e. after the active scheduler's WaitForAnyRequest() function completes.

Before calling this active object's RunL() function, the active scheduler has:

  1. decided that this is the highest priority active object with a completed request
  2. marked this active object's request as complete (i.e. the request is no longer outstanding)

RunL() runs under a trap harness in the active scheduler. If it leaves, then the active scheduler calls RunError() to handle the leave.

Note that once the active scheduler's Start() function has been called, all user code is run under one of the program's active object's RunL() or RunError() functions.

See also
CActiveScheduler::Start
CActiveScheduler::Error
CActiveScheduler::WaitForAnyRequest
TRAPD

Implements CActive.

◆ Set()

IMPORT_C void CAsyncCallBack::Set ( const TCallBack &  aCallBack)

Sets the call back.

Parameters
aCallBackA reference to a callback object encapsulating a function which is called when this active object is ready to run.

Panic condition: E32USER-CBase 1 if the active object is currently active.

(generated from Symbian Developer Library)

Member Data Documentation

◆ iCallBack

TCallBack CAsyncCallBack::iCallBack
protected

The callback object that encapsulates the callback function.

Definition at line 1875 of file e32base.h.


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