home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / octave-1.1.1p1-base.tgz / octave-1.1.1p1-base.tar / fsf / octave / src / SLStack.h < prev    next >
C/C++ Source or Header  |  1995-01-03  |  2KB  |  79 lines

  1. // SLStack.h                                              -*- C++ -*-
  2. /*
  3.  
  4. Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton
  5.  
  6. This file is part of Octave.
  7.  
  8. Octave is free software; you can redistribute it and/or modify it
  9. under the terms of the GNU General Public License as published by the
  10. Free Software Foundation; either version 2, or (at your option) any
  11. later version.
  12.  
  13. Octave is distributed in the hope that it will be useful, but WITHOUT
  14. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  15. FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  16. for more details.
  17.  
  18. You should have received a copy of the GNU General Public License
  19. along with Octave; see the file COPYING.  If not, write to the Free
  20. Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  
  22. */
  23.  
  24. /*
  25.  
  26. The classes in this file are derived from the old `genclass' version
  27. of SLStack from libg++, originally:
  28.  
  29.   Copyright (C) 1988 Free Software Foundation
  30.     written by Doug Lea (dl@rocky.oswego.edu)
  31.  
  32. and distributed under the terms of the GNU Library General Public
  33. License as published by the Free Software Foundation.
  34.  
  35. */
  36.  
  37. #if !defined (_SLStack_h)
  38. #define _SLStack_h 1
  39.  
  40. #include "SLList.h"
  41. #include "Stack.h"
  42.  
  43. template <class T>
  44. class
  45. SLStack : public Stack<T>
  46. {
  47.  private:
  48.   SLList<T> p;
  49.  
  50.  public:
  51.   SLStack (void);
  52.   SLStack (const SLStack<T>& s);
  53.   ~SLStack (void);
  54.  
  55.   SLStack<T>& operator = (const SLStack<T>&);
  56.  
  57.   void push (const T& item);
  58.   T pop (void);
  59.   T& top (void);
  60.   void del_top (void);
  61.  
  62.   int empty (void);
  63.   int full (void);
  64.   int length (void);
  65.  
  66.   void clear (void);
  67.  
  68.   int OK (void);
  69. };
  70.  
  71. #endif
  72.  
  73. /*
  74. ;;; Local Variables: ***
  75. ;;; mode: C++ ***
  76. ;;; page-delimiter: "^/\\*" ***
  77. ;;; End: ***
  78. */
  79.