|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --> |
|
3 <!-- This component and the accompanying materials are made available under the terms of the License |
|
4 "Eclipse Public License v1.0" which accompanies this distribution, |
|
5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --> |
|
6 <!-- Initial Contributors: |
|
7 Nokia Corporation - initial contribution. |
|
8 Contributors: |
|
9 --> |
|
10 <!DOCTYPE concept |
|
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
|
12 <concept id="GUID-B1BDF68C-F989-56BD-AED4-727595D7355C" xml:lang="en"><title>Doubly |
|
13 Linked Lists Overview</title><shortdesc>This document is an overview of doubly linked lists.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
14 <section id="GUID-BC85DA5B-8918-4668-AB55-7E5689C145FB"><title>Purpose</title> <p>Manipulates a doubly-linked list: an ordered, |
|
15 non-indexed list of elements, that can be traversed in both directions. </p> <p>The |
|
16 API contains all the necessary functionality for doubly-linked lists. It is |
|
17 possible to derive from its classes to add additional features.</p> </section> |
|
18 <section id="GUID-110D347E-8D54-4E07-900B-9DD6E4BD1967"><title>Description</title> <p>The API has three key concepts: list |
|
19 header (TDblQue), link class (TDblQueLink), and iterator class (TDblQueIter). </p> <p><b>General properties</b> </p> <p>Note the following properties of doubly-linked |
|
20 lists:</p> <ul> |
|
21 <li id="GUID-C0A25098-7340-59E4-BE7D-2E8C3063CCB0"><p>the list is circular: |
|
22 the last element points forward to the head element and the head element points |
|
23 back to the last element</p> </li> |
|
24 <li id="GUID-869E862F-6DA6-5065-8933-B787C25747CC"><p>elements can be accessed |
|
25 through iterating through the list, and added to the start and end of a list, |
|
26 but not to the middle </p> </li> |
|
27 <li id="GUID-14AEAE92-5DDF-5FEE-AF26-F983AD238365"><p>elements in a linked |
|
28 list need not be objects of the same type but ought to be derived from the |
|
29 same base class</p> </li> |
|
30 </ul> <p><b>List |
|
31 header</b> </p> <p>The list header supplies the behaviour for managing a doubly |
|
32 linked list of objects. </p> <p>The list header interface is provided by <xref href="GUID-E5E9834A-63CA-3F03-88D3-85B912ADA54C.dita"><apiname>TDblQue</apiname></xref> <codeph><class |
|
33 T></codeph>. The <codeph>T</codeph> template parameter specifies the type |
|
34 of objects in the list.</p> <p><b>Link |
|
35 class</b> </p> <p>To be a member of a doubly linked list, an object must contain |
|
36 an instance of the link class as a data member.</p> <p>The link class interface |
|
37 is provided by <xref href="GUID-603E3D27-6A5C-3E3D-8067-69E44AAACC1B.dita"><apiname>TDblQueLink</apiname></xref>.</p> <p><b>Iterator class </b> </p> <p>The iterator class supplies the behaviour |
|
38 for moving through the elements of a list. </p> <p>The iterator class interface |
|
39 is provided by <xref href="GUID-46C6F8E4-C7B5-39B2-A9E6-F022A924FF8C.dita"><apiname>TDblQueIter</apiname></xref>. </p> </section> |
|
40 <section id="GUID-655D5DDF-9F7A-4DD7-AA3B-4CDF3A02B081"><title>See also</title> <p><xref href="GUID-21C04887-9F9C-5066-AA1D-B30C433CC0AE.dita">Circular |
|
41 Buffers Overview</xref> </p> <p><xref href="GUID-8B28B8BB-6935-5332-B4D3-4183FDA3D202.dita">Singly |
|
42 Linked Lists Overview</xref> </p> </section> |
|
43 </conbody></concept> |