Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

skAList Class Reference

Array-Based List of pointers with template sub-classes. More...

#include <skAlist.h>

Inheritance diagram for skAList:

skTAList List of all members.

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

Detailed Description

Array-Based List of pointers with template sub-classes.


Constructor & Destructor Documentation

skAList::skAList ( USize initial_size,
USize growth_increment ) [inline]
 

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


Member Data Documentation

void ** skAList::m_Array [protected]
 

An array of pointers to the objects.

This can be null

USize skAList::m_GrowthIncrement [protected]
 

the amount to grow the list each time.

0 means "double in size"


The documentation for this class was generated from the following files:
Generated at Mon May 14 08:43:08 2001 for Simkin by doxygen1.2.1 written by Dimitri van Heesch, © 1997-2000