Symbian3/SDK/Source/GUID-82862A69-5E86-5924-BFF0-F7655FCBFAF0.dita
author Dominic Pinkman <Dominic.Pinkman@Nokia.com>
Thu, 21 Jan 2010 18:18:20 +0000
changeset 0 89d6a7a84779
child 13 48780e181b38
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 id="GUID-82862A69-5E86-5924-BFF0-F7655FCBFAF0" xml:lang="en"><title>Contiguousness</title><shortdesc>Description of contiguous data in flat and segmented buffers.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
<p>In flat buffers, all data is contiguous. The <codeph>Ptr()</codeph> function
always returns a pointer descriptor from the buffer position specified to
the end of the data, and the <codeph>BackPtr()</codeph> function always returns
a pointer descriptor from the beginning of the buffer to the buffer position
specified.</p>
<p>In segmented buffers, data is contained in segments and the maximum length
of contiguous data is the granularity of the buffer. The extent of contiguous
data contained in a segment may vary between a single byte, and the granularity,
if the insertion and deletion pattern is arbitrary.</p>
<p>However, the following guarantee is made: if the number of bytes inserted
or deleted in <i>all</i> insertion and deletion operations is a multiple of
some number <i>n</i>, and the granularity is also a multiple of this number <i>n</i>,
then all data extents will be a multiple of <i>n</i> in length. This implies
that the <codeph>Ptr()</codeph> function, given a buffer position which is
a multiple of <i>n</i>, will always return a pointer descriptor referring
to at least <i>n</i> bytes.</p>
<p>This property of segmented descriptors is exploited by the <codeph>CArrayFixBase</codeph>, <codeph>CArrayVarBase</codeph> and <codeph>CArrayPakBase</codeph> derived array classes. In these classes, all insertion or deletion operations
are always done in terms of the (fixed) length of data stored in the buffer.
Therefore, the data for an individual array element is always contiguous.</p>
</conbody><related-links>
<link>
<desc><xref href="GUID-2F64B579-73D3-548A-9104-16483AF77BCB.dita">Dynamic Arrays</xref></desc>
</link>
</related-links></concept>