class skAList

Array-Based List of pointers with template sub-classes

Inheritance:

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
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 Fields

void** m_Array
An array of pointers to the objects
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

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 *)
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

Documentation

Array-Based List of pointers with template sub-classes
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
Parameters:
initial_size - - initial size to make the list
growth_increment - - growth increment for list

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

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 *)
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

void** m_Array
An array of pointers to the objects. This can be null

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. 0 means "double in size"


Direct child classes:
skTAList

alphabetic index hierarchy of classes


this page has been generated automatically by doc++

(c)opyright by Malte Zöckler, Roland Wunderling
contact: doc++@zib.de