Symbian3/PDK/Source/GUID-7767599C-7B77-5DD1-8E3E-7AD01EC6F6A1.dita
changeset 12 80ef3a206772
parent 9 59758314f811
child 14 578be2adaf3e
--- a/Symbian3/PDK/Source/GUID-7767599C-7B77-5DD1-8E3E-7AD01EC6F6A1.dita	Fri Jul 02 12:51:36 2010 +0100
+++ b/Symbian3/PDK/Source/GUID-7767599C-7B77-5DD1-8E3E-7AD01EC6F6A1.dita	Fri Jul 16 17:23:46 2010 +0100
@@ -29,7 +29,7 @@
     aStream << iData;
     aStream << *iCompA;
     aStream << *iCompB;
-    }</codeblock> <p>The stream can be visualised as:</p> <fig id="GUID-5B3BAB7B-5CF2-5E1F-8A7D-A3A375E53EC8"><image href="GUID-9E3D71A2-34FA-5A66-B0B9-550816021D79_d0e583565_href.png" placement="inline"/></fig> </section> <section><title>Storing components out-of-line</title> <p>Storing a compound object’s component objects out-of-line means writing all of its component objects to a different stream from that to which it, itself, is written. Each component may be written to its own stream or to its own network of streams. The main advantage of this is that it allows for deferred loading of streams.</p> <p>It is important to note that components are stored <i>before</i> the containing object.</p> <p> The following code fragment defines an example class, CCompound, having two components, <codeph>CComponentA</codeph> and <codeph>CComponentB</codeph>. The components are defined as instances of the templated class TSwizzle.</p> <codeblock id="GUID-B690B024-A3A0-57AC-B36B-4A7B2F3EAF39" xml:space="preserve">CCompound class : public CBase
+    }</codeblock> <p>The stream can be visualised as:</p> <fig id="GUID-5B3BAB7B-5CF2-5E1F-8A7D-A3A375E53EC8"><image href="GUID-9E3D71A2-34FA-5A66-B0B9-550816021D79_d0e632853_href.png" placement="inline"/></fig> </section> <section><title>Storing components out-of-line</title> <p>Storing a compound object’s component objects out-of-line means writing all of its component objects to a different stream from that to which it, itself, is written. Each component may be written to its own stream or to its own network of streams. The main advantage of this is that it allows for deferred loading of streams.</p> <p>It is important to note that components are stored <i>before</i> the containing object.</p> <p> The following code fragment defines an example class, CCompound, having two components, <codeph>CComponentA</codeph> and <codeph>CComponentB</codeph>. The components are defined as instances of the templated class TSwizzle.</p> <codeblock id="GUID-B690B024-A3A0-57AC-B36B-4A7B2F3EAF39" xml:space="preserve">CCompound class : public CBase
     {
     ...
     TInt                  iDdata;
@@ -47,7 +47,7 @@
     map-&gt;Reset();
     CleanupStack::PopAndDestroy(2);
     return id;
-    }</codeblock> <p>The <codeph>StoreL()</codeph> function:</p> <ul><li id="GUID-0C8A4FE4-7D5E-5876-A65E-885AD0E5F76D"><p>writes the <codeph>CCompound</codeph> components to their own streams.</p> </li> <li id="GUID-0DFAD43D-8C0A-5B70-A087-13871A326317"><p>writes <codeph>CCompound</codeph> itself and its components’ stream IDs to a single stream.</p> </li> <li id="GUID-CB63A225-714E-549C-B5DD-51A41B080EB5"><p>returns the ID of the top-level stream.</p> </li> </ul> <p>This can be visualised as:</p> <fig id="GUID-038EC5C3-6C97-5B8B-A495-3C39EC459039"><image href="GUID-B12AAA82-0534-5FBB-B9BA-33056B988575_d0e583638_href.png" placement="inline"/></fig> <p><codeph>CCompound</codeph> ’s components are stored to their own streams by defining and implementing a <codeph>StoreComponentsL()</codeph> member function; this is prototyped as:</p> <codeblock id="GUID-CF751ACF-736F-5A04-A275-8FA3D16A9F27" xml:space="preserve">void StoreComponentsL(CStreamStore&amp; aStore,CStoreMap&amp; aMap)</codeblock> <p>and implemented as:</p> <codeblock id="GUID-69BE7DCB-6861-5BB3-84E4-CBCFFEF9C0B3" xml:space="preserve">void CCompound::StoreComponentsL(CStreamStore&amp; aStore,CStoreMap&amp; aMap)
+    }</codeblock> <p>The <codeph>StoreL()</codeph> function:</p> <ul><li id="GUID-0C8A4FE4-7D5E-5876-A65E-885AD0E5F76D"><p>writes the <codeph>CCompound</codeph> components to their own streams.</p> </li> <li id="GUID-0DFAD43D-8C0A-5B70-A087-13871A326317"><p>writes <codeph>CCompound</codeph> itself and its components’ stream IDs to a single stream.</p> </li> <li id="GUID-CB63A225-714E-549C-B5DD-51A41B080EB5"><p>returns the ID of the top-level stream.</p> </li> </ul> <p>This can be visualised as:</p> <fig id="GUID-038EC5C3-6C97-5B8B-A495-3C39EC459039"><image href="GUID-B12AAA82-0534-5FBB-B9BA-33056B988575_d0e632926_href.png" placement="inline"/></fig> <p><codeph>CCompound</codeph> ’s components are stored to their own streams by defining and implementing a <codeph>StoreComponentsL()</codeph> member function; this is prototyped as:</p> <codeblock id="GUID-CF751ACF-736F-5A04-A275-8FA3D16A9F27" xml:space="preserve">void StoreComponentsL(CStreamStore&amp; aStore,CStoreMap&amp; aMap)</codeblock> <p>and implemented as:</p> <codeblock id="GUID-69BE7DCB-6861-5BB3-84E4-CBCFFEF9C0B3" xml:space="preserve">void CCompound::StoreComponentsL(CStreamStore&amp; aStore,CStoreMap&amp; aMap)
     {
     TStreamId id;