ml::WEMObjectVector< T > Class Template Reference

Dynamic templated vector. More...

#include <WEMObjectVector.h>

List of all members.

Public Member Functions

 WEMObjectVector (unsigned int init=0, unsigned int bs=8192)
 Standard constructor.
virtual ~WEMObjectVector ()
 Standard destructor.
unsigned int num () const
 Return number of elements in the vector.
T * at (unsigned int pos) const
 Return element at given position, return NULL when out of range.
T * first ()
 Return first element.
const T * first () const
 Return first element.
virtual T * append (unsigned int *pos)
 Append element to back of vector.
virtual void deleteAt (unsigned int pos)
 Delete element at given position.
virtual void destroy ()
 Delete all elements in the vector.

Protected Member Functions

virtual void expand ()
 Grow vector, add extra block of size BLOCKSIZE.


Detailed Description

template<class T>
class ml::WEMObjectVector< T >

Dynamic templated vector.

For speed and better memory handling, the vector is an array within an array. The base blocks have a BLOCKSIZE of 8192. This allows for quick expanding.

Definition at line 28 of file WEMObjectVector.h.


Constructor & Destructor Documentation

template<class T >
ml::WEMObjectVector< T >::WEMObjectVector ( unsigned int  init = 0,
unsigned int  bs = 8192 
) [inline]

Standard constructor.

Definition at line 74 of file WEMObjectVector.h.

References ML_CHECK_NEW, ML_TRACE_IN_TIME_CRITICAL, and T.

template<class T >
ml::WEMObjectVector< T >::~WEMObjectVector (  )  [inline, virtual]

Standard destructor.

Definition at line 97 of file WEMObjectVector.h.

References ml::WEMObjectVector< T >::destroy(), and ML_TRACE_IN_TIME_CRITICAL.


Member Function Documentation

template<class T >
T * ml::WEMObjectVector< T >::append ( unsigned int *  pos  )  [inline, virtual]

Append element to back of vector.

Definition at line 148 of file WEMObjectVector.h.

References ml::WEMObjectVector< T >::expand(), ML_TRACE_IN_TIME_CRITICAL, and T.

template<class T>
T* ml::WEMObjectVector< T >::at ( unsigned int  pos  )  const [inline]

Return element at given position, return NULL when out of range.

Definition at line 39 of file WEMObjectVector.h.

template<class T >
void ml::WEMObjectVector< T >::deleteAt ( unsigned int  pos  )  [inline, virtual]

Delete element at given position.

Definition at line 173 of file WEMObjectVector.h.

References ML_TRACE_IN_TIME_CRITICAL.

template<class T >
void ml::WEMObjectVector< T >::destroy (  )  [inline, virtual]

Delete all elements in the vector.

Definition at line 107 of file WEMObjectVector.h.

References ML_DELETE_ARRAY, and ML_TRACE_IN_TIME_CRITICAL.

Referenced by ml::WEMObjectVector< T >::~WEMObjectVector().

template<class T >
void ml::WEMObjectVector< T >::expand (  )  [inline, protected, virtual]

Grow vector, add extra block of size BLOCKSIZE.

Definition at line 125 of file WEMObjectVector.h.

References ML_CHECK_NEW, ML_DELETE_ARRAY, ML_TRACE_IN_TIME_CRITICAL, and T.

Referenced by ml::WEMObjectVector< T >::append().

template<class T>
const T* ml::WEMObjectVector< T >::first (  )  const [inline]

Return first element.

Definition at line 43 of file WEMObjectVector.h.

Referenced by ml::WEMObjectVector< WEMQuad >::first().

template<class T>
T* ml::WEMObjectVector< T >::first (  )  [inline]

Return first element.

Definition at line 41 of file WEMObjectVector.h.

template<class T>
unsigned int ml::WEMObjectVector< T >::num (  )  const [inline]

Return number of elements in the vector.

Definition at line 37 of file WEMObjectVector.h.


The documentation for this class was generated from the following file:

Generated on Sat Sep 3 18:39:41 2011 for MeVisLab Toolbox Reference by  doxygen 1.5.8