pgLab/pglab/tsqueue.h
2017-11-26 13:07:21 +01:00

28 lines
522 B
C++

#ifndef TSQUEUE_H
#define TSQUEUE_H
//#include "Win32Event.h"
#include <deque>
#include <functional>
#include <mutex>
class TSQueue {
public:
using t_Callable = std::function<void()>;
TSQueue();
void add(t_Callable callable);
bool empty();
t_Callable pop();
//HANDLE getNewDataEventHandle(); Looks like this wasn't use at all so we can leave the event out.
private:
using t_CallableQueue = std::deque<t_Callable>;
//Win32Event newData;
std::mutex m;
t_CallableQueue futureQueue;
};
#endif // TSQUEUE_H