Tools.h++ Manual
22-126 104011 Tandem Computers Incorporated
22
void operator=(const
RWTVirtualSlice<T>& sl);
Sets self equal to a slice of another vector. The resultant vector will use the
same heap as the vector whose slice is being taken. Its length will be given by
the length of the slice. The copy will be made immediately.
T operator=(const T& val);
Sets all elements in self equal to
val
. This operator is actually quite efficient
because it can work with many elements on a single page at once.
T operator[](long i) const;
Returns a copy of the value at index
i
. The index
i
must be between zero and
the length of the vector less one or an exception of type
TOOL_LONGINDEX
will
occur.
RWTVirtualElement<T> operator[](long);
Returns a reference to the value at index
i
. The results can be used as an
lvalue. The index
i
must be between zero and the length of the vector less one
or an exception of type
TOOL_LONGINDEX
will occur.
Public member functions
long length() const;
Returns the length of the vector.
T val(long i) const;
Returns a copy of the value at index
i
. The index i must be between zero and
the length of the vector less one or an exception of type
TOOL_LONGINDEX
will
occur.
void set(long i, (const T& v);
Sets the value at the index
i
to
v
. The index
i
must be between zero and the
length of the vector less one or an exception of type
TOOL_LONGINDEX
will
occur.
RWTVirtualSlice<T> slice(long start, long length);
Returns a reference to a slice of self. The value
start
is the starting index of
the slice, the value length its extent. The results can be used as an lvalue.
void reshape(long newLength);
Change the length of the vector to
newLength
. If this results in the vector
being lengthened then the value of the new elements is undefined.
RWVirtualPageHeap* heap() const;
Returns a pointer to the heap from which the vector is getting its pages.