TAutoClose Class Reference

class TAutoClose

Automatically calls Close() on an object when that object goes out of scope.

The behaviour takes advantage of the fact that the compiler automatically destroys objects that go out of scope.

Public Member Functions
~TAutoClose ()
void Pop ()
void PushL ()
Private Member Functions
void Close ( TAny *)
Public Attributes
T iObj

Constructor & Destructor Documentation

~TAutoClose()

~TAutoClose ( ) [inline]

Destructor.

The implementation calls Close() on iObj, the instance of the template class.

Member Functions Documentation

Close(TAny *)

void Close ( TAny * aObj ) [private, static]

Parameters

TAny * aObj

Pop()

void Pop ( ) [inline]

Pops a single cleanup item from the cleanup stack.

PushL()

void PushL ( ) [inline]

Pushes a cleanup item onto the cleanup stack, so that Close() is called on the templated class object, iObj, if a leave occurs.

Member Data Documentation

T iObj

T iObj

An instance of the template class.