Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <e32base.h>
Link against: euser.lib

Class CActiveSchedulerWait

class CActiveSchedulerWait : public CBase;

Description

Controls a single scheduling loop in the current active scheduler.

This class provides better control of nested wait loops in the active scheduler.

Note that a CActiveSchedulerWait object can be used as a data member inside other CBase derived classes.

Derivation

Members

Defined in CActiveSchedulerWait:

Inherited from CBase:

See also:


Construction and destruction


CActiveSchedulerWait()

IMPORT_C CActiveSchedulerWait();

Description

Default constructor.


~CActiveSchedulerWait()

IMPORT_C ~CActiveSchedulerWait();

Description

Ensures that the attached scheduler loop, and all nested loops, are stopped prior to destruction.

See also:

[Top]


Member functions


Start()

IMPORT_C void Start();

Description

Starts a new wait loop under the control of the current active scheduler.

Compared with CActiveScheduler::Start(), this object owns control of the scheduling loop that is started, and that loop can only be stopped by using this objects CActiveSchedulerWait::AsyncStop() function or the CActiveScheduler::Halt(TInt)const function. CActiveSchedulerWait::Start() only returns when either of thos has occurred.

This is the preferred way to start a nested wait loop. Typically, a nested wait loop is used when the handling of a completed event in an active object requires processing further events from the other active objects before it can complete. This is a form of modal processing.

Panic codes

E32USER-CBase

44 if the thread does not have an active scheduler installed.

E32USER-CBase

91 if this object has already been started.

See also:


AsyncStop()

IMPORT_C void AsyncStop();

Description

Stops the scheduling loop owned by this object.

Note that the corresponding call to CActiveSchedulerWait::Start() only returns once all nested scheduler loops have stopped.

Panic codes

E32USER-CBase

92 if the wait object has not been started.


AsyncStop(const TCallBack &)

IMPORT_C void AsyncStop(const TCallBack &aCallMeWhenStopped);

Description

Stops the scheduling loop owned by this object, specifying a callback.

This version of CActiveSchedulerWait::AsyncStop() provides a callback which is invoked immediately after the scheduler loop actually stops before the corresponding call to CActiveSchedulerWait::Start() returns.

Note that the corresponding call to CActiveSchedulerWait::Start() only returns once all nested scheduler loops have stopped.

Parameters

const TCallBack &aCallMeWhenStopped

The callback to invoke when the scheduler loop exits.

Panic codes

E32USER-CBase

92 if the wait object has not been started.


IsStarted()const

inline TBool IsStarted() const;

Description

Reports whether this CActiveSchedulerWait object is currently started.

Note: a CActiveSchedulerWait object itself becomes "stopped" as soon as CActiveSchedulerWait::AsyncStop() is called, and can be started again immediately if required (but this would start a new nested level of the scheduler).

Return value

TBool

True if the scheduling loop is active; false, otherwise.

See also:


CanStopNow()const

IMPORT_C TBool CanStopNow() const;

Description

Reports whether stopping will have immediate effect.

This returns an indication of whether a call to CActiveSchedulerWait::AsyncStop() would be expected to stop the scheduler loop immediately, or whether it will have to wait until nested scheduler loops have stopped. This may alter which version of CActiveSchedulerWait::AsyncStop() you would want to call.

Return value

TBool

Boolean indicating if the scheduling loop would stop immediately.

Panic codes

E32USER-CBase

92 if the wait object has not been started.

See also: