annotate src/Stack.h @ 2847:8b262e771614

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