diff options
author | Mike Buland <eichlan@xagasoft.com> | 2007-04-03 03:49:53 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2007-04-03 03:49:53 +0000 |
commit | f4c20290509d7ed3a8fd5304577e7a4cc0b9d974 (patch) | |
tree | 13cdf64f7cf134f397a7165b7a3fe0807e37026b /src/old/queue.h | |
parent | 74d4c8cd27334fc7204d5a8773deb3d424565778 (diff) | |
download | libbu++-f4c20290509d7ed3a8fd5304577e7a4cc0b9d974.tar.gz libbu++-f4c20290509d7ed3a8fd5304577e7a4cc0b9d974.tar.bz2 libbu++-f4c20290509d7ed3a8fd5304577e7a4cc0b9d974.tar.xz libbu++-f4c20290509d7ed3a8fd5304577e7a4cc0b9d974.zip |
Ok, no code is left in src, it's all in src/old. We'll gradually move code back
into src as it's fixed and re-org'd. This includes tests, which, I may write a
unit test system into libbu++ just to make my life easier.
Diffstat (limited to 'src/old/queue.h')
-rw-r--r-- | src/old/queue.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/old/queue.h b/src/old/queue.h new file mode 100644 index 0000000..692f5d8 --- /dev/null +++ b/src/old/queue.h | |||
@@ -0,0 +1,45 @@ | |||
1 | #ifndef QUEUE_H | ||
2 | #define QUEUE_H | ||
3 | #include "linkedlist.h" | ||
4 | |||
5 | /** | ||
6 | * An ultra-simple queue implementation. It just uses a linked list as it's | ||
7 | * container so we don't have to worry about anything! | ||
8 | *@author Mike Buland | ||
9 | */ | ||
10 | class Queue | ||
11 | { | ||
12 | public: | ||
13 | /** | ||
14 | * Puts a new item at the end of the queue. | ||
15 | *@param data A new value to put at the end of the queue. | ||
16 | */ | ||
17 | void enqueue( void *data ); | ||
18 | |||
19 | /** | ||
20 | * Gets the begining item of the queue off and returns it. | ||
21 | *@returns The value at the front of the queue. | ||
22 | */ | ||
23 | void *dequeue(); | ||
24 | |||
25 | /** | ||
26 | * Checks if the queueu is empty. | ||
27 | *@returns True if the queueu is empty, and false if it has things in it. | ||
28 | */ | ||
29 | bool isEmpty(); | ||
30 | |||
31 | /** | ||
32 | * Empty the queue. | ||
33 | */ | ||
34 | void empty(); | ||
35 | |||
36 | /** | ||
37 | * Get a pointer to the internal list object. | ||
38 | *@returns A pointer to the internal list object. | ||
39 | */ | ||
40 | LinkedList *getList() { return &lQueueData; }; | ||
41 | |||
42 | private: | ||
43 | LinkedList lQueueData; /**< Where all of the real data is stored. */ | ||
44 | }; | ||
45 | #endif | ||