|
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-C15F56E3-753C-55CA-B3EF-63B2D139BCE4" xml:lang="en"><title>Dynamic |
|
13 Buffers Overview</title><shortdesc>This document provides an overview of dynamic buffers.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
14 <section id="GUID-48A3C000-BAAB-4F20-801C-1F6E7C24C93D"><title>Purpose</title> <p>Manipulates data buffers of variable length.</p> <p>For |
|
15 fixed length data buffers, or buffers whose length does not vary much from |
|
16 a known maximum size, use descriptors rather than this API.</p> </section> |
|
17 <section id="GUID-092B2DE6-4E3D-424A-879A-B7BEC34796B0"><title>Description</title> <p>The API has three key concepts: dynamic |
|
18 buffer base, flat dynamic buffer, and segmented dynamic buffer. </p> <p><b>Dynamic |
|
19 buffer base</b> </p> <p>The dynamic buffer base specifies a common interface |
|
20 to dynamic buffers. It provides operations to manage the buffer position, |
|
21 a byte offset into the buffer’s data. Clients use a buffer position to reference |
|
22 the buffer, rather than explicit pointers, which can become outdated when |
|
23 reallocations occur.</p> <p>The dynamic buffer base interface is provided |
|
24 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 |
|
25 in a single contiguous memory area. A flat buffer is the most efficient choice |
|
26 when resizing the buffer beyond a certain maximum length is not expected often.</p> <p>The |
|
27 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 |
|
28 store data in multiple memory areas. They are to be preferred for very large |
|
29 amounts of data, and where resizing of the buffer is commonly expected. </p> <p>The |
|
30 segmented dynamic buffer interface is provided by <xref href="GUID-74CD841C-49EE-3512-9C05-2A05924A63A7.dita"><apiname>CBufSeg</apiname></xref>.</p> </section> |
|
31 <section id="GUID-1DA4B527-F43B-4762-A747-C0F639A14291"><title>See also</title> <p><xref href="GUID-0817AD1D-58CF-5108-ACBF-26DFD4BA395E.dita">Descriptors |
|
32 Overview</xref> </p> </section> |
|
33 </conbody></concept> |