Tools.h++ Manual

23-16 104011 Tandem Computers Incorporated
23
RWGQueue(type)
RWGQueue(type)
|
RWSlist
Synopsis
#include <rw/gqueue.h>
declare(RWGQueue,
type
)
RWGQueue
(type)
a;
Description Class
RWGQueue
(type) represents a group of ordered elements, not accessible
by an external key. A
RWGQueue
(type) is a first in, first out (FIFO) sequential list
for which insertions are made at one end (the "tail"), but all removals are made
at the other (the "head"). Hence, the ordering is determined externally by the
ordering of the insertions. Duplicates are allowed. This class is implemented as
a singly-linked list. Objects of type
RWGQueue
(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
RWGQueue(
type
)();
Construct an empty queue.
RWGQueue(
type
)(
type
* a);
Construct a queue with one entry
a
.
RWGQueue(
type
)(const RWGQueue(
type
)& q);
Copy constructor. A shallow copy of
q
is made.