Symbian3/SDK/Source/GUID-D37E0579-0F3B-5EE4-8264-1358E493672B.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Fri, 11 Jun 2010 12:39:03 +0100
changeset 8 ae94777fff8f
parent 7 51a74ef9ed63
child 13 48780e181b38
permissions -rw-r--r--
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.

<?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 id="GUID-D37E0579-0F3B-5EE4-8264-1358E493672B" xml:lang="en"><title>Array
of variable length elements, flat buffer</title><shortdesc>Describes how elements of varying length are organised in the array
buffer.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
<p>This is a <codeph>CArrayVarFlat&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 physically contiguous within the flat array buffer.
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 flat buffer always occupies a single cell allocated from the heap and
is always extended by the process of reallocation. A flat array buffer is
implemented using a <codeph>CBufFlat</codeph> object.</p>
<p>The following diagram illustrates how elements are organised within the
array buffer:</p>
<fig id="GUID-2A857FBF-943D-5665-9999-BC27EA321F73">
<image href="GUID-924E26D6-8B9D-5C76-AF61-7C5514BB3D78_d0e215705_href.png" placement="inline"/>
</fig>
<p>This kind of array is suitable for a small number of elements or for a
moderately large but fixed maximum number of elements. It is not 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 id="GUID-59ADA2D7-56B2-44C3-8E7C-A5DE5F0BBDBA"><title>See also</title> <p><xref href="GUID-112AAFA5-B4C9-5B62-A106-FB5097C13A0E.dita">Using
Dynamic Buffers</xref>.</p> </section>
</conbody></concept>