Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <MSVAPI.H>
Link against: msgs.lib
Link against: msgs_autoshutdown.lib

Class CMsvOperationActiveSchedulerWait

class CMsvOperationActiveSchedulerWait : public CActive;

Description

Utility class used to wait until an asynchronous messaging operation has completed.

To use the class:

1. Create a new CMsvOperationActiveSchedulerWait object

2. Call the messaging function that returns the asynchronous operation. The operation observer parameter should be the iStatus word of the CMsvOperationActiveSchedulerWait object. This means that the CMsvOperationActiveSchedulerWait object will be signalled when the operation completes.

3. Call the CMsvOperationActiveSchedulerWait object's CMsvOperationActiveSchedulerWait::Start() function. This sets the object to be active.

These steps cause the program to wait until the operation completes.

     CMsvOperationActiveSchedulerWait* waiter=CMsvOperationActiveSchedulerWait::NewLC();
     CMsvOperation* op = function_returning_opLC(waiter->iStatus);
     waiter->Start();

     CleanupStack::PopAndDestroy(2); // op, waiter

Derivation

Members

Defined in CMsvOperationActiveSchedulerWait:

Inherited from CActive:

Inherited from CBase:


Construction and destruction


NewLC(TInt)

IMPORT_C static CMsvOperationActiveSchedulerWait* NewLC(TInt aPriority=EPriorityStandard);

Description

Allocates and constructs a new CMsvOperationActiveSchedulerWait object.

The new object is added to the active scheduler and left on the cleanup stack.

Parameters

TInt aPriority

Active object priority. It has a default value of EPriorityStandard.

Return value

CMsvOperationActiveSchedulerWait *

New CMsvOperationActiveSchedulerWait object

Leave codes

KErrNoMemory


~CMsvOperationActiveSchedulerWait()

IMPORT_C ~CMsvOperationActiveSchedulerWait();

Description

Destructor.

Any active request on the object is cancelled.

[Top]


Member functions


Start()

IMPORT_C void Start();

Description

Sets the object to be active, and wait until the request is completed.


RunL()

private: virtual void RunL();

Description

Handles a request completion event.

The function stops the object waiting, and allows the program to resume execution after the CMsvOperationActiveSchedulerWait::Start() function call.

See also:


DoCancel()

private: virtual void DoCancel();

Description

Implements cancellation of an outstanding request.

See also: