ULAPI
8.0
|
A resizable array, with constant-time access by index. Slots in the vector are pointers of type T* rather than objects of type T, so unused slots take up only the memory required to store a pointer. More...
#include <ulcontainers.h>
Public Member Functions | |
ULVector () | |
ULVector (uluint32 newSize) | |
ULVector (const ULVector< T > &v) | |
~ULVector () | |
ULVector< T > & | operator= (const ULVector< T > &v) |
void | clear () |
T & | operator[] (uluint32 n) |
uluint32 | size () const |
void | resize (uluint32 newSize) |
void | append (const T &item) |
A resizable array, with constant-time access by index. Slots in the vector are pointers of type T* rather than objects of type T, so unused slots take up only the memory required to store a pointer.
TODO: this container needs extension if it is to be used more generally. It's a bare-bones vector at the moment.
Default constructor. This sets the vector size to zero.
Constructor.
[in] | newSize | The desired vector length. |
void ULVector< T >::append | ( | const T & | item | ) |
void ULVector< T >::clear | ( | ) |
Frees all memory associated with this vector, and sets the vector size to zero.
Assignment operator. This operator deletes this vector's existing nodes, builds a complete new copy of the specified vector, and sets up this vector to contain the new copy.
T & ULVector< T >::operator[] | ( | uluint32 | n | ) |
[in] | n | The index of the desired data. |
void ULVector< T >::resize | ( | uluint32 | newSize | ) |
Changes the size of this vector to the specified size, and moves the data in the old vector to the new one. If the new size is smaller than the old, the excess items in the old vector are deleted.
[in] | newSize | The desired vector size. |
uluint32 ULVector< T >::size | ( | ) | const |