//-*-c++-*- #ifndef SIMPLE_STACK_HH #define SIMPLE_STACK_HH // Copyright (c) 1994,1995 Ohio Board of Regents and the University of // Cincinnati. All Rights Reserved. // // Author: Dale Martin (dmartin@thor.ece.uc.edu) // Name: SimpleStack.hh // Description: Header file for a simple stack template // // $Id: SimpleStack.hh,v 1.1.1.1 2007/03/15 15:45:06 rmadhoun Exp $ // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Library General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Library General Public License for more details. // // You should have received a copy of the GNU Library General Public // License along with this library; if not, write to the Free // Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //--------------------------------------------------------------------------- static const char* simple_stack_hh_rcsid = "$Id: SimpleStack.hh,v 1.1.1.1 2007/03/15 15:45:06 rmadhoun Exp $"; template < class Element > struct Container { Container(){}; ~Container(){}; Container< Element >* next; Element data; Container( Element & element ) : data(element){}; }; template < class Element > class SimpleStack { public: SimpleStack(); ~SimpleStack(); Element pop( ); void push(Element); private: Container< Element > * handle; static Container< Element > * freeList; }; #include "SimpleStack.cc" #endif