#ifndef __LIST_HPP #define __LIST_HPP template class aList { aList& operator=(const aList& l) { return *this; } // don't copy protected: struct aListElement { T elem; aListElement *prev, *next; }; aListElement *listhead; virtual int check(const T e) const { return 1; } public: aList(); virtual ~aList(); void append(T e); void prepend(T e); void insertAt(T e, int pos); void clear(); int empty() const; void remove(T e); int count() const; friend class aListAccessor; }; template class aSingleList : public aList { protected: virtual int check(const T e) const; virtual int compareItems(const T& e1, const T& e2) const =0; public: aSingleList() : aList() {} virtual ~aSingleList() {}; }; template class aListAccessor { aList *theList; aList::aListElement *current; public: aListAccessor(aList& l); aListAccessor(aList* l); virtual ~aListAccessor(); void first(); void last(); T get(); int next(); int prev(); void deletecurrent(); T removecurrent(); void insertbefore(T e); }; #endif