You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
315 B
22 lines
315 B
#ifndef _QUEUE_h
|
|
#define _QUEUE_h
|
|
|
|
#define QUEUE_RING_SIZE 8
|
|
|
|
template<typename T>
|
|
class Queue
|
|
{
|
|
private:
|
|
T* m_item[QUEUE_RING_SIZE];
|
|
int m_read = 0, m_write = 0;
|
|
bool m_full = false;
|
|
int next(int n);
|
|
public:
|
|
Queue();
|
|
void push(T* item);
|
|
T* pop();
|
|
T* peek();
|
|
bool isEmpty();
|
|
};
|
|
|
|
#endif
|