aboutsummaryrefslogtreecommitdiff
path: root/src/pqueue.h
diff options
context:
space:
mode:
authorMike Buland <eichlan@xagasoft.com>2007-04-03 03:49:53 +0000
committerMike Buland <eichlan@xagasoft.com>2007-04-03 03:49:53 +0000
commitf4c20290509d7ed3a8fd5304577e7a4cc0b9d974 (patch)
tree13cdf64f7cf134f397a7165b7a3fe0807e37026b /src/pqueue.h
parent74d4c8cd27334fc7204d5a8773deb3d424565778 (diff)
downloadlibbu++-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/pqueue.h')
-rw-r--r--src/pqueue.h48
1 files changed, 0 insertions, 48 deletions
diff --git a/src/pqueue.h b/src/pqueue.h
deleted file mode 100644
index 8307d56..0000000
--- a/src/pqueue.h
+++ /dev/null
@@ -1,48 +0,0 @@
1#ifndef PQUEUE_H
2#define PQUEUE_H
3
4#include "queue.h"
5
6/** Priority queue. This is just like a queue, but something with a higher
7 * priority will always come off the queue before something with a lower
8 * priority, even if it's added after. Otherwise works just like a queue.
9 *@author Mike Buland
10 */
11class PQueue
12{
13public:
14 /** Create a queue with any number of different priorities.
15 *@param nNewNumQueues The number of queues, the default is 3
16 */
17 PQueue( int nNewNumQueues=3 );
18
19 /**
20 * Cleanup all contained queues.
21 */
22 virtual ~PQueue();
23
24 /** Add a new item to the queue at the specified priority. A lower
25 * number means a higher priority!
26 *@param pData A pointer to the data to add to the queue
27 *@param nQueueLevel The priority to set the new data to
28 */
29 void enqueue( void *pData, int nQueueLevel );
30
31 /** Pull the next item off the queue, high priority first.
32 *@returns A pointer to the data that was next in the priority queue
33 */
34 void *dequeue();
35
36private:
37 /**
38 * The queues we use for real data storage.
39 */
40 Queue *aQueue;
41
42 /**
43 * The number of priorities or queus that we need.
44 */
45 int nNumQueues;
46};
47
48#endif