Symbian3/PDK/Source/GUID-C1BCBA03-4E64-5188-8D33-25B4121C1582.dita
changeset 5 f345bda72bc4
parent 3 46218c8b8afa
child 14 578be2adaf3e
equal deleted inserted replaced
4:4816d766a08a 5:f345bda72bc4
     7     Nokia Corporation - initial contribution.
     7     Nokia Corporation - initial contribution.
     8 Contributors: 
     8 Contributors: 
     9 -->
     9 -->
    10 <!DOCTYPE concept
    10 <!DOCTYPE concept
    11   PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
    11   PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
    12 <concept xml:lang="en" id="GUID-C1BCBA03-4E64-5188-8D33-25B4121C1582"><title>Use of the Internalize class</title><prolog><metadata><keywords/></metadata></prolog><conbody><p>The implementation of the family of operators <xref href="GUID-81749C6F-A341-37A6-9F17-C6028F975764.dita"><apiname>operator&gt;&gt;()</apiname></xref> calls the internal Symbian OS function <codeph>DoInternalizeL()</codeph>. There are two variants of this function distinguished by the value of the third parameter as either <xref href="GUID-0A518426-B517-33C3-B2E3-874CAF36E963.dita#GUID-0A518426-B517-33C3-B2E3-874CAF36E963/GUID-1B393431-A301-3B49-858A-8915017E8CC9"><apiname>Internalize::Member</apiname></xref> or <xref href="GUID-0A518426-B517-33C3-B2E3-874CAF36E963.dita#GUID-0A518426-B517-33C3-B2E3-874CAF36E963/GUID-0F3DF32C-128B-36A0-A4F7-8B7574CE4621"><apiname>Internalize::Function</apiname></xref>.</p> <p>The family of operators <xref href="GUID-81749C6F-A341-37A6-9F17-C6028F975764.dita"><apiname>operator&gt;&gt;()</apiname></xref> are implemented as follows:</p> <codeblock id="GUID-5DCCDC49-ADD3-59F1-9243-BA91C521DFFD" xml:space="preserve">template &lt;class T&gt;
    12 <concept id="GUID-C1BCBA03-4E64-5188-8D33-25B4121C1582" xml:lang="en"><title>Use
       
    13 of the Internalize class</title><prolog><metadata><keywords/></metadata></prolog><conbody>
       
    14 <p>The implementation of the family of operators <xref href="GUID-81749C6F-A341-37A6-9F17-C6028F975764.dita"><apiname>operator&gt;&gt;()</apiname></xref> calls
       
    15 the internal Symbian platform function <codeph>DoInternalizeL()</codeph>.
       
    16 There are two variants of this function distinguished by the value of the
       
    17 third parameter as either <xref href="GUID-0A518426-B517-33C3-B2E3-874CAF36E963.dita#GUID-0A518426-B517-33C3-B2E3-874CAF36E963/GUID-1B393431-A301-3B49-858A-8915017E8CC9"><apiname>Internalize::Member</apiname></xref> or <xref href="GUID-0A518426-B517-33C3-B2E3-874CAF36E963.dita#GUID-0A518426-B517-33C3-B2E3-874CAF36E963/GUID-0F3DF32C-128B-36A0-A4F7-8B7574CE4621"><apiname>Internalize::Function</apiname></xref>.</p>
       
    18 <p>The family of operators <xref href="GUID-81749C6F-A341-37A6-9F17-C6028F975764.dita"><apiname>operator&gt;&gt;()</apiname></xref> are implemented
       
    19 as follows:</p>
       
    20 <codeblock id="GUID-5DCCDC49-ADD3-59F1-9243-BA91C521DFFD" xml:space="preserve">template &lt;class T&gt;
    13 inline RWriteStream&amp; operator&gt;&gt;(RReadStream&amp; aStream,T&amp; anObject)
    21 inline RWriteStream&amp; operator&gt;&gt;(RReadStream&amp; aStream,T&amp; anObject)
    14     {
    22     {
    15     DoInternalizeL(anObject,aStream,Internalization(&amp;anObject));
    23     DoInternalizeL(anObject,aStream,Internalization(&amp;anObject));
    16     return aStream;
    24     return aStream;
    17     }</codeblock> <p>The two variants of <codeph>DoInternalizeL()</codeph> are defined and implemented as:</p> <codeblock id="GUID-0BFB5C93-B2E4-5050-936A-465A077728FB" xml:space="preserve">template &lt;class T&gt;
    25     }</codeblock>
       
    26 <p>The two variants of <codeph>DoInternalizeL()</codeph> are defined and implemented
       
    27 as:</p>
       
    28 <codeblock id="GUID-0BFB5C93-B2E4-5050-936A-465A077728FB" xml:space="preserve">template &lt;class T&gt;
    18 inline void DoInternalizeL(T&amp; anObject,RReadStream&amp; aStream,Internalize::Member)
    29 inline void DoInternalizeL(T&amp; anObject,RReadStream&amp; aStream,Internalize::Member)
    19     {anObject.InternalizeL(aStream);}</codeblock> <codeblock id="GUID-916AE079-80BB-5039-8F96-771F81CC1077" xml:space="preserve">template &lt;class T&gt;
    30     {anObject.InternalizeL(aStream);}</codeblock>
       
    31 <codeblock id="GUID-916AE079-80BB-5039-8F96-771F81CC1077" xml:space="preserve">template &lt;class T&gt;
    20 inline void DoInternalizeL(T&amp; anObject,RReadStream&amp; aStream,Internalize::Function)
    32 inline void DoInternalizeL(T&amp; anObject,RReadStream&amp; aStream,Internalize::Function)
    21     {InternalizeL(anObject,aStream);}</codeblock> <p>The variant called depends on the value returned from a call to the internal selector function, <codeph>Internalization()</codeph>. This selector function returns either <codeph>Internalize::Function</codeph> or <codeph>Internalize::Member</codeph>, depending on the type of <codeph>anObject</codeph>.</p> <p>The internal selector function <codeph>Internalization()</codeph> is a convenience mechanism that allows the <xref href="GUID-81749C6F-A341-37A6-9F17-C6028F975764.dita"><apiname>operator&gt;&gt;()</apiname></xref> to call either the <codeph>InternalizeL()</codeph> member function of a templated class or an <codeph>InternalizeL()</codeph> templated global function.</p> <p>The store framework defines and implements a default selector function, prototyped as:</p> <codeblock id="GUID-28AEEF03-52AC-522B-BFEF-730031BCCFC2" xml:space="preserve">Internalize::Member Internalization(const TAny*)</codeblock> <p>By default, a call to <codeph>Internalization()</codeph> passing a parameter of general class type, is resolved at compile time into a call to this variant, and the return type is <xref href="GUID-0A518426-B517-33C3-B2E3-874CAF36E963.dita#GUID-0A518426-B517-33C3-B2E3-874CAF36E963/GUID-1B393431-A301-3B49-858A-8915017E8CC9"><apiname>Internalize::Member</apiname></xref>. The store framework also defines and implements a number of other variants that take more specific argument types; for example, as part of its implementation of <xref href="GUID-81749C6F-A341-37A6-9F17-C6028F975764.dita"><apiname>operator&gt;&gt;()</apiname></xref> for descriptors, the framework defines and implements:</p> <codeblock id="GUID-442D9DD2-6643-5F3F-ACD4-3D4D42B65639" xml:space="preserve">Internalize::Function Internalization(const TDesC8*)</codeblock> </conbody></concept>
    33     {InternalizeL(anObject,aStream);}</codeblock>
       
    34 <p>The variant called depends on the value returned from a call to the internal
       
    35 selector function, <codeph>Internalization()</codeph>. This selector function
       
    36 returns either <codeph>Internalize::Function</codeph> or <codeph>Internalize::Member</codeph>,
       
    37 depending on the type of <codeph>anObject</codeph>.</p>
       
    38 <p>The internal selector function <codeph>Internalization()</codeph> is a
       
    39 convenience mechanism that allows the <xref href="GUID-81749C6F-A341-37A6-9F17-C6028F975764.dita"><apiname>operator&gt;&gt;()</apiname></xref> to call
       
    40 either the <codeph>InternalizeL()</codeph> member function of a templated
       
    41 class or an <codeph>InternalizeL()</codeph> templated global function.</p>
       
    42 <p>The store framework defines and implements a default selector function,
       
    43 prototyped as:</p>
       
    44 <codeblock id="GUID-28AEEF03-52AC-522B-BFEF-730031BCCFC2" xml:space="preserve">Internalize::Member Internalization(const TAny*)</codeblock>
       
    45 <p>By default, a call to <codeph>Internalization()</codeph> passing a parameter
       
    46 of general class type, is resolved at compile time into a call to this variant,
       
    47 and the return type is <xref href="GUID-0A518426-B517-33C3-B2E3-874CAF36E963.dita#GUID-0A518426-B517-33C3-B2E3-874CAF36E963/GUID-1B393431-A301-3B49-858A-8915017E8CC9"><apiname>Internalize::Member</apiname></xref>. The store framework
       
    48 also defines and implements a number of other variants that take more specific
       
    49 argument types; for example, as part of its implementation of <xref href="GUID-81749C6F-A341-37A6-9F17-C6028F975764.dita"><apiname>operator&gt;&gt;()</apiname></xref> for
       
    50 descriptors, the framework defines and implements:</p>
       
    51 <codeblock id="GUID-442D9DD2-6643-5F3F-ACD4-3D4D42B65639" xml:space="preserve">Internalize::Function Internalization(const TDesC8*)</codeblock>
       
    52 </conbody></concept>