Symbian3/SDK/Source/GUID-B7482AEB-9E7E-5F9C-A69D-60E1FE82CCE1.dita
author Dominic Pinkman <Dominic.Pinkman@Nokia.com>
Thu, 11 Mar 2010 15:24:26 +0000
changeset 2 ebc84c812384
parent 0 89d6a7a84779
permissions -rw-r--r--
week 10 bug fix submission: Bug 1892, Bug 1897, Bug 1319. Also 3 or 4 documents were found to contain code blocks with SFL, which has been fixed. Partial fix for broken links, links to Forum Nokia, and the 'Symbian platform' terminology issues.

<?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-B7482AEB-9E7E-5F9C-A69D-60E1FE82CCE1" xml:lang="en"><title>dynamicarray:
Using Dynamic Arrays</title><shortdesc>This example application demonstrates how to construct and use
dynamic arrays.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
<p> The example includes both simple dynamic arrays and extended dynamic arrays.
You are likely to use simple dynamic arrays often. Extended dynamic arrays
are combinations of element properties and storage types. </p>
<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>
<ul>
<li id="GUID-B97ECA5C-C85B-5FFE-85C8-5CF63B1E28BE"><p>Appends elements </p> </li>
<li id="GUID-94B944CD-E9E2-5C4D-AACB-9E132A042D9E"><p>Inserts elements </p> </li>
<li id="GUID-C08769D8-4921-53BE-A07C-08ADE237D05F"><p>Accesses elements </p> </li>
<li id="GUID-CB9EE059-E64B-5178-962F-1B21569581DF"><p>Removes elements </p> </li>
<li id="GUID-FFD58188-D8E0-5B53-8E59-91911186C7CB"><p>Finds elements (in various
ways) </p> </li>
<li id="GUID-6ADD8D2B-9B4E-52C5-838E-DA0F3D646390"><p>Sorts array </p> </li>
<li id="GUID-BF05324F-470C-5DE6-8BAD-E842D7C2BBC8"><p>Destroys the array </p> </li>
</ul>
<section id="GUID-C469AD45-C916-48B9-A621-944D8FE0B625"><title>Download</title> <p>Click
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
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>
<section id="GUID-B7551573-B14D-45A9-9F29-39033C2058EC"><title>Description</title> <p>This
example demonstrates how to construct and use the following types of dynamic
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
class to create an array of objects. These objects are of fixed length and
are stored in a flat buffer. </p> <p>The following operations are performed
on this array: </p> <ul>
<li id="GUID-98A1051E-C6A9-5A4D-9AC0-6421E7D2B972"><p> <b>Append elements:</b> The
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
objects to the array. </p> </li>
<li id="GUID-EC85E528-D19E-5E93-B3D7-09A5E4920335"><p> <b>Insert elements:</b> The
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
objects into the array at the specified position. </p> </li>
<li id="GUID-2572C5EC-A0AF-59AE-A165-A47741C035B1"><p> <b>Remove elements:</b> The
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
objects from the array. </p> </li>
<li id="GUID-437DB73D-A4CB-573C-B75F-1E56A667F196"><p> <b>Sort elements:</b> The
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.
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
array using this array key. </p> </li>
<li id="GUID-3EF730BC-B9DC-5906-ACE5-EC57DB8FDF46"><p> <b>Swap two elements:</b> The
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.
The <codeph>CMySwap::Swap()</codeph> function is used to swap two elements
of the array. </p> </li>
<li id="GUID-58714E19-49E6-528B-A462-F88BCB0063A3"><p> <b>Find an element:</b> The
example implements the <codeph>TKeyElementFix</codeph> class. This class is
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.
The <codeph>TKeyElementFix::At()</codeph> function gets a pointer to the key
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
to find an element in the array. </p> </li>
</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
class to create an array of pointers to <codeph>CBase</codeph> derived objects. </p> <p>The
following operations are performed on this array: </p> <ul>
<li id="GUID-291A9D24-E360-59A5-9856-D727920E06A3"><p> <b>Append elements:</b> The
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
objects to the array. </p> </li>
<li id="GUID-17E609B9-837D-528B-A4EC-983AFCCC9D55"><p> <b>Insert elements:</b> The
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
objects into the array at the specified position. </p> </li>
<li id="GUID-CC2A6E70-76E1-5029-B409-09EE2ADFCF0D"><p> <b>Remove elements:</b> The
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
objects from the array. </p> </li>
</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
class to create an array of objects. These objects are of different lengths.
Pointers to these elements are maintained in a flat dynamic buffer. </p> <p>The
following operations are performed on this array: </p> <ul>
<li id="GUID-D44919CC-40CF-5BE9-8228-633B752E83BE"><p> <b>Append elements:</b> The
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
objects to the array. </p> </li>
<li id="GUID-DE339118-3311-5603-8925-9C540E2E3B5F"><p> <b>Sort elements:</b> The
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.
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
array using this array key. </p> </li>
</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
class to create an array of objects. These objects are of variable lengths.
These are stored in a flat buffer. Each element is preceded by its length
information. </p> <p>The following operations are performed on this array: </p> <ul>
<li id="GUID-DC8D9F36-DD53-52CB-B28B-585EF92A4F6E"><p> <b>Append elements:</b> The
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
objects to the array. </p> </li>
<li id="GUID-CC45322E-DD5A-5A59-99C5-E5EC5F50102F"><p> <b>Find an element:</b> The
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.
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
in the array. </p> </li>
</ul> <p><b>RArray</b> </p> <p>This example constructs a simple dynamic array
called <xref href="GUID-FAEBF321-6B08-3041-A01F-B1E7282D0707.dita"><apiname>RArray</apiname></xref>. It is an efficient array of fixed length
objects. The elements of this array are the instances of another class, so
this is specified as a template parameter <codeph>T</codeph>. </p> <p>This
example shows the following operations to this array: </p> <ul>
<li id="GUID-C70C80B2-E102-5B25-AE9C-9A81FF8A98EB"><p> <b>Append elements:</b> The
example performs the following steps: </p> <ul>
<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>
<li><p>Displays the number of objects and prints each object present in the
array.</p></li>
</ul> </li>
<li id="GUID-6DE66AF3-ECD0-599C-9BE0-CE56FAAE8DEB"><p> <b>Insert elements:</b> The
example performs the following steps: </p> <ul>
<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>
<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>
<li><p>Inserts objects in the beginning, middle, and at the end of the array. </p></li>
<li><p>Displays the number of objects and prints each object present in the
array. </p></li>
</ul> </li>
<li id="GUID-4D341B6F-68F2-5111-9016-DF394371E9D9"><p> <b>Access elements:</b> The
example accesses each object in the array and display into the console. </p> </li>
<li id="GUID-1BC1A5E9-2C9D-56C3-BD68-ABF6887A6611"><p> <b>Remove elements:</b> The
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>
<li id="GUID-9A8AE90E-5FBC-546E-8486-B49E9C102ADE"><p> <b>Find elements:</b> The
example performs the following steps: </p> <ul>
<li><p>Finds the first object in the array that matches the specified object
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>
<li><p>Finds the last object in the array that matches the specified object
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>
<li><p>Finds the object using a binary search technique in the array, which
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>.
It assumes that the existing objects within the array are in signed key order.</p></li>
<li><p>Finds the object using a binary search technique in the array, which
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>.
It assumes that the existing objects within the array are in unsigned key
order. </p></li>
<li><p>Finds the object using a binary search technique in the array, which
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>.
It passes the mode as the second parameter of this API to find the first,
last, or any match in case of multiple matches. It assumes that the existing
objects within the array are in signed key order.</p></li>
<li><p>Finds the object using a binary search technique in the array, which
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>.
It passes the mode as the second parameter of this API to find the first,
last, or any match in case of multiple matches. It assumes that the existing
objects within the array are in unsigned key order.</p></li>
</ul> </li>
<li id="GUID-BCE082EF-B079-5CCD-A05D-E75673D41F6A"><p> <b>Sort elements:</b> The
example performs the following steps: </p> <ul>
<li><p>Constructs two arrays of 64-bit signed integer type objects. </p></li>
<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>
<li><p>Inserts the data present in the first array to the second array.</p></li>
<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>
</ul> </li>
<li id="GUID-0C4013C6-FF11-5EF5-997D-FC700B0EA074"><p> <b>Destroy the array:</b> The
example performs the following steps: </p> <ul>
<li><p>Destroys the array using delete operator. </p></li>
<li><p>Closes the array and removes all the memory allocated to the array
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>
</ul> </li>
</ul> <p><b>RPointerArray</b> </p> <p>This example constructs a simple dynamic
array of pointers to objects called <xref href="GUID-AAA13D1F-1BD7-3331-BB8C-11FA2795B53F.dita"><apiname>RPointerArray</apiname></xref>. It is
an efficient pointer array of fixed-length objects. The elements of this array
are the instances of another class so this is specified as a template parameter <codeph>T</codeph>. </p> <p>This
example shows the following operations to this array: </p> <ul>
<li id="GUID-407A782D-D24C-57F1-9186-EA282BAED7DE"><p> <b>Append elements:</b> The
example performs the following steps: <ul>
<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>
<li><p>Displays the number of object pointers and prints each object pointer
present in the array. </p></li>
</ul> </p></li>
<li id="GUID-F912B096-C0D2-54AB-83BC-5EF5AE27056D"><p> <b>Insert elements:</b> The
example performs the following steps: </p> <ul>
<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>
<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>
<li><p>Inserts object pointer at the beginning, in the middle, and at the
end of the array. </p></li>
<li><p>Displays the number of object pointers and prints each object pointer
present in the array. </p></li>
</ul> </li>
<li id="GUID-EA24F055-BEE4-59D3-AE73-0050D234B210"><p> <b>Access elements:</b> The
example accesses each object pointer in the array and displays it to the console. </p> </li>
<li id="GUID-07DEA041-3DA6-50F0-A741-B35BCE2A8F5E"><p> <b>Remove elements:</b> The
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>
<li id="GUID-FA180B99-1F67-59ED-A3D0-72301D9C8715"><p> <b>Find elements:</b> The
example performs the following steps: </p> <ul>
<li><p>Finds the first object pointer in the array that matches the specified
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>
<li><p>Finds the last object pointer in the array that matches the specified
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>
<li><p>Finds the object pointer in the array that matches the specified object
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
assumes that object pointers in the array are in address order. </p></li>
</ul> </li>
<li id="GUID-04A741B2-2B7B-582C-A3EB-9826D55A2E09"><p> <b>Sort elements:</b> The
example performs the following steps: </p><ul>
<li><p>Constructs two arrays of <codeph>TAny</codeph> pointer objects. </p></li>
<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>
<li><p>Inserts the data present in the first pointer array to the second pointer
array. </p></li>
<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>
</ul> </li>
<li id="GUID-2B2521B2-815E-5798-8258-76B812BA42B5"><p> <b>Destroy the array:</b> The
example performs the following steps: </p> <ul>
<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>
<li><p>Closes the pointer array and removes all the memory allocated to the
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>
</ul> </li>
</ul> </section>
<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>
<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
how to build this example. </p> <p>For the emulator, the example builds an
executable file called <filepath>DynamicArrays.exe</filepath> in the standard
location (<filepath>\epoc32\release\winscw\&lt;build_variant&gt;</filepath> for
CodeWarrior) directory. After launching the executable file, depending on
the emulator you are using, you can task away from the application launcher
or shell screen to view the console. </p> </section>
</conbody></concept>