#include <WEMFastVector.h>
Public Member Functions | |
| WEMFastVector (unsigned int init) | |
| Standard constructor. | |
| virtual | ~WEMFastVector () |
| Standard destructor. | |
| unsigned int | num () const |
| Return number of elements in the vector. | |
| T * | at (unsigned int pos) const |
| Return element at given position, return NULL when out of range. | |
| T * | first () |
| Return first element. | |
| const T * | first () const |
| Return first element. | |
| T * | last () |
| Return last element. | |
| const T * | last () const |
| Return last element. | |
| virtual unsigned int | append (T *elem) |
| Append element to back of vector. | |
| virtual void | swap (unsigned int p1, unsigned int p2) |
| Swaps two elements in vector. | |
| virtual void | clear () |
| Clear all internal pointers. | |
| virtual void | destroy () |
| Delete data. | |
| virtual void | deleteAt (unsigned int pos) |
| Delete element at given position. | |
| virtual void | deleteLast () |
| Delete last element of vector. | |
| virtual int | remove (T *elem) |
| Delete element given by its pointer, search element and delete. | |
| virtual int | lookup (T *elem) const |
| Search for element in vector and return its position. | |
| virtual int | removeUnSwapped (T *elem) |
| Delete element given by its pointer, search element and delete, keep order of elements! | |
| virtual void | replace (T *elem, unsigned int pos) |
| Replace the given position with the given element. | |
Fast vector as a simple wrapper around a fixed size array of <T>. All elements are deleted on destruction of the vector, no need to delete elements in between!
Definition at line 29 of file WEMFastVector.h.
| ml::WEMFastVector< T >::WEMFastVector | ( | unsigned int | init | ) | [inline] |
Standard constructor.
Definition at line 85 of file WEMFastVector.h.
References ML_CHECK_NEW, ML_TRACE_IN_TIME_CRITICAL, and T.
| ml::WEMFastVector< T >::~WEMFastVector | ( | ) | [inline, virtual] |
Standard destructor.
Definition at line 99 of file WEMFastVector.h.
References ml::WEMFastVector< T >::destroy(), ML_DELETE_ARRAY, and ML_TRACE_IN_TIME_CRITICAL.
| unsigned int ml::WEMFastVector< T >::append | ( | T * | elem | ) | [inline, virtual] |
Append element to back of vector.
Definition at line 132 of file WEMFastVector.h.
References ML_TRACE_IN_TIME_CRITICAL.
| T* ml::WEMFastVector< T >::at | ( | unsigned int | pos | ) | const [inline] |
Return element at given position, return NULL when out of range.
Definition at line 40 of file WEMFastVector.h.
Referenced by ml::WEMFastVector< T >::lookup().
| void ml::WEMFastVector< T >::clear | ( | void | ) | [inline, virtual] |
Clear all internal pointers.
This does not delete the elements in the vector!!
Definition at line 110 of file WEMFastVector.h.
References ML_TRACE_IN_TIME_CRITICAL.
| void ml::WEMFastVector< T >::deleteAt | ( | unsigned int | pos | ) | [inline, virtual] |
Delete element at given position.
Definition at line 175 of file WEMFastVector.h.
References ml::WEMFastVector< T >::deleteLast(), ML_TRACE_IN_TIME_CRITICAL, and ml::WEMFastVector< T >::swap().
Referenced by ml::WEMFastVector< T >::remove().
| void ml::WEMFastVector< T >::deleteLast | ( | ) | [inline, virtual] |
Delete last element of vector.
Definition at line 188 of file WEMFastVector.h.
References ML_TRACE_IN_TIME_CRITICAL.
Referenced by ml::WEMFastVector< T >::deleteAt(), and ml::WEMFastVector< T >::removeUnSwapped().
| void ml::WEMFastVector< T >::destroy | ( | ) | [inline, virtual] |
Delete data.
Definition at line 120 of file WEMFastVector.h.
References ML_DELETE, and ML_TRACE_IN_TIME_CRITICAL.
Referenced by ml::WEMFastVector< T >::~WEMFastVector().
| const T* ml::WEMFastVector< T >::first | ( | ) | const [inline] |
| T* ml::WEMFastVector< T >::first | ( | ) | [inline] |
| const T* ml::WEMFastVector< T >::last | ( | ) | const [inline] |
| T* ml::WEMFastVector< T >::last | ( | ) | [inline] |
| int ml::WEMFastVector< T >::lookup | ( | T * | elem | ) | const [inline, virtual] |
Search for element in vector and return its position.
Definition at line 198 of file WEMFastVector.h.
References ml::WEMFastVector< T >::at(), and ML_TRACE_IN_TIME_CRITICAL.
Referenced by ml::WEMFastVector< T >::remove(), and ml::WEMFastVector< T >::removeUnSwapped().
| unsigned int ml::WEMFastVector< T >::num | ( | ) | const [inline] |
| int ml::WEMFastVector< T >::remove | ( | T * | elem | ) | [inline, virtual] |
Delete element given by its pointer, search element and delete.
Definition at line 215 of file WEMFastVector.h.
References ml::WEMFastVector< T >::deleteAt(), ml::WEMFastVector< T >::lookup(), and ML_TRACE_IN_TIME_CRITICAL.
| int ml::WEMFastVector< T >::removeUnSwapped | ( | T * | elem | ) | [inline, virtual] |
Delete element given by its pointer, search element and delete, keep order of elements!
Definition at line 227 of file WEMFastVector.h.
References ml::WEMFastVector< T >::deleteLast(), ml::WEMFastVector< T >::lookup(), and ML_TRACE_IN_TIME_CRITICAL.
| void ml::WEMFastVector< T >::replace | ( | T * | elem, | |
| unsigned int | pos | |||
| ) | [inline, virtual] |
Replace the given position with the given element.
Definition at line 148 of file WEMFastVector.h.
References ML_TRACE_IN_TIME_CRITICAL.
| void ml::WEMFastVector< T >::swap | ( | unsigned int | p1, | |
| unsigned int | p2 | |||
| ) | [inline, virtual] |
Swaps two elements in vector.
Definition at line 158 of file WEMFastVector.h.
References ML_TRACE_IN_TIME_CRITICAL, and T.
Referenced by ml::WEMFastVector< T >::deleteAt().
1.5.8