Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Essential Tools Module Reference Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

RWSet

Module:  Essential Tools Module   Group:  RWCollectable Classes


RWSetRWHashTableRWCollectionRWCollectable

Local Index

Members

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 std::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.

Persistence

Polymorphic

Public Constructors

RWSet (size_t n = RW_DEFAULT_CAPACITY);
RWSet (const RWSet & h);
virtual ~RWSet();

Public Member Operators

void
operator=(const RWSet& h);
bool
operator==(const RWSet& h);
bool
operator!=(const RWSet& h);
bool
operator<=(const RWSet& h);
bool
operator<(const RWSet& h);
RWSet&
operator*=(const RWSet& h);

Public Member Functions

virtual void
apply(RWapplyCollectable ap, void*);
virtual RWspace
binaryStoreSize() const;
virtual void
clear();
virtual void
clearAndDestroy();
virtual int
compareTo(const RWCollectable* a) const;
virtual bool
contains(const RWCollectable* target) const;
virtual size_t
entries() const;
virtual RWCollectable*
find(const RWCollectable* target) const;
virtual unsigned
hash() const;
virtual RWCollectable*
insert(RWCollectable* c);
virtual RWClassID
isA() const;
virtual bool
isEmpty() const;
virtual bool
isEqual(const RWCollectable* a) const;
void
intersectWith(const RWSet& h, RWSet& ret) const;
virtual RWConstIterator*
newConstIterator();
virtual RWIterator*
newIterator();
virtual size_t
occurrencesOf(const RWCollectable* target) const;
virtual RWCollectable*
remove(const RWCollectable* target);
virtual void
removeAndDestroy(const RWCollectable* target);
void
resize(size_t n = 0);
virtual void
restoreGuts(RWvistream&);
virtual void
restoreGuts(RWFile&);
virtual void
saveGuts(RWvostream&) const;
virtual void
saveGuts(RWFile&) const;
RWStringID
stringID();


Previous fileTop of DocumentContentsIndex pageNext file

© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.