Tools.h++ Class Reference

Table Of Contents
clear();
Removes all items from the collection.
RWBoolean
contains(const T& a) const;
Returns TRUE if the collection contains an item that is equal to a. A binary search is done.
Equality is measured by the class-defined equality operator.
const T*
data() const;
Returns a pointer to the raw data of the vector. The contents should not be changed. Should be
used with care.
size_t
entries() const;
Returns the number of items currently in the collection.
RWBoolean
find(const T& target, T& ret) const;
Performs a binary search and returns TRUE if the vector contains an object that is equal to the
object target and puts a copy of the matching object into ret. Returns FALSE otherwise and does
not touch ret. Equality is measured by the class-defined equality operator.
const T&
first() const;
Returns the first item in the collection. An exception of type RWBoundsError will occur if the
vector is empty.
size_t
index(const T& a) const;
Performs a binary search, returning the index of the first item that is equal to a. Returns
RW_NPOS if there is no such item. Equality is measured by the class-defined equality operator.
void
insert(const T& a);
Performs a binary search, inserting a after all items that compare less than or equal to it, but
before all items that do not. "Less Than" is measured by the class-defined '<' operator for type T.
The collection will be resized automatically if this causes the number of items to exceed the
capacity.
RWBoolean
isEmpty() const;
Returns TRUE if there are no items in the collection, FALSE otherwise.
const T&
last() const;
Returns the last item in the collection. If there are no items in the collection then an exception of
type RWBoundsError will occur.