Symbian3/SDK/Source/GUID-B0492A3A-A7F6-5F41-AE5C-4B31AC85769B.dita
author Dominic Pinkman <Dominic.Pinkman@Nokia.com>
Thu, 21 Jan 2010 18:18:20 +0000
changeset 0 89d6a7a84779
permissions -rw-r--r--
Initial contribution of Documentation_content according to Feature bug 1266 bug 1268 bug 1269 bug 1270 bug 1372 bug 1374 bug 1375 bug 1379 bug 1380 bug 1381 bug 1382 bug 1383 bug 1385

<?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>