MeVisLabToolboxReference
|
Container with the ability to detect double inserts. More...
#include <WEMContainer.h>
Public Member Functions | |
WEMContainer (unsigned int init=0, unsigned int bs=8192) | |
Standard constructor. | |
~WEMContainer () | |
Standard destructor. | |
T * | at (unsigned int pos) |
Returns the element at the given position, typecast from WEMPrimitive to T. | |
const T * | at (unsigned int pos) const |
Returns the element at the given position, typecast from WEMPrimitive to T. | |
void | swap (unsigned int i, unsigned int j) |
Swaps elements and updates their indices. | |
unsigned int | append (WEMPrimitive *wp) |
Appends the given element to this vector and updates the index. | |
int | remove (WEMPrimitive *wp) |
Removes the given element from vector. | |
void | replace (WEMPrimitive *wp, unsigned int pos) |
Replaces the given element at the given position, updates index. | |
virtual void | destroy () |
Destroys all elements in this vector. |
Container with the ability to detect double inserts.
Uses _heapPosition to prevent conflicts with _entryNumber.
Definition at line 26 of file WEMContainer.h.
ml::WEMContainer< T >::WEMContainer | ( | unsigned int | init = 0 , |
unsigned int | bs = 8192 |
||
) |
Standard constructor.
Definition at line 55 of file WEMContainer.h.
ml::WEMContainer< T >::~WEMContainer | ( | ) |
Standard destructor.
Definition at line 63 of file WEMContainer.h.
unsigned int ml::WEMContainer< T >::append | ( | WEMPrimitive * | wp | ) | [virtual] |
Appends the given element to this vector and updates the index.
Only works if element is not yet in vector!
Reimplemented from ml::WEMVector< WEMPrimitive >.
Definition at line 128 of file WEMContainer.h.
References ml::WEMVector< T >::appendUnsafe(), and ml::WEMPrimitive::getHeapPosition().
T * ml::WEMContainer< T >::at | ( | unsigned int | pos | ) |
Returns the element at the given position, typecast from WEMPrimitive to T.
Definition at line 70 of file WEMContainer.h.
References ml::WEMVector< T >::at(), and T.
const T * ml::WEMContainer< T >::at | ( | unsigned int | pos | ) | const |
Returns the element at the given position, typecast from WEMPrimitive to T.
Reimplemented from ml::WEMVector< WEMPrimitive >.
Definition at line 86 of file WEMContainer.h.
void ml::WEMContainer< T >::destroy | ( | ) | [virtual] |
Destroys all elements in this vector.
Reimplemented from ml::WEMVector< WEMPrimitive >.
Definition at line 94 of file WEMContainer.h.
References ML_DELETE, ml::WEMVector< T >::replace(), and T.
int ml::WEMContainer< T >::remove | ( | WEMPrimitive * | wp | ) | [virtual] |
Removes the given element from vector.
Note that this is done in O(1)!
Reimplemented from ml::WEMVector< WEMPrimitive >.
Definition at line 153 of file WEMContainer.h.
References ml::WEMPrimitive::getHeapPosition().
void ml::WEMContainer< T >::replace | ( | WEMPrimitive * | wp, |
unsigned int | pos | ||
) | [virtual] |
Replaces the given element at the given position, updates index.
Reimplemented from ml::WEMVector< WEMPrimitive >.
Definition at line 141 of file WEMContainer.h.
References ml::WEMVector< T >::replace(), and ml::WEMPrimitive::setHeapPosition().
void ml::WEMContainer< T >::swap | ( | unsigned int | i, |
unsigned int | j | ||
) | [virtual] |
Swaps elements and updates their indices.
Reimplemented from ml::WEMVector< WEMPrimitive >.
Definition at line 118 of file WEMContainer.h.
References ml::WEMVector< T >::swap().