Diffstat (limited to 'noncore/apps/opie-reader/Queue.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/Queue.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/noncore/apps/opie-reader/Queue.h b/noncore/apps/opie-reader/Queue.h new file mode 100644 index 0000000..f1bd4b4 --- a/dev/null +++ b/noncore/apps/opie-reader/Queue.h @@ -0,0 +1,21 @@ +#ifndef __QUEUE_H +#define __QUEUE_H + +#include "my_list.h" + +template<class T> +class CQueue : public CList<T> +{ + public: + bool empty() { return (front == NULL); } + void push(const T& t) { push_back(t); } + T pop() + { + T data = front->data; + node* n = front; + front = front->next; + delete n; + return data; + } +}; +#endif |