// *********************************************************
// Header file StackP.h for the ADT stack.
// Pointer-based implementation.
// *********************************************************
#include "StackException.h"
typedef desired-type-of-stack-item StackItemType;

class Stack
{
public:
// constructors and destructor:
   Stack();                     // default constructor
   Stack(const Stack& aStack);  // copy constructor
   ~Stack();                    // destructor

// stack operations:
   bool isEmpty() const;
   void push(StackItemType newItem);
   void pop() throw(StackException);
   void pop(StackItemType& stackTop) throw(StackException);
   void getTop(StackItemType& stackTop) const
                                   throw(StackException);

private:
   struct StackNode              // a node on the stack
   {
      StackItemType item;        // a data item on the stack
      StackNode    *next;       // pointer to next node
   };  // end struct

   StackNode *topPtr; // pointer to first node in the stack
};  // end Stack class
// End of header file.