Symbian3/SDK/Source/GUID-E1410365-7254-5326-B3F7-D7100D31E59F.dita
changeset 7 51a74ef9ed63
child 8 ae94777fff8f
equal deleted inserted replaced
6:43e37759235e 7:51a74ef9ed63
       
     1 <?xml version="1.0" encoding="utf-8"?>
       
     2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
       
     3 <!-- This component and the accompanying materials are made available under the terms of the License 
       
     4 "Eclipse Public License v1.0" which accompanies this distribution, 
       
     5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
       
     6 <!-- Initial Contributors:
       
     7     Nokia Corporation - initial contribution.
       
     8 Contributors: 
       
     9 -->
       
    10 <!DOCTYPE concept
       
    11   PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
       
    12 <concept xml:lang="en" id="GUID-E1410365-7254-5326-B3F7-D7100D31E59F"><title>Array of variable length elements, segmented buffer</title><prolog><metadata><keywords/></metadata></prolog><conbody><p>This is a <codeph>CArrayVarSeg&lt;class T&gt;</codeph> object whose elements can have different lengths. Although each element is a <codeph>class T</codeph> object, the length of that object can vary.</p> <p>In this type of array, each element occupies its own individual cell allocated from the heap. The array buffer contains fixed length data structures, one for each element, which are logically contiguous within the buffer but are physically contiguous only within a segment. Each fixed length data structure contains the length of an element (a <codeph>TInt</codeph> value) and a pointer to it. The structure itself is part of the implementation but occupies no more than eight bytes on 32-bit machines.</p> <p>A segmented buffer is implemented as a doubly linked list of equally sized cells allocated from the heap and is always extended by allocating a new segment and inserting it into the appropriate place in the list. A segmented array buffer is implemented using a <codeph>CBufSeg</codeph> object. </p> <p>The following diagram illustrates how elements are organised within the array buffer:</p> <fig id="GUID-D8FD08B3-2896-56FE-8252-E88A250655C4"><image href="GUID-FCFF0750-0AE9-5F51-B4F7-B1655E1AD244_d0e219497_href.png" placement="inline"/></fig> <p>This kind of array is suitable for large arrays with a high turnover of elements.</p> <p>This class is immediately derived from the abstract templated base class <codeph>CArrayVar&lt;class T&gt;</codeph> which is itself derived from the abstract non-templated base class <codeph>CArrayVarBase</codeph>. </p> <section><title>See also</title> <p><xref href="GUID-112AAFA5-B4C9-5B62-A106-FB5097C13A0E.dita">Dynamic Buffers Guide</xref>.</p> </section> </conbody></concept>