Tools.h++ Class Reference

Table Of Contents
Persistence
Polymorphic
Public Member Operators
void
operator+=(const RWCollection&);
void
operator-=(const RWCollection&);
Adds or removes, respectively, each item in the argument to or from self. Using
operator+=(somePreSortedCollection) on an RWBinaryTree can cause that tree to
become unbalanced; possibly to the point of stack overflow.
Public Member Functions
virtual
~RWCollection();
Null definition (does nothing).
virtual void
apply(RWapplyCollectable ap, void*) = 0;
This function applies the user-supplied function pointed to by ap to each member of the
collection. This function should have prototype
void yourApplyFunction(RWCollectable* ctp, void*);
The function yourApplyFunction() can perform any operation on the item at address ctp
that does not change the hash value or sorting order of the item. Client data may be
passed to this function through the second argument.
RWBag
asBag() const;
RWSet
asSet() const;
RWOrdered
asOrderedCollection() const;
RWBinaryTree
asSortedCollection() const;
Allows any collection to be converted to an RWBag, RWSet, RWOrdered, or an
RWBinaryTree. Note that the return value is a copy of the data. This can be very
expensive for large collections. You should consider using operator+=() to insert each
item from this collection into a collection of your choice. Also note that converting a
collection containing data which is already sorted to a RWBinaryTree via the