diff -r 000000000000 -r 89d6a7a84779 Symbian3/SDK/Source/GUID-B1D5B680-00E3-5702-985A-94256180E2D8.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/SDK/Source/GUID-B1D5B680-00E3-5702-985A-94256180E2D8.dita Thu Jan 21 18:18:20 2010 +0000 @@ -0,0 +1,106 @@ + + + + + +Automatic +Resource ManagementAutomatic resource management is designed to increase the baseline +usability of Symbian platform for Symbian Developers. +
Need for Automatic resource management

The use of +the Symbian Cleanup Stack is more difficult, error-prone and requires writing +extra code for explicit cleanup using the CleanupStack. In contrast, the Symbian +C++ class templates for automatic resource management are relatively easier +to use. They provide automatic exception-safe cleanup upon normal or exceptional +exit from a scope, in which case they do not require writing any code for +invoking the cleanup of resources. The resources are automatically cleaned +up by the destructors of the template classes in that case.

+
Characteristics of Automatic resource management

The +following are the characteristics of automatic resource management:

    +
  • Improved usability versus +the cleanup stack and the manual authoring of destructors.

  • +
  • Covering data member +management as well as local variable management.

  • +
  • A comprehensive replacement +for the existing cleanup stack API.

  • +
  • Ability to handle C-classes, +R-classes, and custom cleanups.

  • +
+
Template classes

The following variants of the class +templates for automatic resource management have been provided:

    +
  • LCleanedup class +templates

    The LCleanedup class templates provided are:

    + + + +Templates +Description + + + + +

    LCleanedupPtr

    +

    Provides automatic management of pointers

    +
    + +

    LCleanedupHandle

    +

    Provides automatic management of resource handles

    +
    + +

    LCleanedupRef

    +

    Provides automatic management of object references

    +
    + +

    LCleanedupArray

    +

    Provides automatic management of C++ style arrays

    +
    + +

    LCleanedupGuard

    +

    Provides automatic generic cleanup

    +
    + + +
  • +
  • LManaged class +templates

    The LManaged class templates provided are:

    + + + +Templates +Description + + + + +

    LManagedPtr

    +

    Provides automatic management of pointers

    +
    + +

    LManagedHandle

    +

    Provides automatic management of resource handles

    +
    + +

    LManagedRef

    +

    Provides automatic management of object references

    +
    + +

    LManagedArray

    +

    Provides automatic management of C++ style arrays

    +
    + +

    LManagedGuard

    +

    Provides automatic generic cleanup

    +
    + + +
  • +
+
See Also

EUser +High Level Overview

EUser +High Level Tutorials

+
\ No newline at end of file