source: trunk/src/kernel32/queue.h

Last change on this file was 21916, checked in by dmik, 14 years ago

Merge branch gcc-kmk to trunk.

File size: 1.6 KB
RevLine 
[3059]1/* $Id: queue.h,v 1.1 2000-03-09 19:03:20 sandervl Exp $ */
2
3/*
4 * Very simply generic queue class
5 *
6 * Copyright 2000 Sander van Leeuwen (sandervl@xs4all.nl)
7 *
8 * Project Odin Software License can be found in LICENSE.TXT
9 *
10 */
11
12class Queue;
13
14//******************************************************************************
15//******************************************************************************
16class QueueItem
17{
18public:
[21916]19 QueueItem(ULONG dwItemData)
[3059]20 {
21 this->dwItemData = dwItemData;
22 next = NULL;
23 }
24
25private:
26 ULONG dwItemData;
27 QueueItem *next;
28
29 friend class Queue;
30};
31//******************************************************************************
32//******************************************************************************
33class Queue
34{
35public:
36 Queue();
37 ~Queue();
38
39 void Push(ULONG dwItemData);
40 void Remove(ULONG dwItemData);
41 void Remove(QueueItem *item);
42 ULONG Pop();
43
44 void operator=(Queue&) ;
45
46 QueueItem *Head() { return head; };
47 QueueItem *Tail() { return tail; };
48 QueueItem *getNext(QueueItem *item) { return item->next; };
49 ULONG getItem(QueueItem *item) { return item->dwItemData; };
50
51 BOOL hasElements() { return head != NULL; };
52
53private:
54 void PushRev(Queue& queue, QueueItem *item);
55
56 QueueItem *head;
57 QueueItem *tail;
58};
59//******************************************************************************
60//******************************************************************************
61
Note: See TracBrowser for help on using the repository browser.