CleanupStack Class Reference

class CleanupStack

A collection of static functions that are used to add resources to and remove resources from the cleanup stack.

Public Member Functions
IMPORT_C voidCheck(TAny *)
IMPORT_C voidPop()
IMPORT_C voidPop(TInt)
voidPop(TAny *)
voidPop(TInt, TAny *)
IMPORT_C voidPopAndDestroy()
IMPORT_C voidPopAndDestroy(TInt)
voidPopAndDestroy(TAny *)
voidPopAndDestroy(TInt, TAny *)
IMPORT_C voidPushL(TAny *)
IMPORT_C voidPushL(CBase *)
IMPORT_C voidPushL(TCleanupItem)

Member Functions Documentation

Check(TAny *)

IMPORT_C voidCheck(TAny *aExpectedItem)[static]

Parameters

TAny * aExpectedItem

Pop()

IMPORT_C voidPop()[static]

Pop(TInt)

IMPORT_C voidPop(TIntaCount)[static]

Parameters

TInt aCount

Pop(TAny *)

voidPop(TAny *aExpectedItem)[static, inline]

Pops an object from the top of the cleanup stack.

The function has two modes of operation, depending on whether it is part of a debug build or a release build.

1. In a debug build, the function checks that the specified item is at the top of the cleanup stack before attempting to pop it; an E32USER-CBase 90 panic is raised if the check fails.

2 In a release build, the function just pops the object which is at the top of the cleanup stack; no checking is done.

Parameters

TAny * aExpectedItemA pointer to the item expected to be at the top of the cleanup stack. In a release build, this parameter is not used.

Pop(TInt, TAny *)

voidPop(TIntaCount,
TAny *aLastExpectedItem
)[static, inline]

Pops the specified number of objects from the top of the cleanup stack.

The function has two modes of operation, depending on whether it is part of a debug build or a release build.

1. In a debug build, the function pops (aCount-1) items from the cleanup stack, and then checks that the specified item is the next one on the cleanup stack before attempting to pop it; an E32USER-CBase 90 panic is raised if the check fails.

2. In a release build, the function just pops aCount items from the cleanup stack; no checking is done.

Parameters

TInt aCountThe number of items top be popped from the cleanup stack.
TAny * aLastExpectedItemA pointer to the item expected to be at the top of the cleanup stack, after (aCount-1) items have been popped. In a release build, this parameter is not used.

PopAndDestroy()

IMPORT_C voidPopAndDestroy()[static]

PopAndDestroy(TInt)

IMPORT_C voidPopAndDestroy(TIntaCount)[static]

Parameters

TInt aCount

PopAndDestroy(TAny *)

voidPopAndDestroy(TAny *aExpectedItem)[static, inline]

Pops an object from the top of the cleanup stack, and cleans it up.

The function has two modes of operation, depending on whether it is part of a debug build or a release build.

1. In a debug build, the function checks that the specified item is at the top of the cleanup stack before attempting to pop and clean it up; an E32USER-CBase 90 panic is raised if the check fails.

2. In a release build, the function just pops and cleans up the object at the top of the cleanup stack; no checking is done.

Parameters

TAny * aExpectedItemA pointer to the item expected to be at the top of the cleanup stack. In a release build, this parameter is not used.

PopAndDestroy(TInt, TAny *)

voidPopAndDestroy(TIntaCount,
TAny *aLastExpectedItem
)[static, inline]

Pops the specified number of objects from the top of the cleanup stack, and cleans them up.

The function has two modes of operation, depending on whether it is part of a debug build or a release build.

1. In a debug build, the function pops and cleans up (aCount-1) items from the cleanup stack, and then checks that the specified item is the next one on the cleanup stack before attempting to pop it and clean it up; an E32USER-CBase 90 panic is raised if the check fails.

2. In a release build, the function just pops and cleans up aCount items from the cleanup stack; no checking is done.

Parameters

TInt aCountThe number of items top be popped from the cleanup stack, and cleaned up.
TAny * aLastExpectedItemA pointer to the item expected to be at the top of the cleanup stack, after (aCount-1) items have been popped and cleaned up. In a release build, this parameter is not used.

PushL(TAny *)

IMPORT_C voidPushL(TAny *aPtr)[static]

Parameters

TAny * aPtr

PushL(CBase *)

IMPORT_C voidPushL(CBase *aPtr)[static]

Parameters

CBase * aPtr

PushL(TCleanupItem)

IMPORT_C voidPushL(TCleanupItemanItem)[static]

Parameters

TCleanupItem anItem