#ifndef BOUNDED_STACK_A_H #define BOUNDED_STACK_A_H #include "BoundedStack.h" class BoundedStackA : public BoundedStack { public: /** * Constructor with specified max capacity * (parameter is optional, so this also serves as default constructor) */ BoundedStackA(int cap = CAPACITY); /** * Destructor */ ~BoundedStackA(); /** * Returns number of objects in the history. */ int size() const; /** * Returns true if the history is empty, false otherwise. */ bool isEmpty() const; /** * Returns reference to the top object in the history. * Throws BoundedStackEmptyException if the history is empty. */ string& top() throw(BoundedStackEmptyException); /** * Inserts an object at the top of the history. */ void push(const string& obj); /** * Removes and returns the top object from the history. * Throws BoundedStackEmptyException if the history is empty. */ string pop() throw(BoundedStackEmptyException); private: /** * Default length of the array used to implement the history. */ enum { CAPACITY=1000 }; // Feel free to add whatever additional data or functions that you wish. }; #endif