Tools.h++ Manual

21-168 104011 Tandem Computers Incorporated
21
RWSlistCollectables
RWSlistCollectables
||
RWSequenceable RWSlist
|
RWCollection
|
RWCollectable
Synopsis
// Smalltalk typedef:
typedef RWSlistCollectables LinkedList;
#include <rw/slistcol.h>
RWSlistCollectables a;
Description Class
RWSlistCollectables
represents a group of ordered elements,
without keyed access. Duplicates are allowed. The ordering of elements is
determined externally, by the order of insertion and removal. An object stored
by
RWSlistCollectables
must inherit abstract base class
RWCollectable
.
The virtual function
isEqual()
(see class
RWCollectable
) is required to find
a match between a target and an item in the collection
Class
RWSlistCollectables
is implemented as a singly-linked list, which
allows for efficient insertion and removal, but efficient movement in only one
direction. This class corresponds to the Smalltalk class
LinkedList
.
Public constructors
RWSlistCollectables();
Constructs an empty linked list.
RWSlistCollectables(const RWCollectable* a);
Constructs an ordered collection with single item
a
.
Public member operators
RWBoolean operator==(const
RWSlistCollectables& s) const;
Returns
TRUE
if self and
s
have the same number of members and if for every
item in self, the corresponding item at the same index in
s
isEqual to it.