/* $Id: stack.h,v 1.3 1996/11/06 11:37:49 roitzsch Exp $ */

#ifndef STACK_TEMPLATE_H
#define STACK_TEMPLATE_H

#include "kvector.h"

#define AnnounceExtensionFlag 0

const int DefaultSize=25;


template<class T> 

class Stack : public Vector<T>
{
  public:

    int top;

    Stack(int l1, int top1, int h1); 
    Stack(int l1, int top1);
    Stack(int top1);
    Stack();
    virtual ~Stack() { }

    void push(const T a);
    T pop();
    T Prev() const;

    virtual T Top()  const;

    int empty() const { return this->h < this->l; }

    virtual void resize(int newTop);
    virtual void resize(int newl, int newTop);
    virtual void resize(int newl, int newTop, int newh);

  private:
    void  extend();

    Stack(Stack<T>& st); 				// disallowed!
    // Stack& operator= (Stack<T>& stck);	
    // Stack& operator= (T a);		
};
// ----------------------------------------------------------------------------

#if INCLUDE_TEMPLATE_DEFS
#include "stack.c"
#endif

#endif


syntax highlighted by Code2HTML, v. 0.9.1