829
|
1 /* |
|
2 |
2847
|
3 Copyright (C) 1996, 1997 John W. Eaton |
829
|
4 |
|
5 This file is part of Octave. |
|
6 |
|
7 Octave is free software; you can redistribute it and/or modify it |
|
8 under the terms of the GNU General Public License as published by the |
|
9 Free Software Foundation; either version 2, or (at your option) any |
|
10 later version. |
|
11 |
|
12 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
15 for more details. |
|
16 |
|
17 You should have received a copy of the GNU General Public License |
|
18 along with Octave; see the file COPYING. If not, write to the Free |
1315
|
19 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
829
|
20 |
|
21 */ |
|
22 |
|
23 /* |
|
24 |
|
25 The classes in this file are derived from the old `genclass' version |
|
26 of Stack from libg++, originally: |
|
27 |
|
28 Copyright (C) 1988 Free Software Foundation |
1
|
29 written by Doug Lea (dl@rocky.oswego.edu) |
|
30 |
829
|
31 and distributed under the terms of the GNU Library General Public |
|
32 License as published by the Free Software Foundation. |
|
33 |
1
|
34 */ |
|
35 |
829
|
36 #if !defined (_Stack_h) |
240
|
37 #define _Stack_h 1 |
|
38 |
2580
|
39 #if defined (__GNUG__) |
|
40 #pragma interface |
|
41 #endif |
|
42 |
1
|
43 template <class T> |
452
|
44 class |
|
45 Stack |
1
|
46 { |
|
47 public: |
2658
|
48 |
|
49 Stack (void) { } |
|
50 |
|
51 virtual ~Stack (void) { } |
1
|
52 |
|
53 virtual void push (const T& item) = 0; |
|
54 |
|
55 virtual T pop (void) = 0; |
|
56 virtual T& top (void) = 0; |
|
57 |
|
58 virtual void del_top (void) = 0; |
|
59 |
|
60 virtual int empty (void) = 0; |
|
61 virtual int full (void) = 0; |
|
62 virtual int length (void) = 0; |
|
63 |
|
64 virtual void clear (void) = 0; |
|
65 |
|
66 void error (const char *msg); |
2580
|
67 |
1
|
68 virtual int OK (void) = 0; |
|
69 }; |
|
70 |
|
71 #endif |