// StackType.h: in StackTypeLink
// Class is templated.  Linked list used for implementation.

//Notice that the interface to our stack classes are all the same.

//forward reference to NodeType, so compiler doesn't panic when it sees
//Nodetype topPtr.  Will be specified later in implementation file.
//DFW. Note: not needed!  we could put the definition of NodeType
//right here.  but the book is doing it this way...

template <class ItemType>
struct NodeType;

//**********************************************



template<class ItemType>
class StackType
{
public:
    StackType();
    //a constructor with a "size" argument wouldn't make sense for this 
    //linked list implementation.

    ~StackType();

    void MakeEmpty();

    bool IsFull() const;

    bool IsEmpty() const;

    void Push(ItemType item);

    void Pop(ItemType& item);

private:
    //note no top variable.
    NodeType<ItemType>* topPtr;
    //will point to first node of linked list (i.e. top of stack), 
    //or to Null if empty list.
};


#include "StackType.cpp"
