KVIrc  4.9.2
DeveloperAPIs
KviPointerList.h
Go to the documentation of this file.
1 #ifndef _KVI_POINTERLIST_H_
2 #define _KVI_POINTERLIST_H_
3 //===============================================================================
4 //
5 // File : KviPointerList.h
6 // Creation date : Tue Jul 6 1999 14:52:20 by Szymon Stefanek
7 //
8 // This file is part of the KVIrc IRC client distribution
9 // Copyright (C) 1999-2010 Szymon Stefanek (pragma at kvirc dot net)
10 //
11 // This program is FREE software. You can redistribute it and/or
12 // modify it under the terms of the GNU General Public License
13 // as published by the Free Software Foundation; either version 2
14 // of the License, or (at your option) any later version.
15 //
16 // This program is distributed in the HOPE that it will be USEFUL,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19 // See the GNU General Public License for more details.
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with this program. If not, write to the Free Software Foundation,
23 // Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 //
25 //===============================================================================
26 //
27 // C++ Template based double linked pointer list class
28 // Original ss_list.h Created on 10 Dec 2001
29 // Copyright (C) 2001-2010 Szymon Stefanek (pragma at kvirc dot net)
30 // Added to KVIrc on 02 Jan 2008.
31 //
32 //===============================================================================
33 
52 #include "kvi_settings.h"
53 
54 template <typename T>
56 template <typename T>
58 
59 #ifndef NULL
60 #define NULL 0
61 #endif
62 
68 {
69 public:
71  void * m_pData;
73 };
74 
145 template <typename T>
147 {
148 protected:
151 
152 public:
161  {
162  m_pList = src.m_pList;
163  m_pNode = src.m_pNode;
164  }
165 
174  {
175  m_pList = (KviPointerList<T> *)&l;
176  m_pNode = m_pList->m_pHead;
177  }
178 
188  {
189  m_pList = (KviPointerList<T> *)&l;
190  m_pNode = pNode;
191  }
192 
201  {
202  m_pList = src.m_pList;
203  m_pNode = src.m_pNode;
204  }
205 
206 public:
213  bool moveFirst()
214  {
215  m_pNode = m_pList->m_pHead;
216  return m_pNode != NULL;
217  }
218 
225  bool moveLast()
226  {
227  m_pNode = m_pList->m_pTail;
228  return m_pNode != NULL;
229  }
230 
238  bool moveNext()
239  {
240  if(!m_pNode)
241  return false;
243  return m_pNode != NULL;
244  }
245 
254  bool operator++()
255  {
256  if(!m_pNode)
257  return false;
259  return m_pNode != NULL;
260  }
261 
270  bool movePrev()
271  {
272  if(!m_pNode)
273  return false;
275  return m_pNode != NULL;
276  }
277 
287  bool operator--()
288  {
289  if(!m_pNode)
290  return false;
292  return m_pNode != NULL;
293  }
294 
301  T * current()
302  {
303  return m_pNode ? (T *)(m_pNode->m_pData) : NULL;
304  }
305 
313  T * operator*()
314  {
315  return m_pNode ? (T *)(m_pNode->m_pData) : NULL;
316  }
317 
324  bool isValid()
325  {
326  return m_pNode != NULL;
327  }
328 };
329 
374 template <typename T>
375 class KviPointerList
376 {
377  friend class KviPointerListIterator<T>;
378 
379 protected:
380  bool m_bAutoDelete; //< do we automatically delete items when they are removed ?
381 
382  KviPointerListNode * m_pHead; //< our list head pointer (NULL if there are no items in the list)
383  KviPointerListNode * m_pTail; //< our list tail
384  KviPointerListNode * m_pAux; //< our iteration pointer
385 
386  unsigned int m_uCount; //< the count of items in the list
387 protected:
398  void insertBeforeSafe(KviPointerListNode * ref, const T * d)
399  {
400  m_pAux = ref;
402  n->m_pPrev = m_pAux->m_pPrev;
403  n->m_pNext = m_pAux;
404  if(m_pAux->m_pPrev)
405  {
406  m_pAux->m_pPrev->m_pNext = n;
407  }
408  else
409  {
410  m_pHead = n;
411  }
412  m_pAux->m_pPrev = n;
413  n->m_pData = (void *)d;
414  m_uCount++;
415  }
416 
423  {
424  KviPointerListNode * pNewHead = src->m_pHead;
425  if(!pNewHead)
426  return;
427 
428  if(pNewHead->m_pNext)
429  {
430  src->m_pHead = pNewHead->m_pNext;
431  src->m_pHead->m_pPrev = NULL;
432  }
433  else
434  {
435  src->m_pHead = NULL;
436  src->m_pTail = NULL;
437  }
438 
439  if(m_pHead)
440  {
441  m_pHead->m_pPrev = pNewHead;
442  pNewHead->m_pNext = m_pHead;
443  m_pHead = pNewHead;
444  }
445  else
446  {
447  m_pHead = pNewHead;
448  m_pTail = pNewHead;
449  m_pHead->m_pNext = NULL;
450  }
451  m_uCount++;
452  src->m_uCount--;
453  }
454 
460  {
461  if(m_pAux->m_pPrev)
463  else
465  if(m_pAux->m_pNext)
467  else
469  const T * pAuxData = (const T *)(m_pAux->m_pData);
470  delete m_pAux;
471  m_pAux = NULL;
472  m_uCount--;
473  if(m_bAutoDelete)
474  delete pAuxData; // this can cause recursion, so do it at the end
475  }
476 
477 public:
487  {
488  m_pAux = m_pHead;
489  KviPointerListNode * n = src->m_pHead;
490  m_uCount += src->m_uCount;
491  while(m_pAux && n)
492  {
493  if(kvi_compare((const T *)(m_pAux->m_pData), (const T *)(n->m_pData)) > 0)
494  {
495  // our element is greater, n->m_pData goes first
496  KviPointerListNode * pNext = n->m_pNext;
497  n->m_pPrev = m_pAux->m_pPrev; // his prev becomes
498  n->m_pNext = m_pAux;
499  if(m_pAux->m_pPrev)
500  m_pAux->m_pPrev->m_pNext = n;
501  else
502  m_pHead = n;
503  m_pAux->m_pPrev = n;
504  n = pNext;
505  }
506  else
507  {
508  // that element is greater
509  m_pAux = m_pAux->m_pNext;
510  }
511  }
512  if(n)
513  {
514  // last items to append
515  if(m_pTail)
516  {
517  m_pTail->m_pNext = n;
518  n->m_pPrev = m_pTail;
519  }
520  else
521  {
522  m_pHead = n;
523  m_pTail = n;
524  n->m_pPrev = NULL;
525  }
526  m_pTail = src->m_pTail;
527  }
528 
529  src->m_pHead = NULL;
530  src->m_pTail = NULL;
531  src->m_uCount = 0;
532  }
533 
540  {
542  m_pHead = src->m_pHead;
543  src->m_pHead = n;
544  n = m_pTail;
545  m_pTail = src->m_pTail;
546  src->m_pTail = n;
547  unsigned int uCount = m_uCount;
548  m_uCount = src->m_uCount;
549  src->m_uCount = uCount;
550  }
551 
561  void sort()
562  {
563  if(m_uCount < 2)
564  return;
565 
566  KviPointerList<T> carry;
567  KviPointerList<T> tmp[64];
568  KviPointerList * fill = &tmp[0];
569  KviPointerList * counter;
570 
571  do
572  {
573  carry.grabFirstAndPrepend(this);
574 
575  for(counter = &tmp[0]; counter != fill && !counter->isEmpty(); ++counter)
576  {
577  counter->merge(&carry);
578  carry.swap(counter);
579  }
580  carry.swap(counter);
581  if(counter == fill)
582  ++fill;
583  } while(m_uCount > 0);
584 
585  for(counter = &tmp[1]; counter != fill; ++counter)
586  counter->merge(counter - 1);
587  swap(fill - 1);
588  }
589 
601  void inSort(T * t)
602  {
604  while(x && (kvi_compare(((T *)x->m_pData), t) > 0))
605  x = x->m_pNext;
606  if(!x)
607  append(t);
608  else
609  insertBeforeSafe(x, t);
610  }
611 
616  bool isEmpty() const
617  {
618  return (m_pHead == NULL);
619  }
620 
625  unsigned int count() const
626  {
627  return m_uCount;
628  }
629 
637  T * first()
638  {
639  if(!m_pHead)
640  {
641  m_pAux = NULL;
642  return NULL;
643  }
644  m_pAux = m_pHead;
645  return (T *)(m_pAux->m_pData);
646  }
647 
655  T * takeFirst()
656  {
657  if(!m_pHead)
658  return NULL;
659  T * pData = (T *)m_pHead->m_pData;
660  if(m_pHead->m_pNext)
661  {
663  delete m_pHead->m_pPrev;
664  m_pHead->m_pPrev = NULL;
665  }
666  else
667  {
668  delete m_pHead;
669  m_pHead = NULL;
670  m_pTail = NULL;
671  }
672  m_pAux = NULL;
673  m_uCount--;
674  return pData;
675  }
676 
681  T * takeLast()
682  {
683  if(!m_pTail)
684  return NULL;
685  T * pData = (T *)m_pTail->m_pData;
686  if(m_pTail->m_pPrev)
687  {
689  delete m_pTail->m_pNext;
690  m_pTail->m_pNext = NULL;
691  }
692  else
693  {
694  delete m_pTail;
695  m_pHead = NULL;
696  m_pTail = NULL;
697  }
698  m_pAux = NULL;
699  m_uCount--;
700  return pData;
701  }
702 
708  {
709  return KviPointerListIterator<T>(*this, m_pHead);
710  }
711 
719  T * last()
720  {
721  if(!m_pTail)
722  {
723  m_pAux = NULL;
724  return NULL;
725  }
726  m_pAux = m_pTail;
727  return (T *)(m_pAux->m_pData);
728  }
729 
735  {
736  return KviPointerListIterator<T>(*this, m_pTail);
737  }
738 
746  T * current()
747  {
748  return (T *)(m_pAux->m_pData);
749  }
750 
761  {
762  return m_pAux ? (T *)(m_pAux->m_pData) : NULL;
763  }
764 
773  {
774  return KviPointerListIterator<T>(*this, m_pAux);
775  }
776 
786  T * next()
787  {
788  if(!m_pAux)
789  return NULL;
790  m_pAux = m_pAux->m_pNext;
791  if(m_pAux)
792  return (T *)(m_pAux->m_pData);
793  return NULL;
794  }
795 
806  T * prev()
807  {
808  if(!m_pAux)
809  return NULL;
810  m_pAux = m_pAux->m_pPrev;
811  if(m_pAux)
812  return (T *)(m_pAux->m_pData);
813  return NULL;
814  }
815 
824  T * at(int idx)
825  {
826  T * t = first();
827  int cnt = 0;
828  while(t)
829  {
830  if(idx == cnt)
831  return t;
832  t = next();
833  cnt++;
834  }
835  return 0;
836  }
837 
844  {
846  int cnt = 0;
847  while(n)
848  {
849  if(idx == cnt)
850  return KviPointerListIterator<T>(*this, n);
851  n = n->m_pNext;
852  cnt++;
853  }
854  return KviPointerListIterator<T>(*this, NULL);
855  }
856 
866  int findRef(const T * d)
867  {
868  int ret = 0;
869  for(T * t = first(); t; t = next())
870  {
871  if(t == d)
872  return ret;
873  ret++;
874  }
875  return -1;
876  }
877 
884  {
886  while(n)
887  {
888  if(n->m_pData == d)
889  return KviPointerListIterator<T>(*this, n);
890  n = n->m_pNext;
891  }
892  return KviPointerListIterator<T>(*this, NULL);
893  }
894 
900  void append(const T * d)
901  {
902  if(!m_pHead)
903  {
905  m_pHead->m_pPrev = NULL;
906  m_pHead->m_pNext = NULL;
907  m_pHead->m_pData = (void *)d;
908  m_pTail = m_pHead;
909  }
910  else
911  {
915  m_pTail->m_pNext->m_pData = (void *)d;
917  }
918  m_uCount++;
919  }
920 
927  {
928  for(T * t = l->first(); t; t = l->next())
929  append(t);
930  }
931 
938  {
939  for(T * t = l->last(); t; t = l->prev())
940  prepend(t);
941  }
942 
948  void prepend(const T * d)
949  {
950  if(!m_pHead)
951  {
953  m_pHead->m_pPrev = NULL;
954  m_pHead->m_pNext = NULL;
955  m_pHead->m_pData = (void *)d;
956  m_pTail = m_pHead;
957  }
958  else
959  {
963  m_pHead->m_pPrev->m_pData = (void *)d;
965  m_uCount++;
966  }
967  }
968 
981  void insert(int iIndex, const T * d)
982  {
983  m_pAux = m_pHead;
984  while(m_pAux && iIndex > 0)
985  {
986  iIndex--;
987  m_pAux = m_pAux->m_pNext;
988  }
989  if(m_pAux)
991  else
992  append(d);
993  }
994 
1002  {
1003  if(!m_pHead)
1004  return false;
1005  const T * pAuxData;
1006  if(m_pHead->m_pNext)
1007  {
1008  m_pHead = m_pHead->m_pNext;
1009  pAuxData = (const T *)(m_pHead->m_pPrev->m_pData);
1010  delete m_pHead->m_pPrev;
1011  m_pHead->m_pPrev = NULL;
1012  }
1013  else
1014  {
1015  pAuxData = (const T *)(m_pHead->m_pData);
1016  delete m_pHead;
1017  m_pHead = NULL;
1018  m_pTail = NULL;
1019  }
1020  m_pAux = NULL;
1021  m_uCount--;
1022  if(m_bAutoDelete)
1023  delete pAuxData;
1024  return true;
1025  }
1026 
1033  bool removeLast()
1034  {
1035  if(!m_pTail)
1036  return false;
1037  const T * pAuxData;
1038  if(m_pTail->m_pPrev)
1039  {
1040  m_pTail = m_pTail->m_pPrev;
1041  pAuxData = (const T *)(m_pTail->m_pNext->m_pData);
1042  delete m_pTail->m_pNext;
1043  m_pTail->m_pNext = NULL;
1044  }
1045  else
1046  {
1047  pAuxData = (const T *)(m_pTail->m_pData);
1048  delete m_pTail;
1049  m_pHead = NULL;
1050  m_pTail = NULL;
1051  }
1052  m_pAux = NULL;
1053  m_uCount--;
1054  if(m_bAutoDelete)
1055  delete pAuxData;
1056  return true;
1057  }
1058 
1067  bool remove(int iIndex)
1068  {
1069  m_pAux = m_pHead;
1070  while(m_pAux && iIndex > 0)
1071  {
1072  iIndex--;
1073  m_pAux = m_pAux->m_pNext;
1074  }
1075  if(!m_pAux)
1076  return false;
1078  return true;
1079  }
1080 
1090  void setAutoDelete(bool bAutoDelete)
1091  {
1092  m_bAutoDelete = bAutoDelete;
1093  }
1094 
1099  bool autoDelete()
1100  {
1101  return m_bAutoDelete;
1102  };
1103 
1110  void clear()
1111  {
1112  while(m_pHead)
1113  removeFirst();
1114  }
1115 
1124  {
1125  if(!m_pAux)
1126  return false;
1128  return true;
1129  }
1130 
1139  bool removeRef(const T * d)
1140  {
1141  if(findRef(d) == -1)
1142  return false;
1144  return true;
1145  }
1146 
1157  void insertAfter(const T * ref, const T * d)
1158  {
1159  if(findRef(ref) == -1)
1160  {
1161  append(d);
1162  return;
1163  }
1165  n->m_pPrev = m_pAux;
1166  n->m_pNext = m_pAux->m_pNext;
1167  if(m_pAux->m_pNext)
1168  m_pAux->m_pNext->m_pPrev = n;
1169  else
1170  m_pTail = n;
1171  m_pAux->m_pNext = n;
1172  n->m_pData = (void *)d;
1173  m_uCount++;
1174  }
1175 
1187  void insertBefore(const T * ref, const T * d)
1188  {
1189  if(findRef(ref) == -1)
1190  {
1191  prepend(d);
1192  return;
1193  }
1195  n->m_pPrev = m_pAux->m_pPrev;
1196  n->m_pNext = m_pAux;
1197  if(m_pAux->m_pPrev)
1198  m_pAux->m_pPrev->m_pNext = n;
1199  else
1200  m_pHead = n;
1201  m_pAux->m_pPrev = n;
1202  n->m_pData = (void *)d;
1203  m_uCount++;
1204  }
1205 
1210  void invert()
1211  {
1212  if(!m_pHead)
1213  return;
1214  KviPointerListNode * oldHead = m_pHead;
1215  KviPointerListNode * oldTail = m_pTail;
1217  while(n)
1218  {
1220  n->m_pNext = n->m_pPrev;
1221  n->m_pPrev = next;
1222  n = next;
1223  }
1224  m_pTail = oldHead;
1225  m_pHead = oldTail;
1226  }
1227 
1234  {
1235  clear();
1236  for(T * t = l->first(); t; t = l->next())
1237  append(t);
1238  }
1239 
1248  {
1249  copyFrom(&l);
1250  return *this;
1251  }
1252 
1258  KviPointerList<T>(bool bAutoDelete = true)
1259  {
1260  m_bAutoDelete = bAutoDelete;
1261  m_pHead = NULL;
1262  m_pTail = NULL;
1263  m_uCount = 0;
1264  m_pAux = NULL;
1265  };
1266 
1273  {
1274  clear();
1275  };
1276 };
1277 
1278 #define KviPointerListBase KviPointerList
1279 
1280 // BROKEN MSVC LINKER
1281 #ifdef COMPILE_ON_WINDOWS
1282 #include "KviCString.h"
1283 template class KVILIB_API KviPointerList<KviCString>;
1284 #endif
1285 
1286 // Provide a default implementation of kvi_compare()
1287 template <typename T>
1288 int kvi_compare(const T * p1, const T * p2)
1289 {
1290  return p1 > p2; // just compare pointers
1291 }
1292 
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