Tools.h++ Class Reference

Table Of Contents
Click on the banner to return to the Class Reference home page.
©Copyright 1996 Rogue Wave Software
RWSet
RWSet RWHashTable RWCollection RWCollectable
Synopsis
Description
Persistence
Public Constructors
Public Member Operators
Public Member Functions
Synopsis
typedef RWSet Set; // Smalltalk typedef.
#include <rw/rwset.h>
RWSet h;
Description
Class RWSet represents a group of unordered elements, not accessible by an external key, where
duplicates are not allowed. It corresponds to the Smalltalk class Set.
An object stored by RWSet must inherit abstract base class RWCollectable, with suitable
definition for virtual functions hash() and isEqual() (see class RWCollectable). The function
hash() is used to find objects with the same hash value, then isEqual() is used to confirm the
match.
An item c is considered to be "already in the collection" if there is a member of the collection
with the same has value as c for which isEqual(c) returns TRUE. In this case, method insert(c)
will not add it, thus insuring that there are no duplicates.
The iterator for this class is RWSetIterator.