MeVisLabToolboxReference
ml::WEMContainer< T > Class Template Reference

Container with the ability to detect double inserts. More...

#include <WEMContainer.h>

Inheritance diagram for ml::WEMContainer< T >:
ml::WEMVector< WEMPrimitive >

List of all members.

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.

Detailed Description

template<class T>
class ml::WEMContainer< T >

Container with the ability to detect double inserts.

Uses _heapPosition to prevent conflicts with _entryNumber.

Definition at line 26 of file WEMContainer.h.


Constructor & Destructor Documentation

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

Standard constructor.

Definition at line 55 of file WEMContainer.h.

template<class T >
ml::WEMContainer< T >::~WEMContainer ( )

Standard destructor.

Definition at line 63 of file WEMContainer.h.


Member Function Documentation

template<class T >
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().

template<class T >
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.

template<class 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.

template<class T >
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.

template<class 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().

template<class T >
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().

template<class T >
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().


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