Tools.h++ Class Reference

Table Of Contents
binaryStoreSize() const;
Returns the number of bytes used by the virtual function saveGuts(RWFile&) to store an
object. Typically, this involves adding up the space required to store all primitives, plus
the results of calling recursiveStoreSize() for all objects inheriting from RWCollectable.
See the Tool.h++ User's Guide Section entitled "Virtual Function binaryStoreSize" for
details.
virtual int
compareTo(const RWCollectable*) const;
The function compareTo() is necessary to sort the items in a collection. If p1 and p2 are
pointers to RWCollectable objects, the statement
p1->compareTo(p2);
should return:
0 if *p1 "is equal to" *p2;
>0 if *p1 is "larger" than *p2;
<0 if *p1 is "smaller" than *p2.
Note that the meaning of "is equal to," "larger" and "smaller" is left to the user. The
default definition provided by the base class is based on the addresses, i.e.,
return this == p2 ? 0 : (this > p2 ? 1 : -1);
and is probably not very useful.
virtual unsigned
hash() const;
Returns a hash value. This function is necessary for collection classes that use hash table
look-up. The default definition provided by the base class hashes the object's address:
return (unsigned)this;
It is important that the hash value be the same for all objects which return TRUE to
isEqual().
virtual RWClassID
isA() const;
Returns a class identification number (typedef'd to be an unsigned short). The default
definition returns __RWCOLLECTABLE. Identification numbers greater than or equal to
0x8000 (hex) are reserved for Rogue Wave objects. User defined classes should define
isA() to return a number between 0 and 0x7FFF.
virtual RWBoolean
isEqual(const RWCollectable* t) const;