source: trunk/src/emx/include/Attic/cpp/gen/DLDeque.hP@ 18

Last change on this file since 18 was 18, checked in by bird, 23 years ago

Initial revision

  • Property cvs2svn:cvs-rev set to 1.1
  • Property svn:eol-style set to native
  • Property svn:executable set to *
File size: 2.6 KB
Line 
1// This may look like C code, but it is really -*- C++ -*-
2/*
3Copyright (C) 1988 Free Software Foundation
4 written by Doug Lea ([email protected])
5
6This file is part of the GNU C++ Library. This library is free
7software; you can redistribute it and/or modify it under the terms of
8the GNU Library General Public License as published by the Free
9Software Foundation; either version 2 of the License, or (at your
10option) any later version. This library is distributed in the hope
11that it will be useful, but WITHOUT ANY WARRANTY; without even the
12implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13PURPOSE. See the GNU Library General Public License for more details.
14You should have received a copy of the GNU Library General Public
15License along with this library; if not, write to the Free Software
16Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17*/
18
19
20#ifndef _<T>DLDeque_h
21#ifdef __GNUG__
22#pragma interface
23#endif
24#define _<T>DLDeque_h
25
26#include "<T>.DLList.h"
27#include "<T>.Deque.h"
28
29class <T>DLDeque : public <T>Deque
30{
31 <T>DLList p;
32
33public:
34 <T>DLDeque();
35 <T>DLDeque(const <T>DLDeque& d);
36 inline ~<T>DLDeque();
37
38 void operator = (const <T>DLDeque&);
39
40 inline void push(<T&> item); // insert at front
41 inline void enq(<T&> item); // insert at rear
42
43 inline <T>& front();
44 inline <T>& rear();
45
46 inline <T> deq();
47 inline void del_front();
48 inline void del_rear();
49
50 inline void clear();
51 inline int empty();
52 inline int full();
53 inline int length();
54
55 inline int OK();
56};
57
58
59inline <T>DLDeque::<T>DLDeque() : p() {}
60inline <T>DLDeque::<T>DLDeque(const <T>DLDeque& d) : p(d.p) {}
61
62inline <T>DLDeque::~<T>DLDeque() {}
63
64inline void <T>DLDeque::push(<T&>item)
65{
66 p.prepend(item);
67}
68
69inline void <T>DLDeque::enq(<T&>item)
70{
71 p.append(item);
72}
73
74inline <T> <T>DLDeque::deq()
75{
76 return p.remove_front();
77}
78
79inline <T>& <T>DLDeque::front()
80{
81 return p.front();
82}
83
84inline <T>& <T>DLDeque::rear()
85{
86 return p.rear();
87}
88
89inline void <T>DLDeque::del_front()
90{
91 p.del_front();
92}
93
94inline void <T>DLDeque::del_rear()
95{
96 p.del_rear();
97}
98
99inline void <T>DLDeque::operator =(const <T>DLDeque& s)
100{
101 p.operator = (s.p);
102}
103
104
105inline int <T>DLDeque::empty()
106{
107 return p.empty();
108}
109
110inline int <T>DLDeque::full()
111{
112 return 0;
113}
114
115inline int <T>DLDeque::length()
116{
117 return p.length();
118}
119
120inline int <T>DLDeque::OK()
121{
122 return p.OK();
123}
124
125inline void <T>DLDeque::clear()
126{
127 p.clear();
128}
129
130#endif
Note: See TracBrowser for help on using the repository browser.