2017-01-03 07:22:36 +01:00
|
|
|
|
#ifndef TSQUEUE_H
|
|
|
|
|
|
#define TSQUEUE_H
|
|
|
|
|
|
|
2017-08-23 13:27:23 +02:00
|
|
|
|
//#include "Win32Event.h"
|
2017-01-03 07:22:36 +01:00
|
|
|
|
#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();
|
|
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
using t_CallableQueue = std::deque<t_Callable>;
|
|
|
|
|
|
|
|
|
|
|
|
std::mutex m;
|
|
|
|
|
|
t_CallableQueue futureQueue;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
2017-01-08 09:58:34 +01:00
|
|
|
|
|
2017-01-03 07:22:36 +01:00
|
|
|
|
#endif // TSQUEUE_H
|