// File:        stack.hpp
// ------------------------------------------------------------------
// Author:      <your name>, <your e-mail address>
// TF:          <your TF's name>
// Date:        <current date>
// Assignment:  Unit 8 easy supplementary exercises
// Vesrion:     1
//
// Description:
//      Definition and implementation of a generic, link list-based 
//      stack class.
//

#ifndef STACK_HPP
#define STACK_HPP

#include <assert.h>
#include "s111unx.hpp"


template <class elt>
class stack {
    private:
        // TODO - fill this in

    public:
        stack();
        stack(int max);
        ~stack();

        void set_max(int max);
        void reinit();

        // Pushes item from source to stack, returning false if stack was full.
        bool push(elt source);

        // Pops top item into target, returning false if stack was empty. 
        bool pop(elt& target);

        elt& peek();
        void traverse(void (*action)(int, elt));

        bool empty() 
        {
            // TODO - implement this
        }
        
        bool full()  
        { 
            // TODO - implement this
        }
};


//
// Default constructor
//
template <class elt>
stack<elt>::stack()
{
    // TODO - implement this
}

//
// Constructor that takes the maximum number of items
//
template <class elt>
stack<elt>::stack(int max)
{
    // TODO - implement this
}

//
// Destructor
//
template <class elt>
stack<elt>::~stack()
{
    // TODO - implement this
}

//
// set_max - (re)initialize the stack to the specified maximum size
//
template <class elt>
void
stack<elt>::set_max(int max)
{
    // TODO - implement this
}

//
// reinit - returns to an empty stack
//
template <class elt>
void
stack<elt>::reinit()
{
    // TODO - implement this
}

//
// push - pushes item from source to top of stack, returning false
// if stack is full.
//
template <class elt>
bool
stack<elt>::push(elt source)
{
    // TODO - implement this
}

//
// pop - pops top item into target, returning false if stack is empty
//
template <class elt>
bool
stack<elt>::pop(elt& target)
{
    // TODO - implement this
}

//
// peek - returns a reference to the top item without removing it
//
template <class elt>
elt&
stack<elt>::peek()
{
    // TODO - implement this
}

//
// traverse - traverses stack from bottom to top, applying
// specified function to each element in the stack.
//
template <class elt>
void
stack<elt>::traverse(void (*action)(int, elt))
{
    // TODO - implement this
}

#endif
