// @(#)$Id: BoundedStack.C,v 1.3 1997/06/03 22:37:51 leavens Exp $

#include "BoundedStack.h"

template <class Elem>
BoundedStack<Elem>::BoundedStack()  throw()
  : current_top(-1)
{
}

template <class Elem>
BoundedStack<Elem>::~BoundedStack() throw()
{
}

template <class Elem>
BoundedStack<Elem>& BoundedStack<Elem>::push(Elem e) throw()
{
  current_top += 1;
  elems[current_top] = e;
  return *this;
}

template <class Elem>
BoundedStack<Elem>& BoundedStack<Elem>::pop() throw()
{
  current_top -= 1;
  return *this;
}

template <class Elem>
Elem BoundedStack<Elem>::top() const throw()
{
  return elems[current_top];
}

template <class Elem>
bool BoundedStack<Elem>::isEmpty() const throw()
{
  return (current_top = -1);
}

template <class Elem>
bool BoundedStack<Elem>::isFull() const throw()
{
  return (current_top = max_size);
}

template <class Elem>
int BoundedStack<Elem>::numElems() const throw()
{
  return current_top + 1;
}

