Diffstat (limited to 'noncore/apps/opie-reader/Queue.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/Queue.h | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/noncore/apps/opie-reader/Queue.h b/noncore/apps/opie-reader/Queue.h index f1bd4b4..321042e 100644 --- a/noncore/apps/opie-reader/Queue.h +++ b/noncore/apps/opie-reader/Queue.h | |||
@@ -1,21 +1,13 @@ | |||
1 | #ifndef __QUEUE_H | 1 | #ifndef __QUEUE_H |
2 | #define __QUEUE_H | 2 | #define __QUEUE_H |
3 | 3 | ||
4 | #include "my_list.h" | 4 | #include "my_list.h" |
5 | 5 | ||
6 | template<class T> | 6 | template<class T> |
7 | class CQueue : public CList<T> | 7 | class CQueue : public CList<T> |
8 | { | 8 | { |
9 | public: | 9 | public: |
10 | bool empty() { return (front == NULL); } | 10 | bool empty() { return (CList<T>::front == NULL); } |
11 | void push(const T& t) { push_back(t); } | 11 | void push(const T& t) { push_back(t); } |
12 | T pop() | ||
13 | { | ||
14 | T data = front->data; | ||
15 | node* n = front; | ||
16 | front = front->next; | ||
17 | delete n; | ||
18 | return data; | ||
19 | } | ||
20 | }; | 12 | }; |
21 | #endif | 13 | #endif |