Symbian3/SDK/Source/GUID-74C7B8E1-0A02-5242-A8C9-5CDD410102CC.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Tue, 20 Jul 2010 12:00:49 +0100
changeset 13 48780e181b38
parent 0 89d6a7a84779
permissions -rw-r--r--
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.

<?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-74C7B8E1-0A02-5242-A8C9-5CDD410102CC" xml:lang="en"><title>Identifying
elements</title><shortdesc>Describes how to identify elements within arrays.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
<p>Elements within arrays are identified by their logical position within
the array.</p>
<p>Elements can also be accessed by key.</p>
<p>For all of the arrays <i>except</i>: <codeph>RArray&lt;class T&gt;</codeph>, <codeph>RPointerArray&lt;class T&gt;</codeph> and
any of their specialisations, the key structure is defined independently of
the array itself, using:</p>
<ul>
<li id="GUID-DD8F7A9A-5A95-59DC-A98B-D3F74CCFD1D9"><p>a <codeph>TKeyArrayFix</codeph> object
for arrays of same length elements.</p> </li>
<li id="GUID-BB94B0F3-E182-5A14-98DE-BEC9D150C91A"><p>a <codeph>TKeyArrayVar</codeph> object
for arrays of variable length elements.</p> </li>
<li id="GUID-2AD3D7F3-3C1C-51EE-ADB4-7EEE489F42D0"><p>a <codeph>TKeyArrayPak</codeph> object
for arrays of packed (variable length) elements.</p> </li>
</ul>
<p>Accessing an element by key requires the appropriate <codeph>TKeyArrayFix</codeph>, <codeph>TKeyArrayVar</codeph> or <codeph>TKeyArrayPak</codeph> object to be constructed and passed to the appropriate array class member
function.</p>
<p>For the: <codeph>RArray&lt;class T&gt;</codeph>, <codeph>RPointerArray&lt;class T&gt;</codeph> arrays,
keys are part of the array itself. These arrays also use the classes:</p>
<ul>
<li id="GUID-476F1A74-3EEA-5F2D-BCDD-1CE53949D087"><p><codeph>TLinearOrder&lt;class T&gt;</codeph> to
define the ordering of two objects.</p> </li>
<li id="GUID-2631B9C1-5716-5FF3-B248-E19E75BB212F"><p><codeph>TIdentityRelation&lt;class T&gt;</codeph> to
define the comparison of two objects.</p> </li>
</ul>
</conbody></concept>