#include <skAlist.h>
Inheritance diagram for skAList:
Public Methods | |
skAList () | |
default constructor - makes initial size zero, with growth increment of 4. | |
skAList (USize initial_size,USize growth_increment) | |
This constructor sets the initial size and growth increment for the list. More... | |
virtual | ~skAList () |
does NOT destroy items, this is done in the derived class. | |
void | clearAndDestroy () |
deletes all items in the list, calling deleteItem on each one. | |
void | clear () |
removes all items from the list, without deleting. | |
USize | entries () const |
returns the number of items in the list. | |
void | deleteElt (USize n) |
removes and deletes the nth item in the list, deleteItem is called to delete the item. | |
void | test () const |
performs some checks on the list. | |
void | growTo (USize size) |
instructs the list to grow to the given size (which must be greater than the current size), the current contents are copied across. | |
Protected Methods | |
void | insert (void *,USize index) |
insert *before* the given position. | |
void | prepend (void *) |
put at the start of the list. | |
void | append (void *) |
put at the end of the list. | |
void | remove (void *) |
remove an item, but *not* delete it. | |
void | removeAndDestroy (void *) |
remove an item and delete it. | |
void* | operator[] (USize n) const |
retrieves the nth item within the list, a BoundsException is thrown if the index is out of range. | |
int | index (const void *) const |
returns the index of the given object, or -1 if not found. | |
bool | contains (const void *) const |
returns true if the given object is in the list. | |
virtual void | deleteItem (void *) = 0 |
this method is overriden in the derived classes so that the correct destructor is called. | |
int | findElt (const void * i) const |
searches for an element, returns -1 if not found. | |
void | grow () |
grows the array to the next size. | |
Protected Attributes | |
void** | m_Array |
An array of pointers to the objects. More... | |
USize | m_ArraySize |
this gives the actual size of the array of pointers. | |
USize | m_Entries |
this gives the number of slots which are currently being used. | |
USize | m_GrowthIncrement |
the amount to grow the list each time. More... | |
Friends | |
class | skAListIterator |
|
This constructor sets the initial size and growth increment for the list.
|
|
An array of pointers to the objects. This can be null |
|
the amount to grow the list each time. 0 means "double in size" |