1 #ifndef _KVI_POINTERLIST_H_
2 #define _KVI_POINTERLIST_H_
145 template <
typename T>
374 template <
typename T>
575 for(counter = &tmp[0]; counter != fill && !counter->
isEmpty(); ++counter)
577 counter->
merge(&carry);
585 for(counter = &tmp[1]; counter != fill; ++counter)
586 counter->
merge(counter - 1);
984 while(
m_pAux && iIndex > 0)
1067 bool remove(
int iIndex)
1070 while(
m_pAux && iIndex > 0)
1278 #define KviPointerListBase KviPointerList
1281 #ifdef COMPILE_ON_WINDOWS
1287 template <
typename T>
1293 #endif //_KVI_POINTERLIST_H_
bool removeFirst()
Removes the first item (if any)
Definition: KviPointerList.h:1001
int kvi_compare(const T *p1, const T *p2)
Definition: KviPointerList.h:1288
void insertAfter(const T *ref, const T *d)
Inserts the item d after the item ref.
Definition: KviPointerList.h:1157
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:422
unsigned int m_uCount
Definition: KviPointerList.h:386
KviPointerListIterator(KviPointerList< T > &l, KviPointerListNode *pNode)
Creates an iterator for the list l.
Definition: KviPointerList.h:187
KviPointerListIterator< T > iteratorAtFirst()
Returns an iterator pointing to the first item of the list.
Definition: KviPointerList.h:707
T * at(int idx)
Returns the item at index position.
Definition: KviPointerList.h:824
#define NULL
Definition: KviPointerList.h:60
void append(const T *d)
Appends an item at the end of the list.
Definition: KviPointerList.h:900
#define l
Definition: detector.cpp:76
void insert(int iIndex, const T *d)
Inserts the item d at the position specified by iIndex.
Definition: KviPointerList.h:981
void invert()
Inverts the elements in the list.
Definition: KviPointerList.h:1210
unsigned int count() const
Returns the count of the items in the list.
Definition: KviPointerList.h:625
void inSort(T *t)
Inserts the item respecting the sorting order inside the list.
Definition: KviPointerList.h:601
bool movePrev()
Moves the iterator to the previous element of the list.
Definition: KviPointerList.h:270
T * takeLast()
Removes the last item (if any) and returns it. This function obviously never deletes the item (regadl...
Definition: KviPointerList.h:681
KviPointerListIterator< T > iteratorAt(int idx)
Returns an iterator pointing to the item at the specified index.
Definition: KviPointerList.h:843
KviPointerListIterator(const KviPointerListIterator< T > &src)
Creates an iterator copy.
Definition: KviPointerList.h:160
void append(KviPointerList< T > *l)
Appends all the items from the list l to this list.
Definition: KviPointerList.h:926
#define n
Definition: detector.cpp:78
void * m_pData
Definition: KviPointerList.h:71
bool moveLast()
Moves the iterator to the last element of the list.
Definition: KviPointerList.h:225
bool operator--()
Moves the iterator to the previous element of the list.
Definition: KviPointerList.h:287
T * first()
Returns the first item in the list.
Definition: KviPointerList.h:637
T * last()
Returns the last item in the list.
Definition: KviPointerList.h:719
T * next()
Returns the next item in the list.
Definition: KviPointerList.h:786
bool moveFirst()
Moves the iterator to the first element of the list.
Definition: KviPointerList.h:213
KviPointerListNode * m_pPrev
Definition: KviPointerList.h:70
void clear()
Removes all the items from the list.
Definition: KviPointerList.h:1110
bool m_bAutoDelete
Definition: KviPointerList.h:380
T * takeFirst()
Removes the first element from the list.
Definition: KviPointerList.h:655
T * current()
Returns the current iteration item.
Definition: KviPointerList.h:746
void copyFrom(KviPointerList< T > *l)
Clears the list and inserts all the items from the list l.
Definition: KviPointerList.h:1233
KviPointerListNode * m_pHead
Definition: KviPointerList.h:382
void swap(KviPointerList< T > *src)
Swap the lists.
Definition: KviPointerList.h:539
void insertBefore(const T *ref, const T *d)
Inserts the item d before the item ref.
Definition: KviPointerList.h:1187
KviPointerListNode * m_pNode
Definition: KviPointerList.h:150
bool operator++()
Moves the iterator to the next element of the list.
Definition: KviPointerList.h:254
void setAutoDelete(bool bAutoDelete)
Sets the autodelete flag.
Definition: KviPointerList.h:1090
KviPointerListIterator< T > iteratorAtCurrent()
Returns an iterator pointing to the current item in the list.
Definition: KviPointerList.h:772
char s d
Definition: KviIrcNumericCodes.h:391
T * prev()
Returns the previous item in the list.
Definition: KviPointerList.h:806
bool removeRef(const T *d)
Removes the item pointed by d (if found in the list)
Definition: KviPointerList.h:1139
KviPointerListNode * m_pNext
Definition: KviPointerList.h:72
bool autoDelete()
Returns the autodelete flag.
Definition: KviPointerList.h:1099
KviPointerListNode * m_pAux
Definition: KviPointerList.h:384
KviPointerList< T > * m_pList
Definition: KviPointerList.h:149
void prepend(KviPointerList< T > *l)
Prepends all the items from the list l to this list.
Definition: KviPointerList.h:937
bool moveNext()
Moves the iterator to the next element of the list.
Definition: KviPointerList.h:238
KviPointerListIterator< T > iteratorAtRef(const T *d)
Returns an iterator pointing to the item with pointer d.
Definition: KviPointerList.h:883
KviPointerListIterator(KviPointerList< T > &l)
Creates an iterator for the list l.
Definition: KviPointerList.h:173
KviPointerListNode * m_pTail
Definition: KviPointerList.h:383
QHashIterator< int, QFile * > t(getDict)
KviPointerList< T > & operator=(KviPointerList< T > &l)
Clears the list and inserts all the items from the list l.
Definition: KviPointerList.h:1247
T * current()
Returs the value pointed by the iterator.
Definition: KviPointerList.h:301
bool removeLast()
Removes the firstitem (if any)
Definition: KviPointerList.h:1033
void merge(KviPointerList< T > *src)
Inserts the list src inside this list.
Definition: KviPointerList.h:486
A template double linked list of pointers.
Definition: KviPointerList.h:55
void sort()
Sorts this list in ascending order.
Definition: KviPointerList.h:561
bool removeCurrent()
Removes the current iteration item.
Definition: KviPointerList.h:1123
void operator=(const KviPointerListIterator< T > &src)
Creates an iterator copy.
Definition: KviPointerList.h:200
#define x
Definition: detector.cpp:88
A KviPointerList node pointers.
Definition: KviPointerList.h:67
void insertBeforeSafe(KviPointerListNode *ref, const T *d)
Inserts the item d before the item ref.
Definition: KviPointerList.h:398
bool isValid()
Returns true if this iterator points to a valid element.
Definition: KviPointerList.h:324
T * safeCurrent()
Returns the current iteration item.
Definition: KviPointerList.h:760
void prepend(const T *d)
Inserts the item d in the head position.
Definition: KviPointerList.h:948
int findRef(const T *d)
Returns the position of an item.
Definition: KviPointerList.h:866
KviPointerListIterator< T > iteratorAtLast()
Returns an iterator pointing to the first item of the list.
Definition: KviPointerList.h:734
bool isEmpty() const
Returns true if the list is empty.
Definition: KviPointerList.h:616
void removeCurrentSafe()
Removes the current iteration item assuming that it is valid.
Definition: KviPointerList.h:459
This file contains compile time settings.
T * operator*()
Returs the value pointed by the iterator.
Definition: KviPointerList.h:313
#define KVILIB_API
Definition: kvi_settings.h:125
A fast KviPointerList iterator.
Definition: KviPointerList.h:57