|
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-8B28B8BB-6935-5332-B4D3-4183FDA3D202" xml:lang="en"><title>Singly |
|
13 Linked Lists Overview</title><shortdesc>A singly linked list is an ordered, non-indexed list of elements, |
|
14 that can be traversed only from start to end. </shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
15 <section id="GUID-BEE97C73-8E2A-40F3-BBA0-4423B40346C4"><title>Purpose</title> <p>This |
|
16 section of documentation covers the APi that manipulates and manages a singly-linked |
|
17 list: an ordered, non-indexed list of elements, that can be traversed only |
|
18 from start to end. </p> <p>The API contains all the necessary functionality |
|
19 for singly-linked lists. It is possible to derive from its classes to add |
|
20 additional features.</p> </section> |
|
21 <section id="GUID-D998BA4E-B526-4B4A-A5C4-84E95D4ED456"><title>Description</title> <p> The |
|
22 API has three key concepts: list header (TSglQue), link class (TSglQueLink), |
|
23 and iterator class (TSglQueIter). </p> <p><b>General properties</b> </p><p>Note |
|
24 the following properties of singly-linked lists:</p> <ul> |
|
25 <li id="GUID-27F8B3DB-DB3B-5BBA-BBA9-170A0851E5F8"><p>elements can be accessed |
|
26 through iterating through the list, and added to the start and end of a list, |
|
27 but not to the middle </p> </li> |
|
28 <li id="GUID-3174EA23-FD0E-5C1A-8C9C-655814238EBB"><p>elements in a linked |
|
29 list need not be objects of the same type but ought to be derived from the |
|
30 same base class</p> </li> |
|
31 </ul> <p><b>List header</b> </p> <p>The <xref href="GUID-2364CAB0-E19E-5EBB-837F-F6484642C2E4.dita">list |
|
32 header</xref> supplies the behaviour for managing a singly-linked list of |
|
33 objects. </p> <p>The list header interface is provided by <xref href="GUID-40BA1263-BE07-3C7F-955E-0BBC632E7C58.dita"><apiname>TSglQue</apiname></xref> <codeph><class |
|
34 T></codeph>. The <codeph>T</codeph> template parameter specifies the type |
|
35 of objects in the list.</p> <p><b>Link class</b> </p> <p>To be a member of |
|
36 a singly-linked list, an object must contain an instance of the<xref href="GUID-07045409-4714-5800-89EF-73590D4F0F37.dita">link</xref> class |
|
37 as a data member.</p> <p>The link class interface is provided by <xref href="GUID-463970A1-7F84-3916-9236-1FF92F6B85BA.dita"><apiname>TSglQueLink</apiname></xref>.</p> <p><b>Iterator |
|
38 class </b> </p> <p>The <xref href="GUID-82C53275-6F7C-5B3D-9A07-FA4801D42403.dita">iterator</xref> class |
|
39 supplies the behaviour for moving through the elements of a list. </p> <p>The |
|
40 iterator class interface is provided by <xref href="GUID-0A865633-5038-3320-A472-A2EE18F04FBE.dita"><apiname>TSglQueIter</apiname></xref>.</p> </section> |
|
41 <section id="GUID-B7B5EDB5-1688-4745-AA23-975EB42A246D"><title>See also</title> <p><xref href="GUID-B1BDF68C-F989-56BD-AED4-727595D7355C.dita">Doubly Linked Lists Overview</xref> </p> </section> |
|
42 </conbody></concept> |