filters
listelement.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __KWORD_LISTELEMENT_H__
00024 #define __KWORD_LISTELEMENT_H__
00025
00026 #include "element.h"
00027
00028 class ListElement
00029 {
00030 Element *_start, *_end;
00031 int _size;
00032
00033 public:
00034 ListElement();
00035 virtual ~ListElement();
00036
00037 void initialiser(Element*);
00038 void add(Element*);
00039 Element* getFirst() const { return _start; }
00040 Element* getLast() const { return _end; }
00041 int getSize() const { return _size; }
00042
00043 private:
00044 };
00045
00046 class ElementIter {
00047 Element *_courant;
00048
00049 protected:
00050
00051 public:
00056
00057 ElementIter() { _courant = 0; }
00059 ElementIter(ListElement &l) { _courant = l.getFirst(); }
00061 ElementIter(ListElement *l) {
00062 if(l != 0)
00063 _courant = l->getFirst();
00064 else
00065 _courant = 0;
00066 }
00068
00073
00074 virtual ~ElementIter() { }
00076
00081
00082 Element* getCourant() const { return _courant; }
00083 bool isTerminate() const { return (_courant == 0); }
00085
00090 void next() { _courant = _courant->getNext(); }
00091 void setList(ListElement *l) { _courant = l->getFirst(); }
00092 void setList(ListElement l) { _courant = l.getFirst(); }
00094
00099
00100
00104
00106
00107 };
00108 #endif
|