00001 00005 class DpList(Type,Itemtype) 00006 00007 { 00008 protected: 00009 Itemtype(Type)* head; 00010 Itemtype(Type)* tail; 00011 Itemtype(Type)* current; 00012 00013 public: 00014 static long nitems_alloc; 00015 static long nitems_dealloc; 00016 00017 public: 00018 DpList(Type,Itemtype) () { head=0; tail=0; } 00019 virtual ~DpList(Type,Itemtype) () { remove(); } 00020 00021 DpList(Type,Itemtype) (const DpList(Type,Itemtype)& list_); 00022 void operator = (const DpList(Type,Itemtype)& list_); 00023 00024 DpList(Type,Itemtype)& insert (const Type& object); 00025 DpList(Type,Itemtype)& append (const Type& object); 00026 void remove (); 00027 void removeCurr (); 00028 00029 Type* start(); 00030 Type* end(); 00031 Type* next(); 00032 Type* prev(); 00033 Type* curr(); 00034 00035 Type* start() const {return CAST_CONST_AWAY(DpList(Type,Itemtype)))->start(;} 00036 Type* end() const {return CAST_CONST_AWAY(DpList(Type,Itemtype)))->end(; } 00037 Type* next() const {return CAST_CONST_AWAY(DpList(Type,Itemtype)))->next(; } 00038 Type* prev() const {return CAST_CONST_AWAY(DpList(Type,Itemtype)))->prev(; } 00039 Type* curr() const {return CAST_CONST_AWAY(DpList(Type,Itemtype)))->curr(; } 00040 00041 int size () const; 00042 int getNoEntries () const; 00043 Type* operator () (int i); 00044 const Type* operator () (int i) const; 00045 00046 bool memberAdr (const Type& object); 00047 void removeAdr (const Type& object); 00048 00049 #ifndef PRIMITIVE_LISTITEM 00050 void sort (); 00051 void insertSorted(DpList(Type,Itemtype)& list_); 00052 00053 void remove (const Type& object); 00054 bool member (const Type& object); 00055 void print (Os os); 00056 bool convert2vector (VecSimplest(Type)& vec); 00057 #endif 00058 00059 protected: 00060 void remove (Itemtype(Type)* pt); 00061 00062 #ifndef PRIMITIVE_LISTITEM 00063 void moveInFront(Itemtype(Type)* item1, Itemtype(Type)* item2 ); 00064 void insertInFront(const Type& obj, Itemtype(Type)* pt); 00065 #endif 00066 00067 }; 00068 00069