StringList
class is privately derived from the
SequentialList
class, an extremely useful class used throughout Ptolemy. This class implements a linked list with a running count of the number of elements. It uses the
generic pointer technique, withStringList
, this generic pointer is converted to a specific type of pointer, like const char*
. The methods are summarized in table
SequentialList
has an iterator class called
ListIter
. The ++
operator (or next
member function) returns a Pointer
.
In table
3-11 are two classes privately derived from SequentialList
,
Queue
and
Stack
. The first of these can implement either a
first-in, first-out (FIFO) queue, or a
last-in, first-out (LIFO) queue. The second implements a stack, which is also a LIFO queue.