Tools.h++ Manual

104011 Tandem Computers Incorporated 23-19
23
RWGSlist(type)
RWGSlist(type)
|
RWSlist
Synopsis
#include <rw/gslist.h>
declare(RWGSlist,
type
)
RWGSlist
(type)
a;
Description Class
RWGSlist
(type) represents a group of ordered elements of type type, not
accessible by an external key. Duplicates are allowed. This class is
implemented as a singly-linked list. Objects of type
RWGSlist
(type) are
declared with macros defined in the standard C++ header file <generic.h>.
In order to find a particular item within the collection, a user-provided global
"tester" function is required to test for a "match", definable in any consistent
way. This function should have prototype:
RWBoolean
yourTesterFunction
(const
type
* c, const void* d);
The argument
c
is a candidate within the collection to be tested for a match.
The argument
d
is for your convenience and will be passed to
yourTesterFunction(). The function should return
TRUE
if a "match" is found
between
c
and
d
.
In order to simplify the documentation below, an imaginary typedef
typedef RWBoolean (*
yourTester
)(const
type
*, const void*);
has been used for this tester function.
Public constructors
RWGSlist(
type
)();
Construct an empty collection.
RWGSlist(
type
)(
type
* a);
Construct a collection with one entry
a
.
RWGSlist(
type
)(const RWGSlist(
type
)& a);
Copy constructor. A shallow copy of
a
is made.
Assignment operator
void operator=(const RWGSlist(
type
)&);
Assignment operator. A shallow copy of
a
is made.