TApaDocCleanupItem Class Reference

class TApaDocCleanupItem

Allows CApaDocument-derived objects to be safely put onto the cleanup stack, by calling CApaProcess::DestroyDocument() should a leave or a call to CleanupStack::PopAndDestroy() occur.

It is used as follows.
TApaDocCleanupItem cleanup(iEikonEnv->Process(),doc);
CleanupStack::PushL(cleanup);
// some potentially leaving code here ...
CleanupStack::Pop(cleanup);
Public Member Functions
TApaDocCleanupItem(CApaProcess *, CApaDocument *)
operator TCleanupItem()
Private Member Functions
IMPORT_C voidDoCleanup(TAny *)
Public Attributes
CApaDocument *iApaDoc
CApaProcess *iApaProcess

Constructor & Destructor Documentation

TApaDocCleanupItem(CApaProcess *, CApaDocument *)

TApaDocCleanupItem(CApaProcess *aProcess,
CApaDocument *aDoc
)[inline]

Constructs a cleanup item object for the specified document.

Parameters

CApaProcess * aProcessA pointer to the process object that will be used to destroy the document.
CApaDocument * aDocThe document to destroy as part of cleanup.

Member Functions Documentation

DoCleanup(TAny *)

IMPORT_C voidDoCleanup(TAny *aPtr)[private, static]

Parameters

TAny * aPtr

operator TCleanupItem()

operator TCleanupItem()[inline]

A TCleanupItem cast operator that enables the TApaDocCleanupItem object to be pushed to the cleanup stack as a TCleanupItem, so that the document will be properly destroyed (by a call to CApaProcess::DestroyDocument()) should a leave or a call to CleanupStack::PopAndDestroy() occur.

Member Data Documentation

CApaDocument * iApaDoc

CApaDocument *iApaDoc

The document to destroy as part of cleanup.

CApaProcess * iApaProcess

CApaProcess *iApaProcess

The process object that will be used to destroy the document.