xref: /386bsd/usr/src/lib/libg++/g++-include/gen/Stack.hP (revision a2142627)
1// This may look like C code, but it is really -*- C++ -*-
2/*
3Copyright (C) 1988 Free Software Foundation
4    written by Doug Lea (dl@rocky.oswego.edu)
5
6This file is part of GNU CC.
7
8GNU CC is distributed in the hope that it will be useful,
9but WITHOUT ANY WARRANTY.  No author or distributor
10accepts responsibility to anyone for the consequences of using it
11or for whether it serves any particular purpose or works at all,
12unless he says so in writing.  Refer to the GNU CC General Public
13License for full details.
14
15Everyone is granted permission to copy, modify and redistribute
16GNU CC, but only under the conditions described in the
17GNU CC General Public License.   A copy of this license is
18supposed to have been given to you along with GNU CC so you
19can know your rights and responsibilities.  It should be in a
20file named COPYING.  Among other things, the copyright notice
21and this notice must be preserved on all copies.
22*/
23
24
25#ifndef _<T>Stack_h
26#ifdef __GNUG__
27#pragma once
28#pragma interface
29#endif
30#define _<T>Stack_h
31
32#include <builtin.h>
33
34#include "<T>.defs.h"
35
36class <T>Stack
37{
38public:
39                        <T>Stack();
40  virtual              ~<T>Stack();
41
42  virtual void          push(<T&> item) = 0;
43  virtual <T>           pop() = 0;
44  virtual <T>&          top() = 0;
45  virtual void          del_top() = 0;
46
47  virtual int           empty() = 0;
48  virtual int           full() = 0;
49  virtual int           length() = 0;
50
51  virtual void          clear() = 0;
52
53  void                  error(const char*);
54  virtual int           OK() = 0;
55};
56
57#if defined(__OPTIMIZE__) || defined(USE_LIBGXX_INLINES)
58inline <T>Stack::<T>Stack() {}
59#endif
60
61
62#endif
63