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

skTVAList< T > Class Template Reference

This class gives a value and array-based list. More...

#include <skValist.h>

List of all members.

Public Member Functions

 skTVAList ()
 Default Constructor - creates an empty list.

 skTVAList (const skTVAList< T > &)
 Copy Constructor - copies the contents of the other list into this one.

virtual ~skTVAList ()
 Destructor.

skTVAList & operator= (const skTVAList< T > &)
 Assignment operator - copies the contents of the other list.

void moveFrom (skTVAList< T > &)
 Moves the contents of another list into this one.

void clear ()
 Clears this list.

USize entries () const
 Returns the number of entries in the list.

void deleteElt (USize n)
 deletes the nth item in the list

void prepend (const T &t)
 Adds the given item to the start of the list.

void insert (const T &t, USize index)
 Inserts the given item *before* the specified index.

void append (const T &t)
 adds the given item to the list

void remove (const T &t)
 removes the given item from the list

T & operator[] (USize n) const
 retrieves the nth item from the list

int index (const T &t) const
 returns the index of the item within the list.

bool contains (const T &t) const
 checks if the given item is in the list

void growTo (USize new_size)
 instructs the list to grow to the given size (which must be greater than the current size).

USize getArraySize () const
 returns the capacity of the current list - i.e.


Protected Member Functions

int findElt (const T &t) const
 returns the index of the given item in the list, or -1 if not found

void grow ()
 grows the array that represents the list by the growth increment

void createArray ()
 Create the underlying array.


Protected Attributes

T * m_Array
 the array used to represent the list

USize m_ArraySize
 the size of the array

USize m_Entries
 the number of items being used in the list


Detailed Description

template<class T>
class skTVAList< T >

This class gives a value and array-based list.


Constructor & Destructor Documentation

template<class T>
skTVAList< T >::skTVAList const skTVAList< T > &   )  [inline]
 

Copy Constructor - copies the contents of the other list into this one.

Remarks:
not available in Symbian version


Member Function Documentation

template<class T>
void skTVAList< T >::append const T &  t  )  [inline]
 

adds the given item to the list

Exceptions:
a Symbian - a leaving function

template<class T>
bool skTVAList< T >::contains const T &  t  )  const [inline]
 

checks if the given item is in the list

Returns:
true if the list contains the item, otherwise false

template<class T>
void skTVAList< T >::createArray  )  [inline, protected]
 

Create the underlying array.

Exceptions:
a Symbian - a leaving function

template<class T>
void skTVAList< T >::deleteElt USize  n  ) 
 

deletes the nth item in the list

Exceptions:
skBoundsException is thrown if the index is invalid

template<class T>
USize skTVAList< T >::getArraySize  )  const [inline]
 

returns the capacity of the current list - i.e.

the number of items that can be stored in the underlying array

template<class T>
void skTVAList< T >::grow  )  [protected]
 

grows the array that represents the list by the growth increment

Exceptions:
a Symbian - a leaving function

template<class T>
void skTVAList< T >::growTo USize  new_size  ) 
 

instructs the list to grow to the given size (which must be greater than the current size).

The existing items are copied across

Exceptions:
a Symbian - a leaving function

template<class T>
int skTVAList< T >::index const T &  t  )  const [inline]
 

returns the index of the item within the list.

Returns:
the index, or -1 if not found

template<class T>
void skTVAList< T >::insert const T &  t,
USize  index
 

Inserts the given item *before* the specified index.

Exceptions:
skBoundsException is thrown if the index is invalid
a Symbian - a leaving function

template<class T>
void skTVAList< T >::moveFrom skTVAList< T > &   ) 
 

Moves the contents of another list into this one.

The other list will now be empty.

template<class T>
skTVAList< T > & skTVAList< T >::operator= const skTVAList< T > &   ) 
 

Assignment operator - copies the contents of the other list.

Exceptions:
a Symbian - a leaving function

template<class T>
T & skTVAList< T >::operator[] USize  n  )  const [inline]
 

retrieves the nth item from the list

Exceptions:
skBoundsException is thrown if the index is invalid
Returns:
a reference to the item

template<class T>
void skTVAList< T >::prepend const T &  t  ) 
 

Adds the given item to the start of the list.

Exceptions:
a Symbian - a leaving function


The documentation for this class was generated from the following file:
Generated on Fri Dec 17 20:27:36 2004 for Simkin by doxygen1.3