name: SingleLinkedList<class TObject>: public :DstrBase;

synopsis:

g++ [flags ...] file ...

#include <SingleLinkedList.h>

SingleLinkedList(ALLOCATION alloc_d = DEF_ALLOCATION) ;
boolean insert(TObject* item, boolean insert_before);
boolean insertFirst(TObject* item);
boolean removeLast();
const TObject* getNext() const;
boolean apply(boolean (TObject::*method)());
quick start:

// declare a character list and add two characters into it
//
SingleLinkedList<Char> list;
Char item0(L'a');
Char item1(L'b');
list.insertFirst(&item0);
list.insert(&item1);

// get the last character
//
list.gotoLast();
Char* item2 = list.getCurr();
if (item2->ne(item1)) {
   // error
}
description:

The SingleLinkedList class, as its name suggests, is a list template class that supports list processing using a data structure that contains a pointer to the next element in the list. (A doubly linked list, by constrast, contains a pointer to the previous node as well as the next list). For a good reference on lists, see: The user may select the memory management mode in which this class operates: USER or SYSTEM. In SYSTEM mode, the class is responsible for managing the memory for the objects it contains. This implies that a copy is made each time an object is inserted to the list. In USER mode the user is responsible for allocation and deletion of the objects that are stored in the list. In this mode, pointers to the external objects are stored - a copy is not made. The best mode for your application depends on your need to trade-off speed versus the complexity of object management.

dependencies:

public constants:

error codes:

protected data:

required public methods:

class-specific public methods:

private methods:


friend classes:

examples:

notes: