// This may look like C code, but it is really -*- C++ -*- /* Copyright (C) 1988 Free Software Foundation written by Doug Lea (dl@rocky.oswego.edu) This file is part of the GNU C++ Library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; if not, write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef _DLDeque_h #ifdef __GNUG__ #pragma interface #endif #define _DLDeque_h #include ".DLList.h" #include ".Deque.h" class DLDeque : public Deque { DLList p; public: DLDeque(); DLDeque(const DLDeque& d); ~DLDeque(); void operator = (const DLDeque&); void push( item); // insert at front void enq( item); // insert at rear & front(); & rear(); deq(); void del_front(); void del_rear(); void clear(); int empty(); int full(); int length(); int OK(); }; inline DLDeque::DLDeque() : p() {} inline DLDeque::DLDeque(const DLDeque& d) : p(d.p) {} inline DLDeque::~DLDeque() {} inline void DLDeque::push(item) { p.prepend(item); } inline void DLDeque::enq(item) { p.append(item); } inline DLDeque::deq() { return p.remove_front(); } inline & DLDeque::front() { return p.front(); } inline & DLDeque::rear() { return p.rear(); } inline void DLDeque::del_front() { p.del_front(); } inline void DLDeque::del_rear() { p.del_rear(); } inline void DLDeque::operator =(const DLDeque& s) { p.operator = (s.p); } inline int DLDeque::empty() { return p.empty(); } inline int DLDeque::full() { return 0; } inline int DLDeque::length() { return p.length(); } inline int DLDeque::OK() { return p.OK(); } inline void DLDeque::clear() { p.clear(); } #endif