Symbian3/SDK/Source/GUID-B7482AEB-9E7E-5F9C-A69D-60E1FE82CCE1.dita
author Dominic Pinkman <Dominic.Pinkman@Nokia.com>
Wed, 31 Mar 2010 11:11:55 +0100
changeset 7 51a74ef9ed63
child 13 48780e181b38
permissions -rw-r--r--
Week 12 contribution of API Specs and fix SDK submission
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
7
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     1
<?xml version="1.0" encoding="utf-8"?>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     2
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     3
<!-- This component and the accompanying materials are made available under the terms of the License 
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     4
"Eclipse Public License v1.0" which accompanies this distribution, 
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     5
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     6
<!-- Initial Contributors:
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     7
    Nokia Corporation - initial contribution.
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     8
Contributors: 
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
     9
-->
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    10
<!DOCTYPE concept
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    11
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    12
<concept id="GUID-B7482AEB-9E7E-5F9C-A69D-60E1FE82CCE1" xml:lang="en"><title>dynamicarray:
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    13
Using Dynamic Arrays</title><shortdesc>This example application demonstrates how to construct and use
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    14
dynamic arrays.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    15
<p> The example includes both simple dynamic arrays and extended dynamic arrays.
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    16
You are likely to use simple dynamic arrays often. Extended dynamic arrays
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    17
are combinations of element properties and storage types. </p>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    18
<p>The example implements the following operations for the <xref href="GUID-FAEBF321-6B08-3041-A01F-B1E7282D0707.dita"><apiname>RArray</apiname></xref> and <xref href="GUID-AAA13D1F-1BD7-3331-BB8C-11FA2795B53F.dita"><apiname>RPointerArray</apiname></xref> classes: </p>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    19
<ul>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    20
<li id="GUID-B97ECA5C-C85B-5FFE-85C8-5CF63B1E28BE"><p>Appends elements </p> </li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    21
<li id="GUID-94B944CD-E9E2-5C4D-AACB-9E132A042D9E"><p>Inserts elements </p> </li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    22
<li id="GUID-C08769D8-4921-53BE-A07C-08ADE237D05F"><p>Accesses elements </p> </li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    23
<li id="GUID-CB9EE059-E64B-5178-962F-1B21569581DF"><p>Removes elements </p> </li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    24
<li id="GUID-FFD58188-D8E0-5B53-8E59-91911186C7CB"><p>Finds elements (in various
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    25
ways) </p> </li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    26
<li id="GUID-6ADD8D2B-9B4E-52C5-838E-DA0F3D646390"><p>Sorts array </p> </li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    27
<li id="GUID-BF05324F-470C-5DE6-8BAD-E842D7C2BBC8"><p>Destroys the array </p> </li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    28
</ul>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    29
<section id="GUID-C469AD45-C916-48B9-A621-944D8FE0B625"><title>Download</title> <p>Click
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    30
on the following link to download the example: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-a0e27f39-b574-424f-af5c-8e764d4e3aa0.zip" scope="external">DynamicArrays.zip</xref></p><p>Download some additional files
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    31
required by the example: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/zips/guid-4184e6d4-8dbe-4267-b1a3-8737c8bf64ce.zip" scope="external">CommonFramework.zip</xref></p><p>View the source code: <xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-a0e27f39-b574-424f-af5c-8e764d4e3aa0.html" scope="peer">browse </xref> . View the additional files:<xref href="guid-6013a680-57f9-415b-8851-c4fa63356636/guid-4184e6d4-8dbe-4267-b1a3-8737c8bf64ce.html" scope="peer">browse</xref>.</p> </section>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    32
<section id="GUID-B7551573-B14D-45A9-9F29-39033C2058EC"><title>Description</title> <p>This
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    33
example demonstrates how to construct and use the following types of dynamic
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    34
arrays: </p> <p><b>CArrayFixFlat</b> </p> <p>This example uses the <xref href="GUID-12C65B99-553E-35CA-B36F-2F77BFC972B3.dita"><apiname>CArrayFixFlat</apiname></xref> array
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    35
class to create an array of objects. These objects are of fixed length and
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    36
are stored in a flat buffer. </p> <p>The following operations are performed
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    37
on this array: </p> <ul>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    38
<li id="GUID-98A1051E-C6A9-5A4D-9AC0-6421E7D2B972"><p> <b>Append elements:</b> The
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    39
example uses the <xref href="GUID-79EFD210-2C4F-31E5-83CD-DC9FE54FD585.dita#GUID-79EFD210-2C4F-31E5-83CD-DC9FE54FD585/GUID-B4C14DDC-78BF-3A11-9A7C-6B7F948CE162"><apiname>CArrayFix::AppendL()</apiname></xref> function to append
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    40
objects to the array. </p> </li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    41
<li id="GUID-EC85E528-D19E-5E93-B3D7-09A5E4920335"><p> <b>Insert elements:</b> The
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    42
example uses the <xref href="GUID-79EFD210-2C4F-31E5-83CD-DC9FE54FD585.dita#GUID-79EFD210-2C4F-31E5-83CD-DC9FE54FD585/GUID-C6A1753D-E8A6-39CA-ACCA-42192A7B1BA3"><apiname>CArrayFix::InsertL()</apiname></xref> function to insert
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    43
objects into the array at the specified position. </p> </li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    44
<li id="GUID-2572C5EC-A0AF-59AE-A165-A47741C035B1"><p> <b>Remove elements:</b> The
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    45
example uses the <xref href="GUID-B0159EFA-B76E-3C59-8B35-42CC93DAF0FF.dita#GUID-B0159EFA-B76E-3C59-8B35-42CC93DAF0FF/GUID-3B6B91EE-B89F-3BA9-8F07-5036A347A6DE"><apiname>CArrayFixBase::Delete()</apiname></xref> function to delete
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    46
objects from the array. </p> </li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    47
<li id="GUID-437DB73D-A4CB-573C-B75F-1E56A667F196"><p> <b>Sort elements:</b> The
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    48
example defines an array key to sort the array using the <xref href="GUID-5BC09594-7D9F-3B3F-95B0-7828A756537B.dita"><apiname>TKeyArrayFix</apiname></xref> class.
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    49
The <xref href="GUID-B0159EFA-B76E-3C59-8B35-42CC93DAF0FF.dita#GUID-B0159EFA-B76E-3C59-8B35-42CC93DAF0FF/GUID-B62662E3-F359-3A16-8C61-38A9E2EC7A56"><apiname>CArrayFixBase::Sort()</apiname></xref> function is used to sort the
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    50
array using this array key. </p> </li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    51
<li id="GUID-3EF730BC-B9DC-5906-ACE5-EC57DB8FDF46"><p> <b>Swap two elements:</b> The
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    52
example implements the <xref href="GUID-04117018-A42A-3D49-9EA3-D1D7A7785B0A.dita#GUID-04117018-A42A-3D49-9EA3-D1D7A7785B0A/GUID-22AB214D-552D-3F5B-9A04-E620453FFD08"><apiname>TSwap::Swap()</apiname></xref> function through the <codeph>CMySwap</codeph> class.
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    53
The <codeph>CMySwap::Swap()</codeph> function is used to swap two elements
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    54
of the array. </p> </li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    55
<li id="GUID-58714E19-49E6-528B-A462-F88BCB0063A3"><p> <b>Find an element:</b> The
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    56
example implements the <codeph>TKeyElementFix</codeph> class. This class is
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    57
a <xref href="GUID-0756A649-486C-3CE5-9F1E-467E008A63C7.dita"><apiname>TKey</apiname></xref> derived class. It overrides the <xref href="GUID-0756A649-486C-3CE5-9F1E-467E008A63C7.dita#GUID-0756A649-486C-3CE5-9F1E-467E008A63C7/GUID-EE6812EB-9E48-303D-88B7-B0D49581E9B1"><apiname>TKey::At()</apiname></xref> function.
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    58
The <codeph>TKeyElementFix::At()</codeph> function gets a pointer to the key
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    59
of a specified array element. This function is used by the <xref href="GUID-12C65B99-553E-35CA-B36F-2F77BFC972B3.dita#GUID-12C65B99-553E-35CA-B36F-2F77BFC972B3/GUID-D5FB0842-E883-3977-95EB-EA2D0189A429"><apiname>CArrayFixFlat::Find()</apiname></xref> function
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    60
to find an element in the array. </p> </li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    61
</ul> <p><b>CArrayPtrFlat</b> </p> <p>This example uses the <xref href="GUID-FCE7D958-96AA-346D-8D22-0EF24B9DB7CC.dita"><apiname>CArrayPtrFlat</apiname></xref> array
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    62
class to create an array of pointers to <codeph>CBase</codeph> derived objects. </p> <p>The
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    63
following operations are performed on this array: </p> <ul>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    64
<li id="GUID-291A9D24-E360-59A5-9856-D727920E06A3"><p> <b>Append elements:</b> The
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    65
example uses the <xref href="GUID-79EFD210-2C4F-31E5-83CD-DC9FE54FD585.dita#GUID-79EFD210-2C4F-31E5-83CD-DC9FE54FD585/GUID-B4C14DDC-78BF-3A11-9A7C-6B7F948CE162"><apiname>CArrayFix::AppendL()</apiname></xref> function to append
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    66
objects to the array. </p> </li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    67
<li id="GUID-17E609B9-837D-528B-A4EC-983AFCCC9D55"><p> <b>Insert elements:</b> The
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    68
example uses the <xref href="GUID-79EFD210-2C4F-31E5-83CD-DC9FE54FD585.dita#GUID-79EFD210-2C4F-31E5-83CD-DC9FE54FD585/GUID-C6A1753D-E8A6-39CA-ACCA-42192A7B1BA3"><apiname>CArrayFix::InsertL()</apiname></xref> function to insert
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    69
objects into the array at the specified position. </p> </li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    70
<li id="GUID-CC2A6E70-76E1-5029-B409-09EE2ADFCF0D"><p> <b>Remove elements:</b> The
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    71
example uses the <xref href="GUID-B0159EFA-B76E-3C59-8B35-42CC93DAF0FF.dita#GUID-B0159EFA-B76E-3C59-8B35-42CC93DAF0FF/GUID-3B6B91EE-B89F-3BA9-8F07-5036A347A6DE"><apiname>CArrayFixBase::Delete()</apiname></xref> function to delete
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    72
objects from the array. </p> </li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    73
</ul> <p><b>CArrayVarFlat</b> </p> <p>This example uses the <xref href="GUID-5BC7EAFE-FC9C-3E86-BFDC-FDE9FE086D53.dita"><apiname>CArrayVarFlat</apiname></xref> array
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    74
class to create an array of objects. These objects are of different lengths.
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    75
Pointers to these elements are maintained in a flat dynamic buffer. </p> <p>The
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    76
following operations are performed on this array: </p> <ul>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    77
<li id="GUID-D44919CC-40CF-5BE9-8228-633B752E83BE"><p> <b>Append elements:</b> The
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    78
example uses the <xref href="GUID-C2430ABF-D276-3F70-A18B-7059F3099BF1.dita#GUID-C2430ABF-D276-3F70-A18B-7059F3099BF1/GUID-8C5D0DD4-880F-357C-92F5-C4750EF3F0CA"><apiname>CArrayVar::AppendL()</apiname></xref> function to append
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    79
objects to the array. </p> </li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    80
<li id="GUID-DE339118-3311-5603-8925-9C540E2E3B5F"><p> <b>Sort elements:</b> The
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    81
example defines an array key to sort the array using the <xref href="GUID-03CE0E0B-3731-338A-87E4-49B669AD4EBC.dita"><apiname>TKeyArrayVar</apiname></xref> class.
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    82
The <xref href="GUID-1BA1D5FF-BE4A-3EA5-9784-ADEA1B81EF39.dita#GUID-1BA1D5FF-BE4A-3EA5-9784-ADEA1B81EF39/GUID-9E6E6A98-12F0-3D18-A9A2-5AECEE597FCD"><apiname>CArrayVarBase::Sort()</apiname></xref> function is used to sort the
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    83
array using this array key. </p> </li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    84
</ul> <p><b>CArrayPakFlat</b> </p> <p>This example uses the <xref href="GUID-4D6E6B46-32B5-34AD-BD8A-84BF6B2B7C81.dita"><apiname>CArrayPakFlat</apiname></xref> array
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    85
class to create an array of objects. These objects are of variable lengths.
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    86
These are stored in a flat buffer. Each element is preceded by its length
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    87
information. </p> <p>The following operations are performed on this array: </p> <ul>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    88
<li id="GUID-DC8D9F36-DD53-52CB-B28B-585EF92A4F6E"><p> <b>Append elements:</b> The
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    89
example uses the <xref href="GUID-899495E6-C20E-3614-A3A9-C49A7916E5E7.dita#GUID-899495E6-C20E-3614-A3A9-C49A7916E5E7/GUID-2AA0BFE1-E86D-3E4C-99C0-116A4D23458E"><apiname>CArrayPak::AppendL()</apiname></xref> function to append
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    90
objects to the array. </p> </li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    91
<li id="GUID-CC45322E-DD5A-5A59-99C5-E5EC5F50102F"><p> <b>Find an element:</b> The
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    92
example defines an array key to find an element in the array using the <xref href="GUID-F3BF9485-BA32-36A4-9B39-FC51E28F5A24.dita"><apiname>TKeyArrayPak</apiname></xref> class.
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    93
The <xref href="GUID-800D79F0-D735-3AC5-BDFD-F1E7B8C37B99.dita#GUID-800D79F0-D735-3AC5-BDFD-F1E7B8C37B99/GUID-A52664B1-8E1F-3570-92EC-E7EEEA26F204"><apiname>CArrayPakBase::Find()</apiname></xref> function is used to find an element
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    94
in the array. </p> </li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    95
</ul> <p><b>RArray</b> </p> <p>This example constructs a simple dynamic array
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    96
called <xref href="GUID-FAEBF321-6B08-3041-A01F-B1E7282D0707.dita"><apiname>RArray</apiname></xref>. It is an efficient array of fixed length
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    97
objects. The elements of this array are the instances of another class, so
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    98
this is specified as a template parameter <codeph>T</codeph>. </p> <p>This
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
    99
