#ifndef LAB3LIST_H #define LAB3LIST_H #include using namespace std; // What type our list is holding. Most elegantly this would be // done using templates, but for the purposes of this exercise that // is slightly overkill and just tends to create such nasty error // messages that I won't subject you all to that. typedef int val_t; /***************************************************************** * Predeclarations *****************************************************************/ // Predeclare that we will be defining a class ADTList class ADTList; /***************************************************************** * Interfaces *****************************************************************/ // The interface for the Abstract Data Type List. class ADTList { public: virtual ~ADTList() { } // Insert val in position pos. Pos = 0 implies "insert at head", // pos = size() implies "insert at tail" virtual void insert(val_t val, unsigned int pos) = 0; // Remove the element in position pos virtual void remove(unsigned int pos) = 0; // Return the element in position pos virtual val_t retrieve(unsigned int pos) = 0; // Is there anything in this list? virtual bool isEmpty() = 0; // How much is there in this list? virtual unsigned int size() = 0; }; #endif // LAB3LIST_H