#ifndef BOUNDED_STACK_B_H #define BOUNDED_STACK_B_H #include "BoundedStack.h" class BoundedStackB : public BoundedStack { public: /** * Constructor with specified max capacity * (parameter is optional, so this also serves as default constructor) */ BoundedStackB(int cap = CAPACITY); /** * Destructor */ ~BoundedStackB(); /** * Returns number of objects in the history. */ size_t size() const; /** * Returns true if the history is empty, false otherwise. */ bool empty() const; /** * Returns constant reference to the top object in the history. * Throws BoundedStackEmptyException if the history is empty. */ const string& top() const throw(BoundedStackEmptyException); /** * Inserts an object at the top of the history. */ void push(const string& obj); /** * Removes the top object from the history. * Throws BoundedStackEmptyException if the history is empty. */ void 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