Symbian3/PDK/Source/GUID-B0492A3A-A7F6-5F41-AE5C-4B31AC85769B.dita
author Graeme Price <GRAEME.PRICE@NOKIA.COM>
Fri, 15 Oct 2010 14:32:18 +0100
changeset 15 307f4279f433
parent 14 578be2adaf3e
permissions -rw-r--r--
Initial contribution of the Adaptation Documentation.

<?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-B0492A3A-A7F6-5F41-AE5C-4B31AC85769B" xml:lang="en"><title>How to
construct an iterator</title><shortdesc>This document describes how to create an iterator for a doubly
linked list.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
<p>To create an iterator for a doubly linked list of <codeph>CMyClass</codeph> elements,
defined as:</p>
<codeblock id="GUID-B8421BFF-00DF-5BFB-9B6D-6FB9AED822C2" xml:space="preserve">class CMyClass : public CBase
    {
    ...
    TDblQueLink iDlink;
    ...
    };</codeblock>
<p>first construct a header:</p>
<codeblock id="GUID-CAD57B34-4E72-54BE-AE08-2D51C0EA3A24" xml:space="preserve">TDblQue&lt;CMyClass&gt; queHeader(_FOFF(CMyClass,iDlink));</codeblock>
<p> and then construct the iterator. The iterator requires the header at construction
time but the list can be empty:</p>
<codeblock id="GUID-FD953418-DBCD-594B-AFD1-2BF6BA81E37E" xml:space="preserve">TDblQueIter&lt;CMyClass&gt; queIter(queHeader);</codeblock>
<p>The <codeph>TDblQueIter</codeph> class takes a class template parameter
that defines the type of object which is to form an element of the list.</p>
</conbody></concept>