Symbian3/SDK/Source/GUID-E1410365-7254-5326-B3F7-D7100D31E59F.dita
author Dominic Pinkman <Dominic.Pinkman@Nokia.com>
Thu, 21 Jan 2010 18:18:20 +0000
changeset 0 89d6a7a84779
permissions -rw-r--r--
Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385

<?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-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_d0e190901_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>