/* * Author: Dr. Ricardo Morales * * -- AbstractQueue * An abstact class that defines the basic operations of a * Queue Data Structure * * For Homework #6, your Queue implementation should derive * this class. * */ #ifndef ABSTRACTQUEUE_H #define ABSTRACTQUEUE_H template < typename T > class AbstractQueue { public: // Purpose: clears the queue // Postconditions: the queue is now empty virtual void clear() = 0; // Purpose: enqueue an element into the queue // Parameters: x is the item to add to the queue // Postconditions: x is now the element at the end of the queue, virtual void enqueue(T x) = 0; // Purpose: dequeues // Postconditions: the element formerly at the front of the queue has // been removed virtual void dequeue() = 0; // Purpose: looks at the front of the queue // Returns: a reference to the element currently in front of the queue // Panic: if the queue is currently empty, PANIC! virtual const T& front() const = 0; // Purpose: Checks if a queue is empty // Returns: 'true' if the queue is empty // 'false' otherwise virtual bool isEmpty() const = 0; }; #endif