03.01.2013 Views

Chapter 1

Chapter 1

Chapter 1

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Linked lists<br />

Class name Description<br />

TSglQue Singly linked list – elements of type T can be added at the start or end of<br />

the list, any element can be removed. The list can be iterated through in<br />

a single direction. [*] A link object(TSglQueLink), that connects each<br />

element to the next one, must be a member of the template class.<br />

TDblQue Doubly linked list – elements of type T can be added to and removed<br />

from the list, at any position. The list can be iterated through in both<br />

directions. [**] A link object (TDblQueLink), that connects each element<br />

to the next and previous elements, must be a member of the template<br />

class.<br />

[*] Using a TSglQueIter<br />

[**] Using a TDblQueIter<br />

Fixed size arrays<br />

Class name Description<br />

TFixedArray A fixed-size array where S specifies the array size and T<br />

specifies the type of elements that it can hold. This class<br />

is a thin wrapper over a standard C++ array, with range<br />

checking. Elements can be deleted through the array, but<br />

it does not have ownership.<br />

Dynamic arrays<br />

Class name Description<br />

TArray An array interface that provides a Count() and<br />

At() function only. Its purpose is to allow all array<br />

types to be represented in a generic way. Elements<br />

can only be accessed through the interface; they<br />

cannot be added or deleted and the array cannot be<br />

sorted. This interface is implemented by all of the<br />

dynamic and fixed-size array types.<br />

RPointerArray A pointer array. Supports uniqueness, sorting and<br />

searching. May be sorted and searched either by<br />

pointer address, or by object pointed to – the latter<br />

requires the caller to specify a function that<br />

compares template class objects. [*] Can exercise<br />

ownership through ResetAndDestroy().<br />

RArray A simple and efficient array of fixed length objects. It<br />

can be sorted and searched either by using an<br />

integer value stored at a specified offset in the<br />

template class, or the caller can specify a function<br />

that compares template class objects. The Function<br />

is packaged in TLinearOrder or a<br />

TIdentityRelation object. It provides<br />

specializations for arrays of signed and unsigned<br />

integers.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!