// ********************************************************* // Header file ListT.h for the ADT list. // Pointer-based implementation -- TEMPLATE VERSION // ********************************************************* #include template struct listNode; // defined in ListT.cpp template class listClass { public: // constructors and destructor: listClass(); listClass(const listClass& L); virtual ~listClass(); // list operations: virtual bool ListIsEmpty() const; virtual int ListLength() const; virtual void ListInsert(int NewPosition, NewItem, bool& Success); virtual void ListDelete(int Position, bool& Success); virtual void ListRetrieve(int Position, & DataItem, bool& Success) const; virtual void DisplayList() const; protected: void SetSize(int NewSize); listNode* ListHead() const; void SetHead(listNode* NewHead); T ListItem(listNode* P) const; listNode* ListNext(listNode* P) const; private: int Size; listNode* Head; listNode* PtrTo(int Position) const; }; // end class #include "ListT.cpp" // include the implementation file // End of header file.