|
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 id="GUID-7DDEE87B-7056-5AAA-91A1-33D3D0D50041" xml:lang="en"><title>Array |
|
13 of packed elements, flat array</title><shortdesc>Describes arrays of packed elements in a flat.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
14 <p>This is a <codeph>CArrayPakFlat<class T></codeph> object whose |
|
15 elements can have different lengths but are physically contiguous within a |
|
16 flat array buffer. Each element is preceded by a <codeph>TInt</codeph> value |
|
17 to record the length of that element.</p> |
|
18 <p>A flat buffer always occupies a single cell allocated from the heap and |
|
19 is always extended by the process of reallocation. A flat array buffer is |
|
20 implemented using a <codeph>CBufFlat</codeph> object. </p> |
|
21 <p>The following diagram illustrates how elements are organised within the |
|
22 array buffer:</p> |
|
23 <fig id="GUID-C36AFFF1-3BE7-5AF3-B852-B1AB3BBA257D"> |
|
24 <image href="GUID-2472E5E0-C33A-51B4-8210-89D7DEFA87C8_d0e307761_href.png" placement="inline"/> |
|
25 </fig> |
|
26 <p>This kind of array is suitable for a small number of objects or for a moderately |
|
27 large but fixed maximum number of objects. It is not suitable for large arrays |
|
28 with a high turnover of elements. </p> |
|
29 <p>A packed array has the advantage over a variable flat array in having a |
|
30 smaller memory overhead for each element. The disadvantage is that the elements |
|
31 and their preceding <codeph>TInt</codeph> values occupy a single cell which |
|
32 has a higher risk of reallocation failure in times of low memory availability.</p> |
|
33 <p>This class is immediately derived from the abstract template |
|
34 base class <codeph>CArrayPak<class T></codeph> which is itself derived |
|
35 from the abstract non-templated base class <codeph>CArrayPakBase</codeph>.</p> |
|
36 <section id="GUID-0758EE5B-5846-4ABD-B2E5-DA2C0AD57032"><title>See also</title> <p><xref href="GUID-112AAFA5-B4C9-5B62-A106-FB5097C13A0E.dita">Using |
|
37 Dynamic Buffers</xref>.</p> </section> |
|
38 </conbody></concept> |