COVISE Core
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
coDLList.h
Go to the documentation of this file.
1 /* This file is part of COVISE.
2 
3  You can use it under the terms of the GNU Lesser General Public License
4  version 2.1 or later, see lgpl-2.1.txt.
5 
6  * License: LGPL 2+ */
7 
8 #ifndef _YAC_DL_LIST_H
9 #define _YAC_DL_LIST_H
10 
11 // this is needed for NULL
12 #include <stddef.h>
13 #include <list>
14 
15 // some need this for bool type
16 #include "coExport.h"
17 #include "coErr.h"
18 
19 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
20 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
21 // ++ ++
22 // ++ ++
23 // ++ Description: Double-Linked list class ++
24 // ++ ++
25 // ++ class coDLListElem<T> Element of type T + prev/next pointer ++
26 // ++ class coDLList<T> List of Elements of type T ++
27 // ++ class coDLListIter<T> Iterator working on coDLList ++
28 // ++ class coDLPtrList<T> List of T elements, which can be deleted on ++
29 // ++ remove: MUST BE POINTERS !!!!! ++
30 // ++ ++
31 // ++ (C)1999 RUS ++
32 // ++ Computing Center University of Stuttgart ++
33 // ++ Allmandring 30 ++
34 // ++ 70550 Stuttgart ++
35 // ++ Author: A. Werner ++
36 // ++ Date: 15.08.97 V1.0 ++
37 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
38 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
39 namespace covise
40 {
41 
42 template <class T>
44 
45 template <class T>
47 
48 #ifndef INLINE
49 #define INLINE inline
50 #endif
51 
52 /* struct needed to link items together
53  * @author Andreas Werner
54  */
55 template <class T>
57 {
58  // the data
59  T item;
60 
61  // pointer to previous and next element
63 
64  // constructor with given data element
65  coDLListElem(const T &data)
66  {
67  item = data;
68  prev = next = NULL;
69  }
70 };
71 
72 template <class T>
74 {
75 public:
76  virtual ~coDLListCompare()
77  {
78  }
79  virtual bool equal(const T &op1, const T &op2) const
80  {
81  return op1 == op2;
82  }
83 };
84 
85 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
86 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
87 // ++++++
88 // ++++++ class coDLList<T>
89 // ++++++
90 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
91 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
92 
100 template <class T>
101 class coDLList
102 {
104  friend class coDLListIter<T>;
105  friend class coDLListSafeIter<T>;
106 
107 protected:
108  // the this->head and this->tail of the list
110 
111  // number of items in list
113 
114  // for "safe" iterators
115  std::list<coDLListSafeIter<T> *> m_iterators;
116 
118  {
119  m_iterators.push_back(iter);
120  }
121 
123  {
124  if (m_iterators.empty())
125  return;
126  m_iterators.remove(iter);
127  }
128 
130  {
131  if (m_iterators.empty())
132  return;
133  typename std::list<coDLListSafeIter<T> *>::iterator iter;
134  LOGWARNING("Invalidating iterators !!! (%d iterators attached)", m_iterators.size());
135  for (iter = m_iterators.begin(); iter != m_iterators.end(); iter++)
136  {
137  (*iter)->d_actElem = NULL;
138  }
139  }
140 
142  {
143  if (m_iterators.empty())
144  return;
145  typename std::list<coDLListSafeIter<T> *>::iterator iter;
146  for (iter = m_iterators.begin(); iter != m_iterators.end(); iter++)
147  {
148  if ((*iter)->d_actElem == whichElem)
149  {
150  if (m_iterators.size() > 1) // no warning if there is only one iterator
151  {
152  LOGWARNING("Adjusting iterators in list 0x%x!", this);
153  }
154  (*iter)->backstep();
155  }
156  }
157  }
158 
159 public:
161  coDLList(void);
162 
164  virtual ~coDLList(void);
165 
166  // +++++++++++++ status query functions ++++++++++++++++++++++++++++++++++
167 
169  int num(void) const
170  {
171  return this->listItems;
172  }
173 
175  operator bool()
176  {
177  return (this->listItems != 0);
178  }
179 
180  // +++++++++++++ adding or removing items from the list ++++++++++++++++++
181 
183  virtual void remove(coDLListElem<T> *whichElem);
184 
186  coDLList<T> &append(const T &);
187 
188  // +++++++++++++ access list +++++++++++++++++++++++++++++++++++++++++++++
189 
191  T item(int); // USE BRACKET OPERATOR !!!!!
192 
194  T &operator[](int);
195 
197  const T &operator[](int) const;
198 
200  virtual void clean();
201 
202  // +++++++++++++ iterator routines ++++++++++++++++++++++++++++++++++++++
203 
206 
209 
211  coDLListIter<T> findElem(const T &);
212 
214  coDLListIter<T> findElem(const T &, const coDLListCompare<T> &comp);
215 
217  coDLListIter<T> findElem(int i);
218 
219  // +++++++++++++ access internal pointers ++++++++++++++++++++++++++++++++
220 
223  {
224  return this->head;
225  }
226 
229  {
230  return this->tail;
231  }
232 };
233 
234 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
235 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
236 // ++++++
237 // ++++++ class coDLPtrList<T> : public coDLList<T*>
238 // ++++++
239 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
240 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
241 
248 template <class T>
249 class coDLPtrList : public coDLList<T>
250 {
251 private:
253 
254  // 'current' element -> for old-style list access : only for Pointer Lists
256 
257  // NULL element : needed for old-style calls as "empty" return value
259 
260 public:
264  coDLPtrList(bool doDelete = true)
265  : coDLList<T>()
266  {
267  d_doDelete = doDelete;
268  d_nullElem = NULL;
269  curr = NULL;
270  }
271 
273  void setNullElem(const T &nullElem)
274  {
275  d_nullElem = nullElem;
276  }
277 
281  void setNoDelete(bool doDelete = false)
282  {
283  d_doDelete = doDelete;
284  }
285 
287  virtual void remove(coDLListElem<T> *whichElem);
288 
290  virtual void clean();
291 
293  virtual ~coDLPtrList()
294  {
295  coDLListElem<T> *elem = this->head;
296  while (elem)
297  {
298  coDLListElem<T> *nextElem;
299  nextElem = elem->next;
300  if (d_doDelete)
301  {
302  delete elem->item;
303  }
304  elem = nextElem;
305  }
306  };
307 
309  coDLPtrList<T> &append(const T &a);
310 
311  // +++++++++++++ obsolete old-time stuff - do not use ++++++++++++++++++++
312 
314  void remove()
315  {
316  LOGWARNING("coDLPtrList::remove(void) called in 0x%x ! This method is obsolete !!!", this);
317  if (curr)
318  {
319  coDLListElem<T> *oldCurr = curr;
320  curr = curr->next;
321  remove(oldCurr);
322  }
323  }
324 
326  T current(void);
327 
329  //T getLast(void);
330 
332  T get(void)
333  {
334  T retval = current();
335  next();
336  return retval;
337  }
338 
340  coDLPtrList<T> &set(int);
341 
345  int find(const T &);
346 
349  {
350  if (this->head)
351  curr = this->head;
352  else
353  curr = NULL;
354  return *this;
355  }
356 
359  {
360  if (curr)
361  curr = curr->next;
362  return *this;
363  }
364 
365  /***
367  coDLList<T>& prev(void)
368  {
369  if (curr)
370  curr = curr->prev;
371  return *this;
372  }
373 
375  coDLList<T>& clear(void)
376  {
377  curr = (coDLListElem<T> *)0;
378  return *this;
379  }
380 
382  int is_current(void)
383  {
384  return (curr != ((coDLListElem<T> *)0));
385  }
386  ***/
387 };
388 
389 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
390 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
391 // ++++++
392 // ++++++ class coDLListIter<T>
393 // ++++++
394 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
395 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
396 
404 template <class T>
405 class coDLListIter
406 {
407 protected:
408  // the list we are running on
410 
411  // my active element
413 
414  // this might be overridden by derived class for selective Iterators
415 
416  // advance pointer by one element
417  virtual void advance()
418  {
419  if (d_actElem)
420  d_actElem = d_actElem->next;
421  }
422 
423  // step back one step
424  virtual void backstep()
425  {
426  if (d_actElem)
427  d_actElem = d_actElem->prev;
428  }
429 
430  // forward to next valid element if current is not valid
431  virtual void nextValid(){};
432 
433  // forward to prev valid element if current is not valid
434  virtual void prevValid(){};
435 
436 public:
439  {
440  d_myList = NULL;
441  d_actElem = NULL;
442  }
443 
446  {
447  d_myList = &list;
448  d_actElem = list.head;
449  nextValid();
450  }
451 
454  {
455  d_myList = old.d_myList;
456  d_actElem = old.d_actElem;
457  nextValid();
458  return *this;
459  }
460 
463  {
464  d_myList = old.d_myList;
465  d_actElem = old.d_actElem;
466  nextValid();
467  }
468 
471  {
472  d_myList = &list;
473  d_actElem = actElem;
474  nextValid();
475  }
476 
478  virtual ~coDLListIter(){};
479 
481  operator bool()
482  {
483  return (d_actElem != NULL);
484  }
485 
487  void operator++()
488  {
489  advance();
490  }
491 
493  void operator++(int)
494  {
495  advance();
496  }
497 
499  void operator--()
500  {
501  backstep();
502  }
503 
505  void operator--(int)
506  {
507  backstep();
508  }
509 
512  {
513  T *res;
514  if (d_actElem)
515  res = &(d_actElem->item);
516  else
517  {
518  static T dummy;
519  res = &dummy;
520  LOGWARNING("!!!! Accessing dummy-elem with: T &coDLListIter<T>::operator(); !!!!");
521  }
522  return *res;
523  }
524 
527  {
528  T *res;
529  if (d_actElem)
530  res = &(d_actElem->item);
531  else
532  {
533  static T dummy;
534  res = &dummy;
535  LOGWARNING("!!!! Accessing dummy-elem with: T &coDLListIter<T>::operator*(); !!!!");
536  }
537  return *res;
538  }
539 
542  {
543  T *res;
544  if (d_actElem)
545  res = &(d_actElem->item);
546  else
547  {
548  static T dummy;
549  res = &dummy;
550  LOGWARNING("!!!! Accessing dummy-elem with: T coDLListIter<T>::operator->(); !!!!");
551  }
552  return *res;
553  }
554 
556  void setFirst()
557  {
558  if (d_myList)
559  {
560  d_actElem = d_myList->head;
561  nextValid();
562  }
563  }
564 
566  void setLast()
567  {
568  if (d_myList)
569  {
570  d_actElem = d_myList->tail;
571  prevValid();
572  }
573  }
574 
576  coDLListIter<T> &insertAfter(const T &newElem);
577 
579  coDLListIter<T> &insertBefore(const T &newElem);
580 
582  virtual void remove()
583  {
584  if (d_actElem)
585  {
586  coDLListElem<T> *newNext = d_actElem->next;
587  d_myList->remove(d_actElem);
588  d_actElem = newNext;
589  nextValid();
590  }
591  }
592 
594  void operator=(const T &elem)
595  {
596  if (d_myList)
597  {
598  d_actElem = d_myList->head;
599  nextValid();
600  while ((d_actElem) && !(d_actElem->item == elem))
601  advance();
602  }
603  }
604 
606  void operator=(int num)
607  {
608  if (d_myList)
609  {
610  d_actElem = d_myList->head;
611  nextValid();
612  while ((d_actElem) && (num))
613  {
614  advance();
615  num--;
616  }
617  }
618  }
619 };
620 
621 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
622 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
623 // ++++++
624 // ++++++ class coDLListSafeIter<T>
625 // ++++++
626 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
627 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
628 
629 template <class T>
630 class coDLListSafeIter : public coDLListIter<T>
631 {
632  friend class coDLList<T>;
633 
634 public:
637  : coDLListIter<T>()
638  {
639  }
640 
643  : coDLListIter<T>(list)
644  {
645  this->d_myList->addIter(this);
646  }
647 
650  {
651  this->d_myList = old.d_myList;
652  this->d_actElem = old.d_actElem;
653  this->nextValid();
654  this->d_myList->addIter(this);
655  return *this;
656  }
657 
660  : coDLListIter<T>(old)
661  {
662  //this->d_myList = old.d_myList;
663  //this->d_actElem = old.d_actElem;
664  //this->nextValid();
665  this->d_myList->addIter(this);
666  }
667 
670  {
671  this->d_myList = &list;
672  this->d_actElem = actElem;
673  this->nextValid();
674  this->d_myList->addIter(this);
675  }
676 
679  {
680  this->d_myList->removeIter(this);
681  }
682 
684  virtual void remove()
685  {
686  if (this->d_actElem)
687  {
688  this->d_myList->remove(this->d_actElem);
689  this->nextValid();
690  }
691  }
692 };
693 
694 // -------------- End coDLListSafeIter ------------------------------
695 
696 //==========================================================================
697 // INLINE implementation of coDLList member functions
698 //==========================================================================
699 
700 template <class T>
702 {
703  return coDLListIter<T>(*this, this->head);
704 }
705 
706 template <class T>
708 {
709  return coDLListIter<T>(*this, this->tail);
710 }
711 
712 template <class T>
714 {
715  this->head = this->tail = NULL;
716  this->listItems = 0;
717 }
718 
719 template <class T>
721 {
722  coDLListIter<T> iter(*this, this->head);
723  while ((iter) && !((*iter) == searchItem))
724  {
725  iter++;
726  }
727  return iter;
728 }
729 
730 template <class T>
732  const coDLListCompare<T> &comp)
733 {
734  coDLListIter<T> iter(*this, this->head);
735  while ((iter) && !comp.equal((*iter), searchItem))
736  {
737  iter++;
738  }
739  return iter;
740 }
741 
742 template <class T>
744 {
745  coDLListIter<T> iter(*this, this->head);
746  while ((iter) && (idx))
747  {
748  iter++;
749  idx--;
750  }
751  return iter;
752 }
753 
754 //==========================================================================
755 // Destructor: cleanup everything, but NO things pointered on
756 //==========================================================================
757 template <class T>
759 {
760  clean();
761 }
762 
763 //==========================================================================
764 // Cleanup: cleanup everything, but NO things pointered on
765 //==========================================================================
766 template <class T>
768 {
769  coDLListElem<T> *curr = this->head;
770  while (curr)
771  {
772  this->head = curr;
773  curr = curr->next;
774  delete this->head;
775  }
776  this->head = this->tail = curr = NULL;
777  this->listItems = 0;
778  invalidateIterators();
779 }
780 
781 //==========================================================================
782 // Cleanup: cleanup everything, dependend on d_doDelete delete things pointered on
783 //==========================================================================
784 template <class T>
786 {
787  coDLListElem<T> *cur = this->head;
788  while (cur)
789  {
790  this->head = cur;
791  cur = cur->next;
792  if (d_doDelete)
793  delete this->head->item;
794  delete this->head;
795  }
796  this->head = this->tail = cur = NULL;
797  this->listItems = 0;
798  this->invalidateIterators();
799 }
800 
801 //==========================================================================
802 // add new item to end of list
803 //==========================================================================
804 template <class T>
806 {
807  coDLListElem<T> *newlink = new coDLListElem<T>(a);
808  newlink->next = NULL;
809  newlink->prev = this->tail;
810  this->tail = newlink;
811  if (newlink->prev)
812  (newlink->prev)->next = newlink;
813  else
814  this->head = newlink;
815  this->listItems++;
816  return *this;
817 }
818 
819 //==========================================================================
820 // add new item to end of list
821 //==========================================================================
822 template <class T>
824 {
825  coDLListElem<T> *newlink = new coDLListElem<T>(a);
826  newlink->next = NULL;
827  newlink->prev = this->tail;
828  this->tail = newlink;
829  if (newlink->prev)
830  (newlink->prev)->next = newlink;
831  else
832  this->head = curr = newlink;
833  this->listItems++;
834  return *this;
835 }
836 
837 //==========================================================================
838 // remove specific item from list
839 //==========================================================================
840 template <class T>
842 {
843  if (removeElem)
844  {
845  this->correctIteratorsFor(removeElem);
846  if (removeElem->prev)
847  (removeElem->prev)->next = removeElem->next;
848  if (removeElem->next)
849  (removeElem->next)->prev = removeElem->prev;
850  if (this->head == removeElem)
851  this->head = removeElem->next;
852  if (this->tail == removeElem)
853  this->tail = removeElem->prev;
854  delete removeElem;
855  this->listItems--;
856  }
857 }
858 
859 //==========================================================================
860 // remove specific item from list : PTR version
861 //==========================================================================
862 template <class T>
864 {
865  if (removeElem)
866  {
867  this->correctIteratorsFor(removeElem);
868  if (d_doDelete)
869  delete removeElem->item;
870  if (removeElem->prev)
871  (removeElem->prev)->next = removeElem->next;
872  if (removeElem->next)
873  (removeElem->next)->prev = removeElem->prev;
874  if (this->head == removeElem)
875  this->head = removeElem->next;
876  if (this->tail == removeElem)
877  this->tail = removeElem->prev;
878  delete removeElem;
879  this->listItems--;
880  }
881 }
882 
883 //==========================================================================
884 // return the Nth item; do not change current item position : CONST
885 //==========================================================================
886 template <class T>
887 INLINE const T &coDLList<T>::operator[](int n) const
888 {
889  coDLListElem<T> *link = this->head;
890  while (link && n > 0)
891  {
892  link = link->next;
893  n--;
894  }
895  if (link && n == 0)
896  return link->item;
897  else
898  return this->head->item; // problem if NO items in list
899 }
900 
901 //==========================================================================
902 // return the Nth item; do not change current item position
903 //==========================================================================
904 template <class T>
906 {
907  coDLListElem<T> *link = this->head;
908  while (link && n > 0)
909  {
910  link = link->next;
911  n--;
912  }
913  if (link && n == 0)
914  return link->item;
915  else
916  return this->head->item; // problem if NO items in list
917 }
918 
919 //==========================================================================
920 // return the Nth item; do not change current item position
921 //==========================================================================
922 template <class T>
924 {
925  coDLListElem<T> *link = this->head;
926  while (link && n > 0)
927  {
928  link = link->next;
929  n--;
930  }
931  if (link && n == 0)
932  return link->item;
933  else
934  return this->head->item; // problem if NO items in list
935 }
936 
937 //==========================================================================
938 // just return the current item, do not change which item is current
939 //==========================================================================
940 template <class T>
942 {
943  coDLListElem<T> *link = curr;
944  if (!link)
945  {
946  reset();
947  return d_nullElem;
948  }
949  return link->item;
950 }
951 
952 //==========================================================================
953 // just return the current item, do not change which item is current
954 //==========================================================================
955 //template<class T>
956 //INLINE T coDLList<T>::getLast(void)
957 //{
958 // coDLListElem<T> *link = this->tail;
959 // if(!link) {
960 // reset();
961 // return(NULL);
962 // }
963 // return link->item;
964 //}
965 
966 //==========================================================================
967 // move the current item pointer to the Nth item
968 //==========================================================================
969 template <class T>
971 {
972  reset();
973  for (int i = 0; i < N; i++)
974  next();
975  return *this;
976 }
977 
978 //==========================================================================
979 // move the current item pointer to the item which matches the given one
980 // return TRUE if found, or FALSE otherwise
981 //==========================================================================
982 template <class T>
984 {
985  reset();
986  while (curr && !(curr->item == a))
987  next();
988  return (curr != NULL);
989 }
990 
991 // +++++++++++++++++ coDLListIter ++++++++++++++++++++++++++++++++++++++++++
992 
993 //==========================================================================
994 // append new item after the current item : Iterator version
995 //==========================================================================
996 template <class T>
998 {
999  if (d_actElem)
1000  { // yes, there is a current item
1001  coDLListElem<T> *newlink = new coDLListElem<T>(a);
1002  newlink->next = d_actElem->next;
1003  newlink->prev = d_actElem;
1004  d_actElem->next = newlink;
1005  if (newlink->next == NULL)
1006  d_myList->tail = newlink;
1007  else
1008  newlink->next->prev = newlink;
1009  d_myList->listItems++;
1010  }
1011  else // no current item; just append at end
1012  d_myList->append(a);
1013 
1014  return *this;
1015 }
1016 
1017 //==========================================================================
1018 // append new item before the current item : Iterator version
1019 //==========================================================================
1020 template <class T>
1022 {
1023  if (d_actElem)
1024  { // yes, there is a current item
1025  coDLListElem<T> *newlink = new coDLListElem<T>(a);
1026  newlink->next = d_actElem;
1027  newlink->prev = d_actElem->prev;
1028  d_actElem->prev = newlink;
1029  if (newlink->prev == NULL)
1030  d_myList->head = newlink;
1031  else
1032  newlink->prev->next = newlink;
1033  d_myList->listItems++;
1034  }
1035  else // no current item; just append at end
1036  d_myList->append(a);
1037 
1038  return *this;
1039 }
1040 }
1041 #endif //YAC_LINK_LIST_H
void setLast()
set to last element
Definition: coDLList.h:566
coDLListIter< T > & insertBefore(const T &newElem)
add new element after my position
Definition: coDLList.h:1021
virtual void clean()
cleanup everything
Definition: coDLList.h:785
virtual ~coDLList(void)
destructor : virtual for all derived classes
Definition: coDLList.h:758
void addIter(coDLListSafeIter< T > *iter)
Definition: coDLList.h:117
#define LOGWARNING
Definition: coErr.h:138
coDLPtrList< T > & set(int)
move the current to the Nth item: obsolete, use iterators
Definition: coDLList.h:970
void operator++(int)
go to next element : iter++
Definition: coDLList.h:493
coDLPtrList(bool doDelete=true)
Definition: coDLList.h:264
static Repl dummy("","")
virtual void remove(coDLListElem< T > *whichElem)
remove specific item from list : virtual for coDLPtrList
Definition: coDLList.h:841
coDLListIter< T > findElem(const T &)
get an Iterator placed to specific element
Definition: coDLList.h:720
coDLListIter< T > & insertAfter(const T &newElem)
add new element after my position
Definition: coDLList.h:997
coDLList< T > & append(const T &)
add new item to end of list
Definition: coDLList.h:805
GLdouble n
Definition: khronos-glext.h:8447
int find(const T &)
Definition: coDLList.h:983
virtual bool equal(const T &op1, const T &op2) const
Definition: coDLList.h:79
coDLListElem< T > * next
Definition: coDLList.h:62
void operator=(const T &elem)
set to specific element
Definition: coDLList.h:594
coDLPtrList< T > & append(const T &a)
append an element
Definition: coDLList.h:823
void operator--(int)
go to previous element : iter–
Definition: coDLList.h:505
void removeIter(coDLListSafeIter< T > *iter)
Definition: coDLList.h:122
GLuint res
Definition: khronos-glext.h:10588
Definition: coDLList.h:46
GLboolean reset
Definition: khronos-glext.h:6369
Definition: coDLList.h:56
#define NULL
Definition: covise_list.h:22
void operator++()
go to next element : ++iter
Definition: coDLList.h:487
virtual ~coDLListIter()
Destructor.
Definition: coDLList.h:478
coDLListElem< T > * d_actElem
Definition: coDLList.h:412
coDLListElem< T > * prev
Definition: coDLList.h:62
virtual void advance()
Definition: coDLList.h:417
coDLListElem< T > * getHeadStruct()
get the head ot the chain: primarily used for defining own iterators
Definition: coDLList.h:222
coDLListIter< T > last()
get an Iterator placed on the last element
Definition: coDLList.h:707
void invalidateIterators(void)
Definition: coDLList.h:129
coDLListElem< T > * head
Definition: coDLList.h:109
virtual void backstep()
Definition: coDLList.h:424
void setFirst()
set to first element
Definition: coDLList.h:556
virtual ~coDLListCompare()
Definition: coDLList.h:76
coDLListElem< T > * tail
Definition: coDLList.h:109
T item(int)
return the Nth item: prefer usage of [] or iterator
Definition: coDLList.h:923
virtual void clean()
cleanuop everything
Definition: coDLList.h:767
coDLList< T > * d_myList
Definition: coDLList.h:409
void correctIteratorsFor(coDLListElem< T > *whichElem)
Definition: coDLList.h:141
virtual ~coDLListSafeIter()
Destructor.
Definition: coDLList.h:678
coDLList< T > & next(void)
move the current to next item in list: obsolete, use iterators
Definition: coDLList.h:358
Definition: coDLList.h:43
int num(void) const
number of items in this list
Definition: coDLList.h:169
virtual void prevValid()
Definition: coDLList.h:434
Definition: coDLList.h:73
void operator=(int num)
set to element # if existent
Definition: coDLList.h:606
void setNullElem(const T &nullElem)
set the return value for &#39;current&#39; in case of NO-return
Definition: coDLList.h:273
GLboolean GLboolean GLboolean GLboolean a
Definition: khronos-glext.h:6895
std::list< coDLListSafeIter< T > * > m_iterators
Definition: coDLList.h:115
typedef void(APIENTRY *GLDEBUGPROCARB)(GLenum source
virtual ~coDLPtrList()
destructor: delete elements if doDelete=true
Definition: coDLList.h:293
coDLList(void)
constructor: construct empty list
Definition: coDLList.h:713
coDLListElem< T > * curr
Definition: coDLList.h:255
int listItems
Definition: coDLList.h:112
T & operator[](int)
return the Nth item
Definition: coDLList.h:905
T & operator*()
access object with (*iter)
Definition: coDLList.h:526
coDLListElem< T > * getTailStruct()
get the tail ot the chain: primarily used for defining own iterators
Definition: coDLList.h:228
void setNoDelete(bool doDelete=false)
Definition: coDLList.h:281
coDLListSafeIter< T > & operator=(const coDLListSafeIter< T > &old)
standard assignment operator
Definition: coDLList.h:649
T d_nullElem
Definition: coDLList.h:258
#define INLINE
Definition: coDLList.h:49
T current(void)
access &#39;current&#39; item: obsolete, use iterators
Definition: coDLList.h:941
coDLListElem(const T &data)
Definition: coDLList.h:65
Definition: coDLList.h:101
coDLList< T > & reset(void)
reset current to the beginning of the list: obsolete, use iterators
Definition: coDLList.h:348
T operator->()
access object with iter-&gt;something: only if T is a pointer
Definition: coDLList.h:541
GLuint GLuint num
Definition: khronos-glext.h:10593
T item
Definition: coDLList.h:59
void remove()
remove current item from list: obsolete, use iterators
Definition: coDLList.h:314
void operator--()
go to previous element : –iter
Definition: coDLList.h:499
GLsizei GLsizei GLenum GLenum const GLvoid * data
Definition: khronos-glext.h:6354
Definition: coDLList.h:249
bool d_doDelete
Definition: coDLList.h:252
T & operator()()
access object with iter(): if (iter)=false: whatever might be in
Definition: coDLList.h:511
coDLListIter< T > first()
get an Iterator placed on the first element
Definition: coDLList.h:701
coDLListIter< T > & operator=(const coDLListIter< T > &old)
standard assignment operator
Definition: coDLList.h:453
virtual void nextValid()
Definition: coDLList.h:431