#ifndef _QUEUEAR_H_ #define _QUEUEAR_H_ #include using namespace std; #include "Except1.h" // Queue class -- array implementation // // CONSTRUCTION: with no parameters // // ******************PUBLIC OPERATIONS********************* // void enqueue( x ) --> Insert x // void dequeue( ) --> Return and remove least recent item // Object getFront( ) --> Return least recently inserted item // bool isEmpty( ) --> Return true if empty; else false // void makeEmpty( ) --> Remove all items // ******************ERRORS******************************** // UnderflowException thrown as needed template class Queue { public: Queue( ); bool isEmpty( ) const; const Object & getFront( ) const; void makeEmpty( ); Object dequeue( ); void enqueue( const Object & x ); private: vector theArray; int currentSize; int front; int back; void increment( int & x ) const; void doubleQueue( ); }; #endif