Symbian3/SDK/Source/GUID-B419D99E-8312-5336-9693-3ED8DFCD0559.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Tue, 20 Jul 2010 12:00:49 +0100
changeset 13 48780e181b38
parent 0 89d6a7a84779
permissions -rw-r--r--
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"Eclipse Public License v1.0" which accompanies this distribution, 
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
    Nokia Corporation - initial contribution.
Contributors: 
-->
<!DOCTYPE task
  PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="GUID-B419D99E-8312-5336-9693-3ED8DFCD0559" xml:lang="en"><title>Automatic
Resource Management Tutorial</title><abstract><p>The class templates for automatic resource management rely on
guaranteed execution of their destructor to trigger cleanup. Due to potential
issues with cleanup order when used in conjunction with the Symbian cleanup
stack, different variants are required for managing local and member variables
as described below.  </p></abstract><prolog><metadata><keywords/></metadata></prolog><taskbody>
<prereq><p>Before beginning you must know the following: </p> <ul>
<li id="GUID-2B05A77D-54BF-5658-B620-F9F63C121DAA"><p> <b> LcleanedupX Classes:</b> The
LCleanedupX class provide a means of automatically cleaning up local variables
on scope exit. </p> </li>
<li id="GUID-06C21765-F4F9-5884-8C1E-93227E253DDF"><p> <b> LmanagedX Classes:</b> The
LManagedX classes provide a means of automatically cleaning up member variables
when the containing object is destroyed </p> </li>
</ul> </prereq>
<context><p>The collection of C++ class templates that provide automatic resource
management provided by EuserHl library is based on the C++ RAII idiom. The
Symbian C++ class templates for automatic resource management are based on
the C++ RAII idiom, in order to provide exception-safe automatic cleanup on
normal or exceptional exit from a scope. </p><p><b>Automatic Resource Management
Class templates</b></p><p>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.  </p><p> The following are the class templates for automatic resource
management: </p><ul>
<li><p><b>LcleanedupX Classes </b></p></li>
<li><p><b>LmanagedX Classes</b> </p></li>
</ul><note> Due to potential issues with cleanup order when used in conjunction
with the Symbian cleanup stack, different variants are required for managing
local and member variables. Click here for more information on
Automatic Resource Management Class templates. </note></context>
</taskbody><related-links>
<link href="GUID-B1D5B680-00E3-5702-985A-94256180E2D8.dita"><linktext>Automatic
Resource Management</linktext></link>
<link href="GUID-69D916D3-ED05-58DA-BA42-CE4D7E4F6482.dita"><linktext>Automatic
 Resource Management Class Templates Tutorial</linktext></link>
</related-links></task>