Tools.h++ Manual
104011 Tandem Computers Incorporated 22-49
22
T*& at(size_t i);
T* at(size_t i) const;
Returns a pointer to the 
i
'th value in the vector. The first variant can be used 
as an l-value, the second cannot. The index 
i 
must be between zero and the 
number of items in the collection less one, or an exception of type 
TOOL_INDEX
will be thrown.
void clear();
Removes all items from the collection.
void clearAndDestroy();
Removes all items from the collection and calls their destructors.
RWBoolean contains(T* a) const;
Returns 
TRUE 
if the collection contains an item that is equal to the object 
pointed to by 
a
, 
FALSE 
otherwise. A linear search is done. Equality is 
measured by the class-defined equality operator for type T.
T* const * 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.
T* find(T* a) const;
Returns a pointer to the first object encountered which is equal to the object 
pointed to by 
a
, or nil if no such object can be found. Equality is measured by 
the class-defined equality operator for type 
T
.
T* first() const;
Returns a pointer to the first item in the vector. An exception of type 
TOOL_INDEX 
will occur if the vector is empty.
size_t index(T* a) const;
Performs a linear search, returning the index of the first object that is equal to 
the object pointed to by 
a
, or 
RW_NPOS 
if there is no such object. Equality is 
measured by the class-defined equality operator for type 
T
.
void insert(T* a);
Adds the object pointed to by 
a 
to the end of the vector. The collection will be 
resized automatically if this causes the number of items to exceed the capacity.










