829
|
1 // SLStack.h -*- C++ -*- |
1
|
2 /* |
829
|
3 |
1009
|
4 Copyright (C) 1992, 1993, 1994, 1995 John W. Eaton |
829
|
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 |
1315
|
20 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
829
|
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 |
1
|
30 written by Doug Lea (dl@rocky.oswego.edu) |
|
31 |
829
|
32 and distributed under the terms of the GNU Library General Public |
|
33 License as published by the Free Software Foundation. |
|
34 |
1
|
35 */ |
|
36 |
240
|
37 #if !defined (_SLStack_h) |
|
38 #define _SLStack_h 1 |
1
|
39 |
355
|
40 #include "SLList.h" |
|
41 #include "Stack.h" |
|
42 |
1
|
43 template <class T> |
452
|
44 class |
|
45 SLStack : public Stack<T> |
1
|
46 { |
|
47 private: |
|
48 SLList<T> p; |
|
49 |
|
50 public: |
|
51 SLStack (void); |
|
52 SLStack (const SLStack<T>& s); |
|
53 ~SLStack (void); |
|
54 |
877
|
55 SLStack<T>& operator = (const SLStack<T>&); |
1
|
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 |
240
|
72 |
|
73 /* |
|
74 ;;; Local Variables: *** |
|
75 ;;; mode: C++ *** |
|
76 ;;; page-delimiter: "^/\\*" *** |
|
77 ;;; End: *** |
|
78 */ |