519
|
1 // SLStack.cc -*- C++ -*- |
239
|
2 /* |
|
3 |
354
|
4 Copyright (C) 1993, 1994 John W. Eaton |
239
|
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 |
|
20 Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
|
21 |
|
22 */ |
|
23 |
|
24 #ifdef HAVE_CONFIG_H |
|
25 #include "config.h" |
|
26 #endif |
|
27 |
|
28 #include "SLStack.h" |
|
29 |
|
30 template <class T> |
|
31 SLStack<T>::SLStack (void) : p () |
|
32 { |
|
33 } |
|
34 |
|
35 template <class T> |
|
36 SLStack<T>::SLStack (const SLStack<T>& a) : p (a.p) |
|
37 { |
|
38 } |
|
39 |
|
40 template <class T> |
|
41 SLStack<T>::~SLStack (void) |
|
42 { |
|
43 } |
|
44 |
|
45 template <class T> |
|
46 void |
|
47 SLStack<T>::push (const T& item) |
|
48 { |
|
49 p.prepend (item); |
|
50 } |
|
51 |
|
52 template <class T> |
|
53 T |
|
54 SLStack<T>::pop (void) |
|
55 { |
|
56 return p.remove_front (); |
|
57 } |
|
58 |
|
59 template <class T> |
|
60 T& |
|
61 SLStack<T>::top (void) |
|
62 { |
|
63 return p.front (); |
|
64 } |
|
65 |
|
66 template <class T> |
|
67 void |
|
68 SLStack<T>::del_top (void) |
|
69 { |
|
70 p.del_front (); |
|
71 } |
|
72 |
|
73 template <class T> |
|
74 void |
|
75 SLStack<T>::operator = (const SLStack<T>& s) |
|
76 { |
|
77 p = s.p; |
|
78 } |
|
79 |
|
80 template <class T> |
|
81 int |
|
82 SLStack<T>::empty (void) |
|
83 { |
|
84 return p.empty (); |
|
85 } |
|
86 |
|
87 template <class T> |
|
88 int |
|
89 SLStack<T>::full (void) |
|
90 { |
|
91 return 0; |
|
92 } |
|
93 |
|
94 template <class T> |
|
95 int |
|
96 SLStack<T>::length (void) |
|
97 { |
|
98 return p.length (); |
|
99 } |
|
100 |
|
101 template <class T> |
|
102 int |
|
103 SLStack<T>::OK (void) |
|
104 { |
|
105 return p.OK (); |
|
106 } |
|
107 |
|
108 template <class T> |
|
109 void |
|
110 SLStack<T>::clear (void) |
|
111 { |
|
112 p.clear (); |
|
113 } |
|
114 |
|
115 /* |
|
116 ;;; Local Variables: *** |
|
117 ;;; mode: C++ *** |
|
118 ;;; page-delimiter: "^/\\*" *** |
|
119 ;;; End: *** |
|
120 */ |