MeVisLabToolboxReference
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
 Returns the number of elements in this vector.
T * at (unsigned int pos) const
 Returns the element at the given position or NULL if out of range.
T * first ()
 Returns the first element.
const T * first () const
 Returns the first element.
virtual T * append (unsigned int *pos)
 Appends an element to this vector and returns a pointer to it.
virtual void deleteAt (unsigned int pos)
 Deletes an element at the given position.
virtual void destroy ()
 Deletes all elements in this 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 
)

Standard constructor.

Definition at line 74 of file WEMObjectVector.h.

References ML_CHECK_NEW, and T.

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

Standard destructor.

Definition at line 97 of file WEMObjectVector.h.


Member Function Documentation

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

Appends an element to this vector and returns a pointer to it.

Definition at line 148 of file WEMObjectVector.h.

References T.

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

Returns the element at the given position or NULL if out of range.

Definition at line 39 of file WEMObjectVector.h.

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

Deletes an element at the given position.

Definition at line 175 of file WEMObjectVector.h.

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

Deletes all elements in this vector.

Definition at line 105 of file WEMObjectVector.h.

References ML_DELETE_ARRAY.

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

Grow vector, add extra block of size BLOCKSIZE.

Definition at line 123 of file WEMObjectVector.h.

References ML_CHECK_NEW, ML_DELETE_ARRAY, and T.

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

Returns the 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]

Returns the first element.

Definition at line 41 of file WEMObjectVector.h.

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

Returns the number of elements in this vector.

Definition at line 37 of file WEMObjectVector.h.


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