#include <list.h>
Inheritance diagram for List::

Public Methods | |
| List () | |
| initialize the list. More... | |
| virtual | ~List () |
| de-allocate the list. More... | |
| virtual void | Prepend (T item) |
| Put item at the beginning of the list. More... | |
| virtual void | Append (T item) |
| Put item at the end of the list. More... | |
| T | Front () |
| Return first item on list without removing it. More... | |
| T | RemoveFront () |
| Take item off the front of the list. More... | |
| void | Remove (T item) |
| Remove specific item from list. More... | |
| bool | IsInList (T item) const |
| is the item in the list? More... | |
| unsigned int | NumInList () |
| bool | IsEmpty () |
| void | Apply (void(*f)(T)) const |
| apply function to all elements in list. More... | |
| virtual void | SanityCheck () const |
| has this list been corrupted? More... | |
| void | SelfTest (T *p, int numEntries) |
| verify module is working. More... | |
Protected Attributes | |
| ListElement<T>* | first |
| Head of the list, NULL if list is empty. More... | |
| ListElement<T>* | last |
| Last element of list. More... | |
| int | numInList |
| number of elements in list. More... | |
| friend | ListIterator<T> |
Definition at line 42 of file list.h.
|
||||
|
initialize the list. List<T>::List Initialize a list, empty to start with. Elements can now be added to the list. |
|
||||
|
de-allocate the list. List<T>~List Prepare a list for deallocation. |
|
||||
|
Put item at the end of the list. List<T>::Append Append an "item" to the end of the list. Allocate a ListElement to keep track of the item. If the list is empty, then this will be the only element. Otherwise, put it at the end. "item" is the thing to put on the list. Reimplemented in SortedList. Definition at line 73 of file list.cc. Referenced by SynchList::Append(), ElevatorInfo::Enter(), HashTable::Insert(), Semaphore::P(), ElevatorBank::PostEvent(), HashTable::ReHash(), Scheduler::ReadyToRun(), SelfTest(), and Condition::Wait().
|
|
||||
|
apply function to all elements in list. List<T>::Apply Apply function to every item on a list. "func" -- the function to apply |
|
||||
|
Return first item on list without removing it.
|
|
||||
|
Definition at line 60 of file list.h. Referenced by Interrupt::AnyFutureInterrupts(), Append(), Condition::Broadcast(), ElevatorBank::CallBack(), HashTable::FindNextFullBucket(), Scheduler::FindNextToRun(), SortedList::Insert(), Prepend(), HashTable::ReHash(), SynchList::RemoveFront(), RemoveFront(), SynchList::SelfTest(), SortedList::SelfTest(), SelfTest(), Condition::Signal(), Semaphore::V(), ElevatorBank::getNextEvent(), and ~List().
|
|
||||
|
is the item in the list? List<T>::IsInList Return TRUE if the item is in the list. Definition at line 185 of file list.cc. Referenced by Append(), SortedList::Insert(), Prepend(), ElevatorBank::PressFloor(), Remove(), SortedList::SelfTest(), and SelfTest().
|
|
||||
|
Definition at line 58 of file list.h. Referenced by ElevatorInfo::Enter(), and HashTable::SanityCheck().
|
|
||||
|
Put item at the beginning of the list. List<T>::Prepend Same as Append, only put "item" on the front. Reimplemented in SortedList. |
|
||||
|
Remove specific item from list. List<T>::Remove Remove a specific item from the list. Must be in the list! Definition at line 149 of file list.cc. Referenced by ElevatorInfo::Exit(), HashTable::Remove(), and SelfTest().
|
|
||||
|
Take item off the front of the list. List<T>::RemoveFront Remove the first "item" from the front of the list. List must not be empty. Returns: The removed item. Definition at line 123 of file list.cc. Referenced by Scheduler::FindNextToRun(), HashTable::ReHash(), Remove(), SynchList::RemoveFront(), SortedList::SelfTest(), Condition::Signal(), Semaphore::V(), and ElevatorBank::getNextEvent().
|
|
||||
|
has this list been corrupted? List::SanityCheck Test whether this is still a legal list. Tests: do I get to last starting from first? does the list have the right # of elements? Reimplemented in SortedList. Definition at line 270 of file list.cc. Referenced by SortedList::SanityCheck(), HashTable::SanityCheck(), and SelfTest().
|
|
||||||
|
verify module is working. List::SelfTest Test whether this module is working. Reimplemented in SortedList. Definition at line 296 of file list.cc. Referenced by LibSelfTest(), and SortedList::SelfTest().
|
|
|||
|
|
|
|||
|
Head of the list, NULL if list is empty.
|
|
|||
|
Last element of list.
|
|
|||
|
number of elements in list.
|
1.2.8.1 written by Dimitri van Heesch,
© 1997-2001