StValueList< T > Class Template Reference

StValueList allows you to keep variable table of any type. More...

#include <stvaluelist.h>

List of all members.

Public Member Functions

 StValueList ()
 ~StValueList ()
void push_back (const T &item)
void pop_back ()
void push_front (const T &item)
void pop_front ()
void addUnique (const T &item)
void addUnique (const StValueList< T > &list)
int find (const T &item) const
int contains (const T &item) const
int remove (const T &item)
void remove (unsigned index)
void clear ()
T & at (unsigned index) const
unsigned size () const
bool empty () const
StValueListoperator<< (const T &item)
StValueListoperator<< (const StValueList< T > &list)
T & operator[] (unsigned index)
const T & operator[] (unsigned index) const

Protected Member Functions

void elementCreate (const T &data, void *placeToCopy)
void elementDestroy (void *memoryPointer)
void copy (void *mem, unsigned itemCount)
void copy (const StValueList< T > &copy)
void copy ()

Protected Attributes

StSharedMemory memory
unsigned itemCount

Private Member Functions

void init ()

Friends

class StStringList

Classes

struct  Element


Detailed Description

template<class T>
class StValueList< T >

StValueList allows you to keep variable table of any type.

It works very similiarly to the vector class from STD library but doesn't have iterators yet. If you want to create StValueList<StString>, the better way is to use the StStringList class, which allows you to load and save lines of your strings into files.


Constructor & Destructor Documentation

template<class T>
StValueList< T >::StValueList (  )  [inline]

template<class T>
StValueList< T >::~StValueList (  )  [inline]


Member Function Documentation

template<class T>
void StValueList< T >::addUnique ( const StValueList< T > &  list  )  [inline]

Adds only these list items that are new to this list

template<class T>
void StValueList< T >::addUnique ( const T &  item  )  [inline]

Adds item only if new in list

template<class T>
T & StValueList< T >::at ( unsigned  index  )  const [inline]

Returns:
item that is hold on index

template<class T>
void StValueList< T >::clear (  )  [inline]

Clear whole list

Reimplemented in StScript.

template<class T>
int StValueList< T >::contains ( const T &  item  )  const [inline]

Returns:
number of occurances of item

template<class T>
void StValueList< T >::copy (  )  [protected]

template<class T>
void StValueList< T >::copy ( const StValueList< T > &  copy  )  [protected]

template<class T>
void StValueList< T >::copy ( void *  mem,
unsigned  itemCount 
) [protected]

template<class T>
void StValueList< T >::elementCreate ( const T &  data,
void *  placeToCopy 
) [inline, protected]

template<class T>
void StValueList< T >::elementDestroy ( void *  memoryPointer  )  [inline, protected]

template<class T>
bool StValueList< T >::empty (  )  const [inline]

Returns:
true if there is no items in list

template<class T>
int StValueList< T >::find ( const T &  item  )  const [inline]

Returns:
index of first occurance of item

template<class T>
void StValueList< T >::init (  )  [inline, private]

Reimplemented in StStringList.

template<class T>
StValueList< T > & StValueList< T >::operator<< ( const StValueList< T > &  list  )  [inline]

template<class T>
StValueList& StValueList< T >::operator<< ( const T &  item  )  [inline]

template<class T>
const T& StValueList< T >::operator[] ( unsigned  index  )  const [inline]

template<class T>
T& StValueList< T >::operator[] ( unsigned  index  )  [inline]

template<class T>
void StValueList< T >::pop_back (  )  [inline]

Delete first item

template<class T>
void StValueList< T >::pop_front (  )  [inline]

Delete last item

template<class T>
void StValueList< T >::push_back ( const T &  item  )  [inline]

Insert copy of item at the end of list

template<class T>
void StValueList< T >::push_front ( const T &  item  )  [inline]

Insert copy of item at the begining of list

template<class T>
void StValueList< T >::remove ( unsigned  index  )  [inline]

Remove item on index

template<class T>
int StValueList< T >::remove ( const T &  item  )  [inline]

Delete all items that are equal to item

Returns:
num of deleted items

template<class T>
unsigned StValueList< T >::size (  )  const [inline]

Returns:
number of list items


Friends And Related Function Documentation

template<class T>
friend class StStringList [friend]


Member Data Documentation

template<class T>
unsigned StValueList< T >::itemCount [protected]

template<class T>
StSharedMemory StValueList< T >::memory [protected]


The documentation for this class was generated from the following file:
Generated on Tue Nov 14 21:15:10 2006 for Smart Tools Library by  doxygen 1.4.7