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)
 Get element at given position, typecast from WEMPrimitive to T.
const T * at (unsigned int pos) const
 Get element at given position, typecast from WEMPrimitive to T.
void swap (unsigned int i, unsigned int j)
 Swap elements and update indices.
unsigned int append (WEMPrimitive *wp)
 Append element to vector, update index, only works if element is not yet in vector!
int remove (WEMPrimitive *wp)
 Remove element from vector, note that this is done in O(1)!
void replace (WEMPrimitive *wp, unsigned int pos)
 Replaces element at given position, update index.
virtual void destroy ()
 Destroy elements in 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 
) [inline]

Standard constructor.

Definition at line 53 of file WEMContainer.h.

References ML_TRACE_IN_TIME_CRITICAL.

template<class T >
ml::WEMContainer< T >::~WEMContainer (  )  [inline]

Standard destructor.

Definition at line 62 of file WEMContainer.h.

References ML_TRACE_IN_TIME_CRITICAL.


Member Function Documentation

template<class T >
unsigned int ml::WEMContainer< T >::append ( WEMPrimitive wp  )  [inline, virtual]

template<class T >
const T * ml::WEMContainer< T >::at ( unsigned int  pos  )  const [inline]

Get element at given position, typecast from WEMPrimitive to T.

Reimplemented from ml::WEMVector< WEMPrimitive >.

Definition at line 81 of file WEMContainer.h.

References ml::WEMContainer< T >::at(), and ML_TRACE_IN_TIME_CRITICAL.

template<class T >
T * ml::WEMContainer< T >::at ( unsigned int  pos  )  [inline]

Get element at given position, typecast from WEMPrimitive to T.

Definition at line 70 of file WEMContainer.h.

References ML_TRACE_IN_TIME_CRITICAL, and T.

Referenced by ml::WEMContainer< T >::at(), ml::WEMContainer< T >::destroy(), ml::WEMContainer< T >::remove(), and ml::WEMContainer< T >::swap().

template<class T >
void ml::WEMContainer< T >::destroy (  )  [inline, virtual]

template<class T >
int ml::WEMContainer< T >::remove ( WEMPrimitive wp  )  [inline, virtual]

template<class T >
void ml::WEMContainer< T >::replace ( WEMPrimitive wp,
unsigned int  pos 
) [inline, virtual]

Replaces element at given position, update index.

Reimplemented from ml::WEMVector< WEMPrimitive >.

Definition at line 138 of file WEMContainer.h.

References ML_TRACE_IN_TIME_CRITICAL, and ml::WEMPrimitive::setHeapPosition().

Referenced by ml::WEMContainer< T >::destroy().

template<class T >
void ml::WEMContainer< T >::swap ( unsigned int  i,
unsigned int  j 
) [inline, virtual]

Swap elements and update indices.

Reimplemented from ml::WEMVector< WEMPrimitive >.

Definition at line 111 of file WEMContainer.h.

References ml::WEMContainer< T >::at(), and ML_TRACE_IN_TIME_CRITICAL.

Referenced by ml::WEMContainer< T >::remove().


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

Generated on Sat Sep 3 18:39:41 2011 for MeVisLab Toolbox Reference by  doxygen 1.5.8