#include <e32base.h>
class CCleanup : public CBase |
Protected Attributes | |
---|---|
TCleanupStackItem * | iBase |
TCleanupStackItem * | iNext |
TCleanupStackItem * | iTop |
Public Member Functions | |
---|---|
~CCleanup() | |
IMPORT_C void | Check(TAny *) |
IMPORT_C CCleanup * | New() |
IMPORT_C CCleanup * | NewL() |
IMPORT_C void | NextLevel() |
IMPORT_C void | Pop() |
IMPORT_C void | Pop(TInt) |
IMPORT_C void | PopAll() |
IMPORT_C void | PopAndDestroy() |
IMPORT_C void | PopAndDestroy(TInt) |
IMPORT_C void | PopAndDestroyAll() |
IMPORT_C void | PreviousLevel() |
IMPORT_C void | PushL(TAny *) |
IMPORT_C void | PushL(CBase *) |
IMPORT_C void | PushL(TCleanupItem) |
Protected Member Functions | |
---|---|
CCleanup() | |
IMPORT_C void | DoPop(TInt, TBool) |
IMPORT_C void | DoPopAll(TBool) |
Implements the cleanup stack.
An object of this type is created and used by the cleanup stack interface, CTrapCleanup.
IMPORT_C | ~CCleanup | ( | ) |
Destructor.
Pops and destroys all items from the cleanup stack and then destroys the cleanup stack itself.
IMPORT_C void | Check | ( | TAny * | aExpectedItem | ) |
Checks that the cleanup item at the top of the cleanup stack represents a cleanup operation for the specified object.
Parameter | Description |
---|---|
aExpectedItem | The object which is the subject of the test. |
Provides an implementation for Pop() and PopAndDestroy().
Parameter | Description |
---|---|
aCount | The number of cleanup items to be popped from the cleanup stack. |
aDestroy | ETrue, if cleanup is to be performed; EFalse, otherwise. |
IMPORT_C void | DoPopAll | ( | TBool | aDestroy | ) | [protected] |
Provides an implementation for PopAll() and PopAndDestroyAll().
Parameter | Description |
---|---|
aDestroy | ETrue, if cleanup is to be performed; EFalse, otherwise. |
IMPORT_C CCleanup * | New | ( | ) | [static] |
Creates a new cleanup stack object.
The cleanup stack itself is allocated with enough space initially to hold a number of stack items.
Returns: A pointer to the new cleanup stack object. This is Null if there is insufficient memory.
IMPORT_C CCleanup * | NewL | ( | ) | [static] |
Creates a new cleanup stack object, and leaves if there is insufficient memory to create it.
The cleanup stack itself is allocated with enough space initially to hold a number of stack items.
Returns: A pointer to the new cleanup stack object. This is Null if there is nsufficient memory.
IMPORT_C void | Pop | ( | ) |
Pops a single cleanup item from the cleanup stack.
IMPORT_C void | Pop | ( | TInt | aCount | ) |
Pops the specified number of cleanup items from the cleanup stack.
Parameter | Description |
---|---|
aCount | The number of cleanup items to be popped from the cleanup stack. |
IMPORT_C void | PopAll | ( | ) |
Pops all cleanup items at the current level, and then decrements the level.
IMPORT_C void | PopAndDestroy | ( | ) |
Pops a single cleanup item from the cleanup stack, and invokes its cleanup operation.
IMPORT_C void | PopAndDestroy | ( | TInt | aCount | ) |
Pops the specified number of cleanup items from the cleanup stack, and invokes their cleanup operations.
Parameter | Description |
---|---|
aCount | The number of cleanup items to be popped from the cleanup stack. |
IMPORT_C void | PopAndDestroyAll | ( | ) |
Pops all cleanup items at the current level, invokes their cleanup operations and then decrements the level.
IMPORT_C void | PreviousLevel | ( | ) |
Goes to the previous cleanup level.
IMPORT_C void | PushL | ( | TAny * | aPtr | ) |
Pushes a cleanup item onto the cleanup stack.
The cleanup item represents an operation that frees the specified heap cell.
Parameter | Description |
---|---|
aPtr | A pointer to a heap cell that will be freed by the cleanup operation. |
IMPORT_C void | PushL | ( | TCleanupItem | anItem | ) |
Pushes a cleanup item onto the cleanup stack.
The cleanup item represents a call back operation that performs the required cleanup.
See also: CleanupClosePushL CleanupReleasePushL CleanupDeletePushL
Parameter | Description |
---|---|
anItem | Encapsulates a cleanup operation and an object on which the cleanup operation is to be performed. |