MeVisLab Toolbox Reference
|
Dynamic vector, based on a memory pool. Keeps track on entry numbers of stored primitives. More...
#include <WEMIndexVector.h>
Public Member Functions | |
WEMIndexVector (unsigned int init=0, unsigned int bs=8192) | |
Standard constructor. More... | |
WEMIndexVector (WEMIndexVector &&other) noexcept=default | |
WEMIndexVector & | operator= (WEMIndexVector &&other) noexcept=default |
~WEMIndexVector () | |
Standard destructor. More... | |
unsigned int | num () const |
Returns the number of elements in this vector. More... | |
T * | at (unsigned int pos) const |
Returns the element at the given position, typecast from WEMPrimitive to T. More... | |
T * | first () |
Returns the first element of this vector. More... | |
const T * | first () const |
Returns the first element of this vector. More... | |
T * | append () |
Appends an element to this vector, returns it and updates the index. More... | |
int | remove (T *t) |
Removes the given element from vector. More... | |
void | destroy () |
Destroys all elements in this vector. More... | |
void | reorder (const std::vector< unsigned int > &indexOrder) |
Sets the order by the given vector of indices. More... | |
Dynamic vector, based on a memory pool. Keeps track on entry numbers of stored primitives.
Definition at line 25 of file WEMIndexVector.h.
ml::WEMIndexVector< T >::WEMIndexVector | ( | unsigned int | init = 0 , |
unsigned int | bs = 8192 |
||
) |
Standard constructor.
Definition at line 75 of file WEMIndexVector.h.
References ml::library::init().
|
defaultnoexcept |
ml::WEMIndexVector< T >::~WEMIndexVector |
Standard destructor.
Definition at line 84 of file WEMIndexVector.h.
References ml::library::destroy().
T * ml::WEMIndexVector< T >::append |
Appends an element to this vector, returns it and updates the index.
Definition at line 126 of file WEMIndexVector.h.
References T.
|
inline |
Returns the element at the given position, typecast from WEMPrimitive to T.
Definition at line 38 of file WEMIndexVector.h.
void ml::WEMIndexVector< T >::destroy |
Destroys all elements in this vector.
Definition at line 92 of file WEMIndexVector.h.
|
inline |
Returns the first element of this vector.
Definition at line 40 of file WEMIndexVector.h.
References boost::at().
|
inline |
Returns the first element of this vector.
Definition at line 42 of file WEMIndexVector.h.
References ml::WEMIndexVector< T >::first().
Referenced by ml::WEMIndexVector< T >::first().
|
inline |
Returns the number of elements in this vector.
Definition at line 36 of file WEMIndexVector.h.
|
defaultnoexcept |
int ml::WEMIndexVector< T >::remove | ( | T * | t | ) |
Removes the given element from vector.
Note that this is done in O(1).
Definition at line 143 of file WEMIndexVector.h.
References boost::at().
void ml::WEMIndexVector< T >::reorder | ( | const std::vector< unsigned int > & | indexOrder | ) |
Sets the order by the given vector of indices.
The element in the internal vector at index i is repositioned to indexOrder[i].
Definition at line 168 of file WEMIndexVector.h.
References boost::at(), and WEM_ERROR.