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