829
|
1 // Stack.h -*- C++ -*- |
|
2 /* |
|
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 Stack 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 |
829
|
37 #if !defined (_Stack_h) |
240
|
38 #define _Stack_h 1 |
|
39 |
1
|
40 template <class T> |
452
|
41 class |
|
42 Stack |
1
|
43 { |
|
44 public: |
353
|
45 inline Stack (void) { } |
|
46 inline virtual ~Stack (void) { } |
1
|
47 |
|
48 virtual void push (const T& item) = 0; |
|
49 |
|
50 virtual T pop (void) = 0; |
|
51 virtual T& top (void) = 0; |
|
52 |
|
53 virtual void del_top (void) = 0; |
|
54 |
|
55 virtual int empty (void) = 0; |
|
56 virtual int full (void) = 0; |
|
57 virtual int length (void) = 0; |
|
58 |
|
59 virtual void clear (void) = 0; |
|
60 |
|
61 void error (const char *msg); |
|
62 virtual int OK (void) = 0; |
|
63 }; |
|
64 |
|
65 #endif |