|
Public Member Functions |
| WvVector (bool _auto_free) |
| Creates an empty vector.
|
| ~WvVector () |
| Destroys the vector and all of its contents.
|
T * | operator[] (int slot) |
| Dereferences a particular slot of the vector.
|
void | zap () |
| Removes all elements from the vector.
|
void | remove (int slot, bool never_delete=false) |
void | remove_last () |
| Removes the last element.
|
T * | last () |
void | insert (int slot, T *elem) |
void | append (T *elem) |
T ** | ptr () |
int | count () const |
| Returns the number of elements actually stored in the vector.
|
bool | isempty () const |
| Returns true if the vector is empty.
|
int | capacity () const |
| The number of elements that could be stored without resizing.
|
void | setcapacity (int newslots) |
| Adjusts the capacity of the vector.
|
void | compact () |
| Compacts the vector to minimize its footprint.
|
Protected Member Functions |
int | growcapacity (int minslots) |
| Computes the number of slots needed to grow to at least minslots.
|
int | shrinkcapacity (int maxslots) |
| Computes the number of slots needed to shrink down to maxslots.
|
void | moveelems (void *dst, void *src, int nelems) |
| A shorthand for memmove() with size adjustment.
|
void | remove (int slot) |
| Removes the element at the specified slot.
|
void | insert (int slot, void *elem) |
| Inserts an element at the specified slot.
|
void | append (void *elem) |
| Appends an element onto the tail of the vector.
|
Protected Attributes |
void ** | xseq |
int | xcount |
int | xslots |
bool | auto_free |
Static Protected Attributes |
static const int | MINALLOC = 4 |
Classes |
class | Iter |
| A simple iterator that walks through all elements in the list. More...
|