Manipulates a singly-linked list: an ordered, non-indexed list of elements, that can be traversed only from start to end.
The API contains all the necessary functionality for singly-linked lists. It is possible to derive from its classes to add additional features.
The API has three key concepts: list header (TSglQue), link class (TSglQueLink), and iterator class (TSglQueIter).
Note the following properties of singly-linked lists:
elements can be accessed through iterating through the list, and added to the start and end of a list, but not to the middle
elements in a linked list need not be objects of the same type but ought to be derived from the same base class
The list header supplies the behaviour for managing a singly-linked list of objects.
The list header interface is provided by
TSglQue
<class T>
. The T
template parameter specifies the type of objects in the list.
To be a member of a singly-linked list, an object must contain an instance of the link class as a data member.
The link class interface is provided by
TSglQueLink
.
The iterator class supplies the behaviour for moving through the elements of a list.
The iterator class interface is provided by
TSglQueIter
.