00001 00003 #ifndef __gdtqueue__ 00004 #define __gdtqueue__ 00005 00006 #include "gdtlist.h" 00007 00008 namespace gdt { 00009 00010 template<class E> 00011 class gdtqueue : private gdtlist<E> { 00012 00013 private: 00014 00015 typedef gdtlist<E> base; 00016 00017 public: 00018 00019 gdtqueue() {} 00020 00021 gdtqueue(const gdtqueue<E>& q) : base(q) {} 00022 00023 ~gdtqueue() { clear(); } 00024 00025 gdtqueue<E>& operator=(const gdtqueue<E>& q) 00026 { base::operator=(q); return *this; } 00027 00028 const E& top() const { return base::head(); } 00029 00030 const E& pop() { return base::pop(); } 00031 00032 void append(const E& x) { base::append(x); } 00033 00034 int size() const { return base::size(); } 00035 00036 bool empty() const { return base::empty(); } 00037 00038 void clear() { base::clear(); } 00039 }; 00040 } 00041 00042 #endif