Symbian3/SDK/Source/GUID-DF7959E7-15A4-5504-8D22-B8189DB2688E.dita
author Graeme Price <GRAEME.PRICE@NOKIA.COM>
Fri, 15 Oct 2010 14:32:18 +0100
changeset 15 307f4279f433
parent 13 48780e181b38
permissions -rw-r--r--
Initial contribution of the Adaptation Documentation.

<?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 concept
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept xml:lang="en" id="GUID-DF7959E7-15A4-5504-8D22-B8189DB2688E"><title>Introduction to Swizzles and deferred loading </title><prolog><metadata><keywords/></metadata></prolog><conbody><p>In complex applications involving a large network of objects, it may be desirable, and even necessary, to defer the loading of objects into memory from the store.</p> <p>It should, therefore, be possible to represent such an object in one of two ways:</p> <ul><li id="GUID-11F8C7C2-C67E-56A0-9F17-9068E69085FF"><p>by the stream ID of the stream containing the external representation of that object, if it is not in memory.</p> </li> <li id="GUID-07C65069-0F05-53D8-AFF8-DD539371CD6D"><p>by a pointer, if it is in memory (or has already been loaded into memory); the pointer points to the in-memory object.</p> </li> </ul> <p>A Swizzle is a device for handling this dual representation.</p> <p>A typical container type object, therefore, does not have a pointer directly to a contained object, but has a Swizzle which can represent that contained object <i>either</i> as a pointer <i>or</i> as a stream ID, as illustrated in the following diagram.</p> <fig id="GUID-F057540D-3613-538E-947F-04C414280A8F"><image href="GUID-8AF21373-E51E-5B9D-ACC1-243752C9BB5B_d0e386310_href.png" placement="inline"/></fig> <p>A Swizzle can be considered as a lean, but efficient, container in its own right.</p> <p>The concrete Swizzle classes are templated; the template parameter defines the type of object which the Swizzle represents.</p> <p>There are two general concrete Swizzle classes:</p> <ul><li id="GUID-AB85BEFF-8377-566B-9073-5C9C3489F3DB"><p><codeph>TSwizzle&lt;class T&gt;</codeph> </p> </li> <li id="GUID-32CF088B-01FA-585B-9C1C-3DC73E83BE85"><p><codeph>TSwizzleC&lt;class T&gt;</codeph> </p> </li> </ul> <p>A <codeph>TSwizzle&lt;class T&gt;</codeph> represents a <codeph>&lt;class T&gt;</codeph> type object. Full access is available to the <codeph>&lt;class T&gt;</codeph> type object through the Swizzle.</p> <p>A <codeph>TSwizzleC&lt;class T&gt;</codeph> represents a <codeph>&lt;class T&gt;</codeph> type object. Access to the object is limited; in particular the object cannot be changed.</p> </conbody></concept>