/**** * * Class IntList specializes class List, defined in list.h. Each List selector * is specialized to return IntListElem's instead of plain ListElem's. This * avoids the need to use casts in outside calling functions. This is the * recommended specialization for subclasses of List and ListElem. * */ #ifndef intlistIncluded #define intlistIncluded #include "list.h" class IntListElem; class IntList : public List { public: IntListElem* Pull(); IntListElem* Pop(); IntListElem* GetNth(int n); IntListElem* RemoveNth(int n); IntListElem* Find(int k); int FindPos(int k); IntListElem* Enum(); }; /* * IntListElem is the recommended specialization of ListElem. */ class IntListElem : public ListElem { public: IntListElem(int initval); virtual ~IntListElem(); int GetData(); int Compare(ListElem* e); virtual int Compare(ListElemKey* k); ListElemKey* GetKey(); void Print(); protected: int data; }; #endif