|
MeVisLab Toolbox Reference
|
#include <CSOObjectVector.h>
Public Member Functions | |
| CSOObjectVector (unsigned int init=0, unsigned int bs=65535) | |
| Standard constructor. | |
| virtual | ~CSOObjectVector () |
| Standard destructor. | |
| unsigned int | num () const |
| Returns the number of elements in the vector. | |
| T * | atBoundsCheck (unsigned int pos) const |
| Returns the element at the specified position, and returns nullptr when out of range. | |
| T * | at (unsigned int pos) const |
| Returns the element at the specified position. | |
| T * | firstBoundsCheck () const |
| Returns the first element, and return nullptr if out of range. | |
| T * | first () const |
| Returns the first element. | |
| T * | lastBoundsCheck () const |
| Returns the last element, and returns nullptr if out of range. | |
| T * | last () const |
| Returns the last element. | |
| virtual unsigned int | append (T *elem) |
| Appends the element to the back of the vector and returns its position. | |
| virtual void | swap (unsigned int p1, unsigned int p2) |
| Swaps two elements in the vector. | |
| virtual void | clear () |
| virtual void | deleteAt (unsigned int pos) |
| Deletes an element at the specified position. | |
| virtual void | deleteLast () |
| Deletes the last element of the vector. | |
| virtual int | remove (T *elem) |
| Deletes an element specified by its pointer and returns its position. | |
| virtual int | lookup (T *elem) const |
| Searches for an element in the vector and returns its position. | |
| virtual int | removeUnSwapped (T *elem) |
| Deletes an element specified by its pointer and returns its position. | |
| virtual void | destroy () |
| virtual void | replace (T *elem, unsigned int pos) |
| Replaces the element at the specified position with the specified element. | |
| void | reserve (unsigned int init) |
| Reserves a number of elements. It copies old elements if needed. | |
Protected Member Functions | |
| virtual void | expand () |
| Grows vector by adding an extra block of size BLOCKSIZE. | |
| virtual unsigned int | appendUnsafe (T *elem) |
Dynamic templated vector. For speed and better memory handling, the vector is an array within an array. The base blocks have a BLOCKSIZE of 65535. This allows for quick expanding.
Definition at line 31 of file CSOObjectVector.h.
| ml::CSOObjectVector< T >::CSOObjectVector | ( | unsigned int | init = 0, |
| unsigned int | bs = 65535 ) |
Standard constructor.
Definition at line 121 of file CSOObjectVector.h.
References CSOObjectVector(), and T.
Referenced by ml::CSOObjectHeap< T >::CSOObjectHeap(), CSOObjectVector(), and ml::CSOObjectHeap< T >::sort().
|
virtual |
Standard destructor.
Definition at line 136 of file CSOObjectVector.h.
References clear(), and ~CSOObjectVector().
Referenced by ~CSOObjectVector().
|
virtual |
Appends the element to the back of the vector and returns its position.
Definition at line 188 of file CSOObjectVector.h.
References append(), expand(), and T.
Referenced by append(), and ml::CSOObjectHeap< T >::sort().
|
protectedvirtual |
Appends the element to back of vector. It does not check whether the element is not nullptr. Do not use this method directly!
Definition at line 205 of file CSOObjectVector.h.
References appendUnsafe(), expand(), and T.
Referenced by appendUnsafe(), ml::CSOObjectHeap< T >::insert(), and ml::CSOObjectHeap< T >::insert().
|
inline |
Returns the element at the specified position.
Definition at line 46 of file CSOObjectVector.h.
References T.
Referenced by first(), last(), lookup(), ml::CSOObjectHeap< T >::remove(), ml::CSOObjectHeap< T >::sort(), and ml::CSOObjectHeap< T >::swap().
|
inline |
Returns the element at the specified position, and returns nullptr when out of range.
Definition at line 44 of file CSOObjectVector.h.
References T.
Referenced by firstBoundsCheck(), and lastBoundsCheck().
|
virtual |
Clears all internal pointers. This does not delete the elements in the vector!
Definition at line 144 of file CSOObjectVector.h.
References clear().
Referenced by clear(), ml::CSOObjectHeap< T >::sort(), ml::CSOObjectHeap< T >::~CSOObjectHeap(), and ~CSOObjectVector().
|
virtual |
Deletes an element at the specified position.
Definition at line 243 of file CSOObjectVector.h.
References deleteAt(), deleteLast(), and swap().
Referenced by deleteAt(), and remove().
|
virtual |
Deletes the last element of the vector.
Definition at line 255 of file CSOObjectVector.h.
References deleteLast().
Referenced by deleteAt(), deleteLast(), ml::CSOObjectHeap< T >::remove(), and removeUnSwapped().
|
virtual |
Deletes all elements in the vector. This does not reset the number of elements!
Definition at line 157 of file CSOObjectVector.h.
References destroy().
Referenced by ml::deleteVector(), and destroy().
|
protectedvirtual |
Grows vector by adding an extra block of size BLOCKSIZE.
Definition at line 169 of file CSOObjectVector.h.
Referenced by append(), appendUnsafe(), and expand().
|
inline |
|
inline |
Returns the first element, and return nullptr if out of range.
Definition at line 48 of file CSOObjectVector.h.
References atBoundsCheck(), and T.
Referenced by ml::CSOObjectHeap< T >::root().
|
inline |
Returns the last element.
Definition at line 54 of file CSOObjectVector.h.
Referenced by ml::CSOObjectHeap< T >::insert(), and ml::CSOObjectHeap< T >::insert().
|
inline |
Returns the last element, and returns nullptr if out of range.
Definition at line 52 of file CSOObjectVector.h.
References atBoundsCheck(), and T.
|
virtual |
Searches for an element in the vector and returns its position.
Definition at line 267 of file CSOObjectVector.h.
References at(), lookup(), and T.
Referenced by lookup(), remove(), and removeUnSwapped().
|
inline |
Returns the number of elements in the vector.
Definition at line 42 of file CSOObjectVector.h.
Referenced by ml::CSOObjectHeap< T >::insert(), ml::CSOObjectHeap< T >::insert(), ml::CSOObjectHeap< T >::remove(), ml::CSOObjectHeap< T >::sort(), and ml::CSOObjectHeap< T >::update().
|
virtual |
Deletes an element specified by its pointer and returns its position.
Reimplemented in ml::CSOObjectHeap< T >.
Definition at line 284 of file CSOObjectVector.h.
References deleteAt(), lookup(), remove(), and T.
Referenced by remove().
|
virtual |
Deletes an element specified by its pointer and returns its position.
Definition at line 297 of file CSOObjectVector.h.
References deleteLast(), lookup(), removeUnSwapped(), and T.
Referenced by removeUnSwapped().
|
virtual |
Replaces the element at the specified position with the specified element.
Definition at line 219 of file CSOObjectVector.h.
Referenced by replace().
| void ml::CSOObjectVector< T >::reserve | ( | unsigned int | init | ) |
Reserves a number of elements. It copies old elements if needed.
Definition at line 314 of file CSOObjectVector.h.
Referenced by reserve().
|
virtual |
Swaps two elements in the vector.
Reimplemented in ml::CSOObjectHeap< T >.
Definition at line 227 of file CSOObjectVector.h.
Referenced by deleteAt(), ml::CSOObjectHeap< T >::swap(), and swap().