Symbian3/SDK/Source/GUID-7DDEE87B-7056-5AAA-91A1-33D3D0D50041.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-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&lt;class T&gt;</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_d0e215812_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&lt;class T&gt;</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>