Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Essential Tools Module Reference Guide

RWCollection

Module:  Essential Tools Module   Group:  RWCollectable


RWCollectionRWCollectable

Local Index

Members

Synopsis

#include <rw/colclass.h>
typedef RWCollection Collection;   // Smalltalk typedef

Description

Class RWCollection is an abstract base class for the Smalltalk-like collection classes. The class contains virtual functions for inserting and retrieving pointers to RWCollectable objects into the collection classes. Virtual functions are also provided for storing and reading the collections to files and streams. Collections that inherit this base class will typically redefine one or more of these functions.

In the documentation below, pure virtual functions are indicated by "= 0" in their declaration. These functions must be defined in derived classes. For these functions the description is intended to be generic -- all inheriting collection classes generally follow the described pattern. Exceptions are noted in the documentation for the particular class.

For many other functions, a suitable definition is provided by RWCollection and a deriving class may not need to redefine the function. Examples are contains() or restoreGuts().

Persistence

Polymorphic

Destructor

virtual
~RWCollection();

Public Member Operators

void
operator+=(const RWCollection&);
void
operator-=(const RWCollection&);

Public Member Functions

virtual void
apply(RWapplyCollectable ap, void*) = 0;
RWBag
asBag() const;
RWSet
asSet() const;
RWOrdered
asOrderedCollection() const;
RWBinaryTree
asSortedCollection() const;
virtual RWspace
binaryStoreSize() const;
virtual void
clear() = 0;
virtual void
clearAndDestroy();
virtual int
compareTo(const RWCollectable* a) const;
virtual RWBoolean
contains(const RWCollectable* target) const;
virtual size_t
entries() const = 0;
virtual RWCollectable*
find(const RWCollectable* target) const = 0;
virtual unsigned
hash() const;
virtual RWCollectable*
insert(RWCollectable* e) = 0;
virtual RWClassID
isA() const;
virtual RWBoolean
isEmpty() const = 0;
virtual RWBoolean
isEqual(const RWCollectable* a) const;
virtual size_t
occurrencesOf(const RWCollectable* t) const = 0;
virtual void
restoreGuts(RWFile&);
virtual void
restoreGuts(RWvistream&);
RWCollectable*
remove(const RWCollectable* target) = 0;
virtual void
removeAndDestroy(const RWCollectable* target);
RWCollection*
select(RWtestCollectable tst, void* x) const;
virtual void
saveGuts(RWFile&);
virtual void
saveGuts(RWvostream&);


Previous fileTop of DocumentContentsIndex pageNext file

©2004 Copyright Quovadx, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Quovadx, 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.