//This is the header file queue.h. This is the interface for the class Queue, //which is a template class for a queue of items of type T. #ifndef QUEUE_H #define QUEUE_H namespace QueueSavitch { template class Node { public: Node(T theData, Node* theLink) : data(theData), link(theLink){} Node* getLink( ) const { return link; } const T getData( ) const { return data; } void setData(const T& theData) { data = theData; } void setLink(Node* pointer) { link = pointer; } private: T data; Node *link; }; template class Queue { public: Queue( ); //Initializes the object to an empty queue. Queue(const Queue& aQueue); Queue& operator =(const Queue& rightSide); virtual ~Queue( ); void add(T item); //Postcondition: item has been added to the back of the queue. T remove( ); //Precondition: The queue is not empty. //Returns the item at the front of the queue //and removes that item from the queue. bool isEmpty( ) const; //Returns true if the queue is empty. Returns false otherwise. private: Node *front;//Points to the head of a linked list. //Items are removed at the head Node *back;//Points to the node at the other end of the linked list. //Items are added at this end. }; }//QueueSavitch #endif //QUEUE_H