text cover

Data Abstraction and Problem Solving with C++

Walls and Mirrors

by Frank M. Carrano

Addison Wesley Logo

StackA.h

Go to the documentation of this file.
00001 
00017 #include "StackException.h"
00018 const int MAX_STACK = maximum-size-of-stack;
00019 typedef desired-type-of-stack-item StackItemType;
00020 
00023 class Stack
00024 {
00025 public:
00026 // constructors and destructor:
00028    Stack();
00029    // copy constructor and destructor are
00030    // supplied by the compiler
00031 
00032 // stack operations:
00038    bool isEmpty() const;
00039 
00047    void push(const StackItemType& newItem) throw(StackException);
00048 
00055    void pop() throw(StackException);
00056 
00064    void pop(StackItemType& stackTop) throw(StackException);
00065 
00073    void getTop(StackItemType& stackTop) const
00074       throw(StackException);
00075 
00076 private:
00078    StackItemType items[MAX_STACK];
00080    int           top;
00081 }; // end Stack
00082 // End of header file.

Generated on Sun Aug 27 16:41:10 2006 for AWLogo by  doxygen 1.4.6