Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: e32base.h
Link against: Not applicable.

Class TCleanupItem

TCleanupItem

Support

Supported from 5.0

Description

Constructs a TCleanupItem object to be added to the cleanup stack. A TCleanupItem allows the concept of cleanup to be generalised. A TCleanupItem object encapsulates a cleanup operation and an object on which the operation is to be performed.

Cleanup often requires more sophistication than simply deleting objects. For example, releasing access to some commonly used resource.

Defined in TCleanupItem:
TCleanupItem()


Construction and destruction


TCleanupItem()

TCleanupItem(TCleanupOperation anOperation);

Description

Constructs the TCleanupItem with the TCleanupOperation anOperation.

The cleanup operation, defined by the function anOperation, is invoked by the pop and destroy action resulting from a subsequent call to CleanupStack::PopAndDestroy().

Parameters

TCleanupOperation anOperation

The cleanup operation invoked by the pop and destroy action resulting from a subsequent call to CleanupStack::PopAndDestroy().


TCleanupItem()

TCleanupItem(TCleanupOperation anOperation);
TCleanupItem(TCleanupOperation anOperation,TAny* aPtr);

Description

Constructs the TCleanupItem with a TCleanupOperation object and an untyped pointer to an object to be cleaned up.

The cleanup operation, defined by the function anOperation, is invoked by the pop and destroy action resulting from a subsequent call to CleanupStack::PopAndDestroy().

Parameters

TCleanupOperation anOperation

The cleanup operation invoked by the pop and destroy action resulting from a subsequent call to CleanupStack::PopAndDestroy().

TAny* aPtr

An untyped pointer to an object which is the target of the cleanup operation.