1#ifndef _KVI_POINTERLIST_H_
2#define _KVI_POINTERLIST_H_
570 for(counter = &tmp[0]; counter != fill && !counter->
isEmpty(); ++counter)
572 counter->
merge(&carry);
580 for(counter = &tmp[1]; counter != fill; ++counter)
581 counter->
merge(counter - 1);
923 for(T *
t =
l->first();
t;
t =
l->next())
934 for(T *
t =
l->last();
t;
t =
l->prev())
979 while(
m_pAux && iIndex > 0)
1065 while(
m_pAux && iIndex > 0)
1231 for(T *
t =
l->first();
t;
t =
l->next())
1273#define KviPointerListBase KviPointerList
1276#ifdef COMPILE_ON_WINDOWS
1282template <
typename T>
int kvi_compare(const T *p1, const T *p2)
Definition KviPointerList.h:1283
A fast KviPointerList iterator.
Definition KviPointerList.h:142
KviPointerListNode * m_pNode
Definition KviPointerList.h:145
T * current()
Returns the value pointed by the iterator.
Definition KviPointerList.h:296
KviPointerListIterator(KviPointerList< T > &l)
Creates an iterator for the list l.
Definition KviPointerList.h:168
bool moveNext()
Moves the iterator to the next element of the list.
Definition KviPointerList.h:233
bool operator++()
Moves the iterator to the next element of the list.
Definition KviPointerList.h:249
bool movePrev()
Moves the iterator to the previous element of the list.
Definition KviPointerList.h:265
bool operator--()
Moves the iterator to the previous element of the list.
Definition KviPointerList.h:282
KviPointerList< T > * m_pList
Definition KviPointerList.h:144
bool isValid()
Returns true if this iterator points to a valid element.
Definition KviPointerList.h:319
KviPointerListIterator(KviPointerList< T > &l, KviPointerListNode *pNode)
Creates an iterator for the list l.
Definition KviPointerList.h:182
void operator=(const KviPointerListIterator< T > &src)
Creates an iterator copy.
Definition KviPointerList.h:195
KviPointerListIterator(const KviPointerListIterator< T > &src)
Creates an iterator copy.
Definition KviPointerList.h:155
bool moveFirst()
Moves the iterator to the first element of the list.
Definition KviPointerList.h:208
bool moveLast()
Moves the iterator to the last element of the list.
Definition KviPointerList.h:220
T * operator*()
Returns the value pointed by the iterator.
Definition KviPointerList.h:308
A KviPointerList node pointers.
Definition KviPointerList.h:63
void * m_pData
Definition KviPointerList.h:66
KviPointerListNode * m_pNext
Definition KviPointerList.h:67
KviPointerListNode * m_pPrev
Definition KviPointerList.h:65
A template double linked list of pointers.
Definition KviPointerList.h:371
void insertAfter(const T *ref, const T *d)
Inserts the item d after the item ref.
Definition KviPointerList.h:1152
void copyFrom(KviPointerList< T > *l)
Clears the list and inserts all the items from the list l.
Definition KviPointerList.h:1228
bool remove(int iIndex)
Removes the item at zero-based position iIndex.
Definition KviPointerList.h:1062
void grabFirstAndPrepend(KviPointerList< T > *src)
Grabs the first element from the list src and puts it as the first element of this list.
Definition KviPointerList.h:417
friend class KviPointerListIterator< T >
Definition KviPointerList.h:372
T * at(int idx)
Returns the item at index position.
Definition KviPointerList.h:819
void append(const T *d)
Appends an item at the end of the list.
Definition KviPointerList.h:895
T * last()
Returns the last item in the list.
Definition KviPointerList.h:714
KviPointerListIterator< T > iteratorAtFirst()
Returns an iterator pointing to the first item of the list.
Definition KviPointerList.h:702
KviPointerListIterator< T > iteratorAtCurrent()
Returns an iterator pointing to the current item in the list.
Definition KviPointerList.h:767
void removeCurrentSafe()
Removes the current iteration item assuming that it is valid.
Definition KviPointerList.h:454
void insertBeforeSafe(KviPointerListNode *ref, const T *d)
Inserts the item d before the item ref.
Definition KviPointerList.h:393
void append(KviPointerList< T > *l)
Appends all the items from the list l to this list.
Definition KviPointerList.h:921
virtual ~KviPointerList()
Destroys the list.
Definition KviPointerList.h:1267
KviPointerListNode * m_pTail
Definition KviPointerList.h:378
bool autoDelete()
Returns the autodelete flag.
Definition KviPointerList.h:1094
void invert()
Inverts the elements in the list.
Definition KviPointerList.h:1205
KviPointerList(bool bAutoDelete=true)
Creates a template list.
Definition KviPointerList.h:1253
void setAutoDelete(bool bAutoDelete)
Sets the autodelete flag.
Definition KviPointerList.h:1085
void insertBefore(const T *ref, const T *d)
Inserts the item d before the item ref.
Definition KviPointerList.h:1182
KviPointerListIterator< T > iteratorAt(int idx)
Returns an iterator pointing to the item at the specified index.
Definition KviPointerList.h:838
int findRef(const T *d)
Returns the position of an item.
Definition KviPointerList.h:861
bool removeFirst()
Removes the first item (if any)
Definition KviPointerList.h:996
void merge(KviPointerList< T > *src)
Inserts the list src inside this list.
Definition KviPointerList.h:481
T * prev()
Returns the previous item in the list.
Definition KviPointerList.h:801
bool m_bAutoDelete
Definition KviPointerList.h:375
void prepend(KviPointerList< T > *l)
Prepends all the items from the list l to this list.
Definition KviPointerList.h:932
T * current()
Returns the current iteration item.
Definition KviPointerList.h:741
bool isEmpty() const
Returns true if the list is empty.
Definition KviPointerList.h:611
unsigned int m_uCount
Definition KviPointerList.h:381
void insert(int iIndex, const T *d)
Inserts the item d at the position specified by iIndex.
Definition KviPointerList.h:976
void prepend(const T *d)
Inserts the item d in the head position.
Definition KviPointerList.h:943
KviPointerListNode * m_pHead
Definition KviPointerList.h:377
KviPointerList< T > & operator=(KviPointerList< T > &l)
Clears the list and inserts all the items from the list l.
Definition KviPointerList.h:1242
T * takeLast()
Removes the last item (if any) and returns it. This function obviously never deletes the item (regadl...
Definition KviPointerList.h:676
bool removeCurrent()
Removes the current iteration item.
Definition KviPointerList.h:1118
void inSort(T *t)
Inserts the item respecting the sorting order inside the list.
Definition KviPointerList.h:596
T * takeFirst()
Removes the first element from the list.
Definition KviPointerList.h:650
void swap(KviPointerList< T > *src)
Swap the lists.
Definition KviPointerList.h:534
KviPointerListIterator< T > iteratorAtRef(const T *d)
Returns an iterator pointing to the item with pointer d.
Definition KviPointerList.h:878
T * safeCurrent()
Returns the current iteration item.
Definition KviPointerList.h:755
unsigned int count() const
Returns the count of the items in the list.
Definition KviPointerList.h:620
void clear()
Removes all the items from the list.
Definition KviPointerList.h:1105
T * first()
Returns the first item in the list.
Definition KviPointerList.h:632
KviPointerListNode * m_pAux
Definition KviPointerList.h:379
bool removeRef(const T *d)
Removes the item pointed by d (if found in the list)
Definition KviPointerList.h:1134
KviPointerListIterator< T > iteratorAtLast()
Returns an iterator pointing to the first item of the list.
Definition KviPointerList.h:729
bool removeLast()
Removes the firstitem (if any)
Definition KviPointerList.h:1028
void sort()
Sorts this list in ascending order.
Definition KviPointerList.h:556
T * next()
Returns the next item in the list.
Definition KviPointerList.h:781
#define t
Definition detector.cpp:85
#define d
Definition detector.cpp:69
#define l
Definition detector.cpp:77
#define x
Definition detector.cpp:89
#define n
Definition detector.cpp:79
This file contains compile time settings.
#define KVILIB_API
Definition kvi_settings.h:124