Symbian3/PDK/Source/GUID-C15F56E3-753C-55CA-B3EF-63B2D139BCE4.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Fri, 13 Aug 2010 16:47:46 +0100
changeset 14 578be2adaf3e
parent 5 f345bda72bc4
permissions -rw-r--r--
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-C15F56E3-753C-55CA-B3EF-63B2D139BCE4" xml:lang="en"><title>Dynamic
Buffers Overview</title><shortdesc>This document provides an overview of dynamic buffers.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
<section id="GUID-48A3C000-BAAB-4F20-801C-1F6E7C24C93D"><title>Purpose</title> <p>Manipulates data buffers of variable length.</p> <p>For
fixed length data buffers, or buffers whose length does not vary much from
a known maximum size, use descriptors rather than this API.</p> </section>
<section id="GUID-092B2DE6-4E3D-424A-879A-B7BEC34796B0"><title>Description</title> <p>The API has three key concepts: dynamic
buffer base, flat dynamic buffer, and segmented dynamic buffer. </p> <p><b>Dynamic
buffer base</b> </p> <p>The dynamic buffer base specifies a common interface
to dynamic buffers. It provides operations to manage the buffer position,
a byte offset into the buffer’s data. Clients use a buffer position to reference
the buffer, rather than explicit pointers, which can become outdated when
reallocations occur.</p> <p>The dynamic buffer base interface is provided
by the abstract class <xref href="GUID-33BEE1B4-20A1-392B-89B3-DA5D4F46418E.dita"><apiname>CBufBase</apiname></xref>.</p> <p><b>Flat dynamic buffer</b> </p> <p>The flat dynamic buffer stores all data
in a single contiguous memory area. A flat buffer is the most efficient choice
when resizing the buffer beyond a certain maximum length is not expected often.</p> <p>The
flat dynamic buffer interface is provided by <xref href="GUID-F915EF7D-7C06-3902-AB84-C8E89ABE7F18.dita"><apiname>CBufFlat</apiname></xref>.</p> <p><b>Segmented dynamic buffer</b> </p> <p>The segmented dynamic buffer can
store data in multiple memory areas. They are to be preferred for very large
amounts of data, and where resizing of the buffer is commonly expected. </p> <p>The
segmented dynamic buffer interface is provided by <xref href="GUID-74CD841C-49EE-3512-9C05-2A05924A63A7.dita"><apiname>CBufSeg</apiname></xref>.</p> </section>
<section id="GUID-1DA4B527-F43B-4762-A747-C0F639A14291"><title>See also</title> <p><xref href="GUID-0817AD1D-58CF-5108-ACBF-26DFD4BA395E.dita">Descriptors
Overview</xref> </p> </section>
</conbody></concept>