example shows the following operations to this array: </p> <ul>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   100
<li id="GUID-C70C80B2-E102-5B25-AE9C-9A81FF8A98EB"><p> <b>Append elements:</b> The
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   101
example performs the following steps: </p> <ul>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   102
<li><p>Appends the objects into the array using <xref href="GUID-FAEBF321-6B08-3041-A01F-B1E7282D0707.dita#GUID-FAEBF321-6B08-3041-A01F-B1E7282D0707/GUID-91876009-5DB6-3EC3-A666-C641DFD9F6AC"><apiname>RArray::AppendL()</apiname></xref>.</p></li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   103
<li><p>Displays the number of objects and prints each object present in the
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   104
array.</p></li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   105
</ul> </li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   106
<li id="GUID-6DE66AF3-ECD0-599C-9BE0-CE56FAAE8DEB"><p> <b>Insert elements:</b> The
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   107
example performs the following steps: </p> <ul>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   108
<li><p>Inserts the objects at a specified position using <xref href="GUID-FAEBF321-6B08-3041-A01F-B1E7282D0707.dita#GUID-FAEBF321-6B08-3041-A01F-B1E7282D0707/GUID-16727B8A-AFFB-3980-AD43-5F48FDE6636F"><apiname>RArray::InsertL()</apiname></xref>.</p></li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   109
<li><p>Passes the position of the object to the second parameter of <xref href="GUID-FAEBF321-6B08-3041-A01F-B1E7282D0707.dita#GUID-FAEBF321-6B08-3041-A01F-B1E7282D0707/GUID-16727B8A-AFFB-3980-AD43-5F48FDE6636F"><apiname>RArray::InsertL()</apiname></xref>. </p></li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   110
<li><p>Inserts objects in the beginning, middle, and at the end of the array. </p></li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   111
<li><p>Displays the number of objects and prints each object present in the
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   112
array. </p></li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   113
</ul> </li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   114
<li id="GUID-4D341B6F-68F2-5111-9016-DF394371E9D9"><p> <b>Access elements:</b> The
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   115
example accesses each object in the array and display into the console. </p> </li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   116
<li id="GUID-1BC1A5E9-2C9D-56C3-BD68-ABF6887A6611"><p> <b>Remove elements:</b> The
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   117
example removes an object at a specific position from the array using <xref href="GUID-FAEBF321-6B08-3041-A01F-B1E7282D0707.dita#GUID-FAEBF321-6B08-3041-A01F-B1E7282D0707/GUID-1DB4CB58-EFC8-3A83-9F37-19269C6C2C3B"><apiname>RArray::Remove()</apiname></xref>. </p> </li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   118
<li id="GUID-9A8AE90E-5FBC-546E-8486-B49E9C102ADE"><p> <b>Find elements:</b> The
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   119
example performs the following steps: </p> <ul>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   120
<li><p>Finds the first object in the array that matches the specified object
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   121
using <xref href="GUID-FAEBF321-6B08-3041-A01F-B1E7282D0707.dita#GUID-FAEBF321-6B08-3041-A01F-B1E7282D0707/GUID-3E855FCF-DF2C-3466-86F8-DD1EB6E29276"><apiname>RArray::Find()</apiname></xref>.</p></li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   122
<li><p>Finds the last object in the array that matches the specified object
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   123
using <xref href="GUID-FAEBF321-6B08-3041-A01F-B1E7282D0707.dita#GUID-FAEBF321-6B08-3041-A01F-B1E7282D0707/GUID-C6D7018E-764D-3F22-B2AC-9DD440803E29"><apiname>RArray::FindReverse()</apiname></xref>. </p></li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   124
<li><p>Finds the object using a binary search technique in the array, which
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   125
matches the specified object using <xref href="GUID-FAEBF321-6B08-3041-A01F-B1E7282D0707.dita#GUID-FAEBF321-6B08-3041-A01F-B1E7282D0707/GUID-DCB1F823-9EF6-34DB-8355-2BC2EF26FE7C"><apiname>RArray::FindInSignedKeyOrder()</apiname></xref>.
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   126
It assumes that the existing objects within the array are in signed key order.</p></li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   127
<li><p>Finds the object using a binary search technique in the array, which
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   128
matches the specified object using <xref href="GUID-FAEBF321-6B08-3041-A01F-B1E7282D0707.dita#GUID-FAEBF321-6B08-3041-A01F-B1E7282D0707/GUID-0E388DD6-B45D-3446-8962-A0EDBD342638"><apiname>RArray::FindInUnsignedKeyOrder()</apiname></xref>.
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   129
It assumes that the existing objects within the array are in unsigned key
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   130
order. </p></li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   131
<li><p>Finds the object using a binary search technique in the array, which
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   132
matches the specified object using <xref href="GUID-FAEBF321-6B08-3041-A01F-B1E7282D0707.dita#GUID-FAEBF321-6B08-3041-A01F-B1E7282D0707/GUID-A18066A7-E8D1-3639-A1A3-28FC305530AC"><apiname>RArray::SpecificFindInSignedKeyOrder()</apiname></xref>.
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   133
It passes the mode as the second parameter of this API to find the first,
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   134
last, or any match in case of multiple matches. It assumes that the existing
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   135
objects within the array are in signed key order.</p></li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   136
<li><p>Finds the object using a binary search technique in the array, which
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   137
matches the specified object using <xref href="GUID-FAEBF321-6B08-3041-A01F-B1E7282D0707.dita#GUID-FAEBF321-6B08-3041-A01F-B1E7282D0707/GUID-A2A443D0-0BC5-3918-8F4D-02EE8631DFA5"><apiname>RArray::SpecificFindInUnsignedKeyOrder()</apiname></xref>.
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   138
It passes the mode as the second parameter of this API to find the first,
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   139
last, or any match in case of multiple matches. It assumes that the existing
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   140
objects within the array are in unsigned key order.</p></li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   141
</ul> </li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   142
<li id="GUID-BCE082EF-B079-5CCD-A05D-E75673D41F6A"><p> <b>Sort elements:</b> The
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   143
example performs the following steps: </p> <ul>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   144
<li><p>Constructs two arrays of 64-bit signed integer type objects. </p></li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   145
<li><p>Appends random objects to the first array using <xref href="GUID-FAEBF321-6B08-3041-A01F-B1E7282D0707.dita#GUID-FAEBF321-6B08-3041-A01F-B1E7282D0707/GUID-B765D192-0DFD-3C6C-9CC2-DF9127CCBCD1"><apiname>RArray::Append()</apiname></xref>. </p></li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   146
<li><p>Inserts the data present in the first array to the second array.</p></li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   147
<li><p>Sorts the element of second array using <xref href="GUID-FAEBF321-6B08-3041-A01F-B1E7282D0707.dita#GUID-FAEBF321-6B08-3041-A01F-B1E7282D0707/GUID-1341082A-2B94-39A8-9392-C7579703448B"><apiname>RArray::sort()</apiname></xref>.</p></li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   148
</ul> </li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   149
<li id="GUID-0C4013C6-FF11-5EF5-997D-FC700B0EA074"><p> <b>Destroy the array:</b> The
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   150
example performs the following steps: </p> <ul>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   151
<li><p>Destroys the array using delete operator. </p></li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   152
<li><p>Closes the array and removes all the memory allocated to the array
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   153
using <xref href="GUID-FAEBF321-6B08-3041-A01F-B1E7282D0707.dita#GUID-FAEBF321-6B08-3041-A01F-B1E7282D0707/GUID-03B4185C-48D1-3006-850C-3FEC64624652"><apiname>RArray::Close()</apiname></xref>.</p></li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   154
</ul> </li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   155
</ul> <p><b>RPointerArray</b> </p> <p>This example constructs a simple dynamic
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   156
array of pointers to objects called <xref href="GUID-AAA13D1F-1BD7-3331-BB8C-11FA2795B53F.dita"><apiname>RPointerArray</apiname></xref>. It is
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   157
an efficient pointer array of fixed-length objects. The elements of this array
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   158
are the instances of another class so this is specified as a template parameter <codeph>T</codeph>. </p> <p>This
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   159
example shows the following operations to this array: </p> <ul>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   160
<li id="GUID-407A782D-D24C-57F1-9186-EA282BAED7DE"><p> <b>Append elements:</b> The
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   161
example performs the following steps: <ul>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   162
<li><p>Appends the object pointers into the array using <xref href="GUID-AAA13D1F-1BD7-3331-BB8C-11FA2795B53F.dita#GUID-AAA13D1F-1BD7-3331-BB8C-11FA2795B53F/GUID-E68CDC4B-4F61-38CA-8B15-18316FB3E474"><apiname>RPointerArray::AppendL()</apiname></xref>.</p></li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   163
<li><p>Displays the number of object pointers and prints each object pointer
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   164
present in the array. </p></li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   165
</ul> </p></li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   166
<li id="GUID-F912B096-C0D2-54AB-83BC-5EF5AE27056D"><p> <b>Insert elements:</b> The
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   167
example performs the following steps: </p> <ul>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   168
<li><p>Inserts the objects pointer at a specified position using <xref href="GUID-DB067403-726B-3DCF-B1D9-F51CB2003608.dita#GUID-DB067403-726B-3DCF-B1D9-F51CB2003608/GUID-F93DF5F8-3FEF-3688-8734-CBB14E6359ED"><apiname>RpointerArray::InsertL()</apiname></xref>. </p></li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   169
<li><p>Passes the position of the object pointer to the second parameter of <xref href="GUID-DB067403-726B-3DCF-B1D9-F51CB2003608.dita#GUID-DB067403-726B-3DCF-B1D9-F51CB2003608/GUID-F93DF5F8-3FEF-3688-8734-CBB14E6359ED"><apiname>RpointerArray::InsertL()</apiname></xref>. </p></li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   170
<li><p>Inserts object pointer at the beginning, in the middle, and at the
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   171
end of the array. </p></li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   172
<li><p>Displays the number of object pointers and prints each object pointer
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   173
present in the array. </p></li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   174
</ul> </li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   175
<li id="GUID-EA24F055-BEE4-59D3-AE73-0050D234B210"><p> <b>Access elements:</b> The
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   176
example accesses each object pointer in the array and displays it to the console. </p> </li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   177
<li id="GUID-07DEA041-3DA6-50F0-A741-B35BCE2A8F5E"><p> <b>Remove elements:</b> The
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   178
example removes an object pointer at a specific position from the array using <xref href="GUID-AAA13D1F-1BD7-3331-BB8C-11FA2795B53F.dita#GUID-AAA13D1F-1BD7-3331-BB8C-11FA2795B53F/GUID-EC933901-F350-3A6E-8685-A67CA37A1E11"><apiname>RPointerArray::Remove()</apiname></xref>. </p> </li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   179
<li id="GUID-FA180B99-1F67-59ED-A3D0-72301D9C8715"><p> <b>Find elements:</b> The
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   180
example performs the following steps: </p> <ul>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   181
<li><p>Finds the first object pointer in the array that matches the specified
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   182
object using <xref href="GUID-AAA13D1F-1BD7-3331-BB8C-11FA2795B53F.dita#GUID-AAA13D1F-1BD7-3331-BB8C-11FA2795B53F/GUID-8A9FDFE2-36DF-3761-9954-F109772AF61A"><apiname>RPointerArray::Find()</apiname></xref>. </p></li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   183
<li><p>Finds the last object pointer in the array that matches the specified
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   184
object using <xref href="GUID-AAA13D1F-1BD7-3331-BB8C-11FA2795B53F.dita#GUID-AAA13D1F-1BD7-3331-BB8C-11FA2795B53F/GUID-C5A21601-1A65-3511-ABD6-A8FFD980557A"><apiname>RPointerArray::FindReverse()</apiname></xref>. </p></li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   185
<li><p>Finds the object pointer in the array that matches the specified object
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   186
pointer, using <xref href="GUID-AAA13D1F-1BD7-3331-BB8C-11FA2795B53F.dita#GUID-AAA13D1F-1BD7-3331-BB8C-11FA2795B53F/GUID-A481AF4B-3E62-3C1F-B5D7-8AF728FDF669"><apiname>RPointerArray::FindInAddressOrder()</apiname></xref>. It
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   187
assumes that object pointers in the array are in address order. </p></li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   188
</ul> </li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   189
<li id="GUID-04A741B2-2B7B-582C-A3EB-9826D55A2E09"><p> <b>Sort elements:</b> The
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   190
example performs the following steps: </p><ul>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   191
<li><p>Constructs two arrays of <codeph>TAny</codeph> pointer objects. </p></li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   192
<li><p>Appends random objects to the first pointer array using <xref href="GUID-AAA13D1F-1BD7-3331-BB8C-11FA2795B53F.dita#GUID-AAA13D1F-1BD7-3331-BB8C-11FA2795B53F/GUID-C58AEACF-A227-365B-BFA8-90EFA488ED41"><apiname>RPointerArray::Append()</apiname></xref>. </p></li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   193
<li><p>Inserts the data present in the first pointer array to the second pointer
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   194
array. </p></li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   195
<li><p>Sorts the element of the second pointer array using <xref href="GUID-AAA13D1F-1BD7-3331-BB8C-11FA2795B53F.dita#GUID-AAA13D1F-1BD7-3331-BB8C-11FA2795B53F/GUID-46A0EC17-43BA-33B8-B24C-7D30F5726668"><apiname>RPointerArray::sort()</apiname></xref>. </p></li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   196
</ul> </li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   197
<li id="GUID-2B2521B2-815E-5798-8258-76B812BA42B5"><p> <b>Destroy the array:</b> The
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   198
example performs the following steps: </p> <ul>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   199
<li><p>Destroys and resets the pointer array using <xref href="GUID-AAA13D1F-1BD7-3331-BB8C-11FA2795B53F.dita#GUID-AAA13D1F-1BD7-3331-BB8C-11FA2795B53F/GUID-5F92DA38-9A3C-3D78-9E8B-F0341025F73C"><apiname>RPointerArray::ResetAnddestroy()</apiname></xref>. </p></li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   200
<li><p>Closes the pointer array and removes all the memory allocated to the
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   201
array using <xref href="GUID-AAA13D1F-1BD7-3331-BB8C-11FA2795B53F.dita#GUID-AAA13D1F-1BD7-3331-BB8C-11FA2795B53F/GUID-B96DA352-0983-31F3-BF46-EE30122F27B5"><apiname>RPointerArray::Close()</apiname></xref>. </p></li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   202
</ul> </li>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   203
</ul> </section>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   204
<section id="GUID-232031B9-5964-45FC-A497-1FBC6FB068B1"><title>Class summary</title><p> <xref href="GUID-12C65B99-553E-35CA-B36F-2F77BFC972B3.dita"><apiname>CArrayFixFlat </apiname></xref>  <xref href="GUID-FCE7D958-96AA-346D-8D22-0EF24B9DB7CC.dita"><apiname>CArrayPtrFlat </apiname></xref> <xref href="GUID-5BC7EAFE-FC9C-3E86-BFDC-FDE9FE086D53.dita"><apiname>CArrayVarFlat </apiname></xref>  <xref href="GUID-4D6E6B46-32B5-34AD-BD8A-84BF6B2B7C81.dita"><apiname>CArrayPakFlat </apiname></xref>  <xref href="GUID-04117018-A42A-3D49-9EA3-D1D7A7785B0A.dita"><apiname>TSwap </apiname></xref> <xref href="GUID-5BC09594-7D9F-3B3F-95B0-7828A756537B.dita"><apiname>TKeyArrayFix </apiname></xref>  <xref href="GUID-03CE0E0B-3731-338A-87E4-49B669AD4EBC.dita"><apiname>TKeyArrayVar </apiname></xref>  <xref href="GUID-F3BF9485-BA32-36A4-9B39-FC51E28F5A24.dita"><apiname>TKeyArrayPak </apiname></xref> <xref href="GUID-0756A649-486C-3CE5-9F1E-467E008A63C7.dita"><apiname>TKey </apiname></xref>  <xref href="GUID-FAEBF321-6B08-3041-A01F-B1E7282D0707.dita"><apiname>RArray </apiname></xref>  <xref href="GUID-C028C373-CE25-3832-855E-17FB738721CF.dita"><apiname>TLinearOrder </apiname></xref>  <xref href="GUID-AAA13D1F-1BD7-3331-BB8C-11FA2795B53F.dita"><apiname>RPointerArray</apiname></xref>  </p></section>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   205
<section id="GUID-7F5416FD-580C-4CD5-8167-DB6C546B75A4"><title>Build</title> <p> <xref href="GUID-3100800B-B2F7-50EF-BD4C-3C345ECCB2A5.dita">The Symbian build process</xref> describes
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   206
how to build this example. </p> <p>For the emulator, the example builds an
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   207
executable file called <filepath>DynamicArrays.exe</filepath> in the standard
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   208
location (<filepath>\epoc32\release\winscw\&lt;build_variant&gt;</filepath> for
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   209
CodeWarrior) directory. After launching the executable file, depending on
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   210
the emulator you are using, you can task away from the application launcher
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   211
or shell screen to view the console. </p> </section>
51a74ef9ed63 Week 12 contribution of API Specs and fix SDK submission
Dominic Pinkman <Dominic.Pinkman@Nokia.com>
parents:
diff changeset
   212
</conbody></concept>