Symbian3/SDK/Source/GUID-FE3825C5-BDEE-5F18-9FFD-2E794E618FEC.dita
changeset 8 ae94777fff8f
parent 7 51a74ef9ed63
child 13 48780e181b38
equal deleted inserted replaced
7:51a74ef9ed63 8:ae94777fff8f
     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-FE3825C5-BDEE-5F18-9FFD-2E794E618FEC"><title>Data Access Example</title><shortdesc>This example describes typical processing of the data in an RMBufChain. </shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody><section><title>Downwards flow</title> <fig id="GUID-43219AE7-A0E4-570A-98ED-07D44D849979"><title>
    12 <concept xml:lang="en" id="GUID-FE3825C5-BDEE-5F18-9FFD-2E794E618FEC"><title>Data Access Example</title><shortdesc>This example describes typical processing of the data in an RMBufChain. </shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody><section><title>Downwards flow</title> <fig id="GUID-43219AE7-A0E4-570A-98ED-07D44D849979"><title>
    13              Example : flow going downwards 
    13              Example : flow going downwards 
    14           </title> <image href="GUID-30987768-8B0A-5A35-820C-DBB410D2053B_d0e113991_href.png" placement="inline"/></fig> <p>The following function is a simplified example of how a component in the middle of the stack could process data sent to the driver. As shown in the above diagram, the upper layer provides the data in the <codeph>RMBufChain</codeph> parameter. </p> <codeblock id="GUID-4C87CEB3-DCFD-5765-BF89-6EF9275EB584" xml:space="preserve">
    14           </title> <image href="GUID-30987768-8B0A-5A35-820C-DBB410D2053B_d0e107453_href.png" placement="inline"/></fig> <p>The following function is a simplified example of how a component in the middle of the stack could process data sent to the driver. As shown in the above diagram, the upper layer provides the data in the <codeph>RMBufChain</codeph> parameter. </p> <codeblock id="GUID-4C87CEB3-DCFD-5765-BF89-6EF9275EB584" xml:space="preserve">
    15 void Send (RMBufChain &amp;aChain) 
    15 void Send (RMBufChain &amp;aChain) 
    16 {
    16 {
    17    TBuf8&lt;KHeaderLength&gt; aHeader;
    17    TBuf8&lt;KHeaderLength&gt; aHeader;
    18    
    18    
    19    // [...] fill the header
    19    // [...] fill the header
    27    // send the updated chain to the next layer
    27    // send the updated chain to the next layer
    28    downwardComponent-&gt;Send(aChain);
    28    downwardComponent-&gt;Send(aChain);
    29 }
    29 }
    30    </codeblock> <p>Note that depending on the available space remaining in front of the data in the MBuf, the <xref href="GUID-F024208C-ED19-3301-85C1-53F397C9910F.dita#GUID-F024208C-ED19-3301-85C1-53F397C9910F/GUID-A7CEF452-AB4E-378C-A262-B1C5FCBA68BB"><apiname>RMBufChain::Prepend()</apiname></xref> method may request the pond to add a new MBuf to the front of the chain. For more information, see <xref href="GUID-B4F15CA3-CAD4-5A87-9610-A656CA337B72.dita#GUID-B4F15CA3-CAD4-5A87-9610-A656CA337B72/GUID-5EBCD46C-5E07-5DB1-90D9-6A5CA3E36C0B">Buffer layout</xref>. </p> </section> <section><title>Upwards flow</title> <fig id="GUID-402331EB-6DE8-5DC5-9FF7-7D5DD8D816D5"><title>
    30    </codeblock> <p>Note that depending on the available space remaining in front of the data in the MBuf, the <xref href="GUID-F024208C-ED19-3301-85C1-53F397C9910F.dita#GUID-F024208C-ED19-3301-85C1-53F397C9910F/GUID-A7CEF452-AB4E-378C-A262-B1C5FCBA68BB"><apiname>RMBufChain::Prepend()</apiname></xref> method may request the pond to add a new MBuf to the front of the chain. For more information, see <xref href="GUID-B4F15CA3-CAD4-5A87-9610-A656CA337B72.dita#GUID-B4F15CA3-CAD4-5A87-9610-A656CA337B72/GUID-5EBCD46C-5E07-5DB1-90D9-6A5CA3E36C0B">Buffer layout</xref>. </p> </section> <section><title>Upwards flow</title> <fig id="GUID-402331EB-6DE8-5DC5-9FF7-7D5DD8D816D5"><title>
    31              Example : flow going upwards 
    31              Example : flow going upwards 
    32           </title> <image href="GUID-11CBC0BA-3683-584A-9DC9-8BD3C9573F01_d0e114021_href.png" placement="inline"/></fig> <p>The following function is a simplified example of how a component in the middle of the stack could process data received by the driver. As shown in the above diagram, the underlying layer provides the data in the <codeph>RMBufChain</codeph> parameter. </p> <codeblock id="GUID-C36656D9-AEB0-5DBF-A469-0183F80AE057" xml:space="preserve">
    32           </title> <image href="GUID-11CBC0BA-3683-584A-9DC9-8BD3C9573F01_d0e107483_href.png" placement="inline"/></fig> <p>The following function is a simplified example of how a component in the middle of the stack could process data received by the driver. As shown in the above diagram, the underlying layer provides the data in the <codeph>RMBufChain</codeph> parameter. </p> <codeblock id="GUID-C36656D9-AEB0-5DBF-A469-0183F80AE057" xml:space="preserve">
    33 void Process (RMBufChain &amp;aChain)
    33 void Process (RMBufChain &amp;aChain)
    34 {
    34 {
    35    TBuf8&lt;KHeaderLength&gt; aHeader;
    35    TBuf8&lt;KHeaderLength&gt; aHeader;
    36    
    36    
    37    // get a copy of the header
    37    // get a copy of the header