summaryrefslogtreecommitdiff
path: root/src/queue.h
blob: 692f5d80e62cb0c5ce669d64ebdc7fb4539dcc8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef QUEUE_H
#define QUEUE_H
#include "linkedlist.h"

/**
 * An ultra-simple queue implementation.  It just uses a linked list as it's
 * container so we don't have to worry about anything!
 *@author Mike Buland
 */
class Queue
{
public:
	/**
	 * Puts a new item at the end of the queue.
	 *@param data A new value to put at the end of the queue.
	 */
	void enqueue( void *data );

	/**
	 * Gets the begining item of the queue off and returns it.
	 *@returns The value at the front of the queue.
	 */
	void *dequeue();

	/**
	 * Checks if the queueu is empty.
	 *@returns True if the queueu is empty, and false if it has things in it.
	 */
	bool isEmpty();

	/**
	 * Empty the queue.
	 */
	void empty();
	
	/**
	 * Get a pointer to the internal list object.
	 *@returns A pointer to the internal list object.
	 */
	LinkedList *getList() { return &lQueueData; };

private:
	LinkedList lQueueData;	/**< Where all of the real data is stored. */
};
#endif