summaryrefslogblamecommitdiffstats
path: root/src/OSSupport/Queue.h
blob: 838a101e040a27908f6821079fb3e85ba5fb9ca3 (plain) (tree)





























                                                     
#pragma once

template<class T>
class cDeleter 
{
	public:
		static void Delete(T) {};
} 

template<class T, class D = cDelete>
class cQueue
{
public:
	cQueue(int warnsize);
	cQueue(cQueue<T>& queue);
	~cQueue();

	void EnqueueItem(T item);
	bool TryDequeueItem(T& item);
	T    DequeueItem();
	void BlockTillEmpty(cEvent CancelationEvent);
	void Clear();
	int  Size();
	
private:
	int warnsize;
}

//template classes must be implemented in the header
#include "Queue.inc"