CMsvOperationActiveSchedulerWait Class Reference

#include <mw/msvapi.h>

class CMsvOperationActiveSchedulerWait : public CActive, public CActive

Inherits from

Detailed 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 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

Constructor & Destructor Documentation

~CMsvOperationActiveSchedulerWait ( )

IMPORT_C~CMsvOperationActiveSchedulerWait()

Destructor.

Any active request on the object is cancelled.

Member Function Documentation

NewLC ( TInt )

IMPORT_C CMsvOperationActiveSchedulerWait *NewLC(TIntaPriority = EPriorityStandard)[static]

Allocates and constructs a new CMsvOperationActiveSchedulerWait object.

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

Parameters
aPriorityActive object priority. It has a default value of EPriorityStandard.
Return Value
New CMsvOperationActiveSchedulerWait object
Leave Codes
KErrNoMemory

Start ( )

IMPORT_C voidStart()

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