CActiveScheduler Class Reference

class CActiveScheduler : public CBase

Controls the handling of asynchronous requests as represented by active objects.

An active scheduler is used to schedule the sequence in which active object request completion events are handled by a single event-handling thread.

An active scheduler can be instantiated and used directly if either:

  • the RunL() function of all of its active objects is guaranteed not to leave, or

  • each of its active objects implements a suitable RunError() function to provide suitable cleanup

If any of the active scheduler's active objects does not provide a RunError() function, then a CActiveScheduler derived class must be defined and an implementation of the Error() function provided to perform the cleanup required.

There is one active scheduler per thread and the static functions provided by the class always refer to the current active scheduler.

CActiveScheduler::Error

CActive

CActiveSchedulerWait

Inherits from

Nested Classes and Structures

Public Member Functions
CActiveScheduler()
~CActiveScheduler()
IMPORT_C voidAdd(CActive *)
IMPORT_C CActiveScheduler *Current()
IMPORT_C voidError(TInt)
IMPORT_C voidHalt(TInt)
IMPORT_C voidInstall(CActiveScheduler *)
IMPORT_C CActiveScheduler *Replace(CActiveScheduler *)
IMPORT_C TBoolRunIfReady(TInt &, TInt)
IMPORT_C TIntStackDepth()
IMPORT_C voidStart()
IMPORT_C voidStop()
IMPORT_C voidWaitForAnyRequest()
Protected Member Functions
IMPORT_C TIntExtension_(TUint, TAny *&, TAny *)
TInt Level()
Private Member Functions
voidDoRunL(TLoopOwner *const volatile &, CActive *volatile &, TCleanupBundle *)
IMPORT_C voidOnStarting()
IMPORT_C voidOnStopping()
IMPORT_C voidReserved_1()
IMPORT_C voidReserved_2()
voidRun(TLoopOwner *const volatile &)
voidStart(TLoopOwner *)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Public Member Type Definitions
typedefTLoop * TLoopOwner
Private Attributes
TPriQue< CActive >iActiveQ
TAny *iSpare
TLoop *iStack

Constructor & Destructor Documentation

CActiveScheduler()

IMPORT_CCActiveScheduler()

~CActiveScheduler()

IMPORT_C~CActiveScheduler()

Member Functions Documentation

Add(CActive *)

IMPORT_C voidAdd(CActive *aActive)[static]

Parameters

CActive * aActive

Current()

IMPORT_C CActiveScheduler *Current()[static]

DoRunL(TLoopOwner *const volatile &, CActive *volatile &, TCleanupBundle *)

voidDoRunL(TLoopOwner *const volatile &aLoop,
CActive *volatile &aCurrentObj,
TCleanupBundle *aCleanupBundle
)[private]

Parameters

TLoopOwner *const volatile & aLoop
CActive *volatile & aCurrentObj
TCleanupBundle * aCleanupBundle

Error(TInt)

IMPORT_C voidError(TIntaError)const [virtual]

Parameters

TInt aError

Extension_(TUint, TAny *&, TAny *)

IMPORT_C TIntExtension_(TUintaExtensionId,
TAny *&a0,
TAny *a1
)[protected, virtual]

Parameters

TUint aExtensionId
TAny *& a0
TAny * a1

Halt(TInt)

IMPORT_C voidHalt(TIntaExitCode)const

Parameters

TInt aExitCode

Install(CActiveScheduler *)

IMPORT_C voidInstall(CActiveScheduler *aScheduler)[static]

Parameters

CActiveScheduler * aScheduler

Level()

TInt Level()const [protected, inline]

Use the StackDepth() function instead.

Gets the scheduler's level of nestedness.

The level of nestedness.

StackDepth()

OnStarting()

IMPORT_C voidOnStarting()[private, virtual]

OnStopping()

IMPORT_C voidOnStopping()[private, virtual]

Replace(CActiveScheduler *)

IMPORT_C CActiveScheduler *Replace(CActiveScheduler *aNewActiveScheduler)[static]

Parameters

CActiveScheduler * aNewActiveScheduler

Reserved_1()

IMPORT_C voidReserved_1()[private, virtual]

Reserved_2()

IMPORT_C voidReserved_2()[private, virtual]

Run(TLoopOwner *const volatile &)

voidRun(TLoopOwner *const volatile &aLoop)[private]

Parameters

TLoopOwner *const volatile & aLoop

RunIfReady(TInt &, TInt)

IMPORT_C TBoolRunIfReady(TInt &aError,
TIntaMinimumPriority
)[static]

Parameters

TInt & aError
TInt aMinimumPriority

StackDepth()

IMPORT_C TIntStackDepth()const

Start()

IMPORT_C voidStart()[static]

Start(TLoopOwner *)

voidStart(TLoopOwner *aOwner)[private, static]

Parameters

TLoopOwner * aOwner

Stop()

IMPORT_C voidStop()[static]

WaitForAnyRequest()

IMPORT_C voidWaitForAnyRequest()[virtual]

Member Type Definitions Documentation

Typedef TLoopOwner

typedef TLoop *TLoopOwner

Member Data Documentation

TPriQue< CActive > iActiveQ

TPriQue< CActive >iActiveQ[private]

TAny * iSpare

TAny *iSpare[private]

TLoop * iStack

TLoop *iStack[private]