MeVisLab Toolbox Reference
Loading...
Searching...
No Matches
ml::WEMObjectVector< T > Class Template Reference

Dynamic template vector. More...

#include <WEMObjectVector.h>

Public Member Functions

 WEMObjectVector (unsigned int init=0, unsigned int bs=8192)
 Standard constructor.
 
 ~WEMObjectVector ()
 Standard destructor.
 
 WEMObjectVector (WEMObjectVector &&other) noexcept
 Move c'tor.
 
WEMObjectVector & operator= (WEMObjectVector &&other) noexcept
 Move assignment operator.
 
unsigned int num () const
 Returns the number of elements in this vector.
 
T * append (unsigned int *pos)
 Appends an element to this vector and returns a pointer to it.
 
void deleteAt (unsigned int pos)
 Deletes an element at the given position.
 
void destroy ()
 Deletes all elements in this vector.
 
void createNumObjects (unsigned int numObjects)
 Creates the given number of objects.
 
T * at (unsigned int pos) const
 Returns the element at the given position.
 

Detailed Description

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

Dynamic template 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 27 of file WEMObjectVector.h.

Constructor & Destructor Documentation

◆ WEMObjectVector() [1/2]

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

Standard constructor.

Definition at line 82 of file WEMObjectVector.h.

References mlrange_cast(), and T.

◆ ~WEMObjectVector()

Standard destructor.

Definition at line 99 of file WEMObjectVector.h.

◆ WEMObjectVector() [2/2]

template<class T >
ml::WEMObjectVector< T >::WEMObjectVector ( WEMObjectVector< T > && other)
noexcept

Move c'tor.

Definition at line 104 of file WEMObjectVector.h.

References mlrange_cast().

Member Function Documentation

◆ append()

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

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

Definition at line 150 of file WEMObjectVector.h.

References mlrange_cast(), and T.

◆ at()

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

Returns the element at the given position.

Definition at line 200 of file WEMObjectVector.h.

◆ createNumObjects()

template<class T >
void ml::WEMObjectVector< T >::createNumObjects ( unsigned int numObjects)

Creates the given number of objects.

Definition at line 189 of file WEMObjectVector.h.

References mlrange_cast().

◆ deleteAt()

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

Deletes an element at the given position.

Definition at line 182 of file WEMObjectVector.h.

◆ destroy()

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

Deletes all elements in this vector.

Definition at line 124 of file WEMObjectVector.h.

References mlrange_cast().

◆ num()

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

Returns the number of elements in this vector.

Definition at line 39 of file WEMObjectVector.h.

◆ operator=()

template<class T >
WEMObjectVector< T > & ml::WEMObjectVector< T >::operator= ( WEMObjectVector< T > && other)
noexcept

Move assignment operator.

Definition at line 109 of file WEMObjectVector.h.

References mlrange_cast().


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