Week 32 contribution of PDK documentation content. See release notes for details. Fixes bug Bug 3582
<?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-7DDEE87B-7056-5AAA-91A1-33D3D0D50041" xml:lang="en"><title>Array
of packed elements, flat array</title><shortdesc>Describes arrays of packed elements in a flat.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
<p>This is a <codeph>CArrayPakFlat<class T></codeph> object whose
elements can have different lengths but are physically contiguous within a
flat array buffer. Each element is preceded by a <codeph>TInt</codeph> value
to record the length of that element.</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-C36AFFF1-3BE7-5AF3-B852-B1AB3BBA257D">
<image href="GUID-2472E5E0-C33A-51B4-8210-89D7DEFA87C8_d0e321359_href.png" placement="inline"/>
</fig>
<p>This kind of array is suitable for a small number of objects or for a moderately
large but fixed maximum number of objects. It is not suitable for large arrays
with a high turnover of elements. </p>
<p>A packed array has the advantage over a variable flat array in having a
smaller memory overhead for each element. The disadvantage is that the elements
and their preceding <codeph>TInt</codeph> values occupy a single cell which
has a higher risk of reallocation failure in times of low memory availability.</p>
<p>This class is immediately derived from the abstract template
base class <codeph>CArrayPak<class T></codeph> which is itself derived
from the abstract non-templated base class <codeph>CArrayPakBase</codeph>.</p>
<section id="GUID-0758EE5B-5846-4ABD-B2E5-DA2C0AD57032"><title>See also</title> <p><xref href="GUID-112AAFA5-B4C9-5B62-A106-FB5097C13A0E.dita">Using
Dynamic Buffers</xref>.</p> </section>
</conbody></concept>