mirror of https://gitlab.com/cppit/jucipp
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.
21 lines
404 B
21 lines
404 B
|
10 years ago
|
#ifndef DISPATCHER_H_
|
||
|
|
#define DISPATCHER_H_
|
||
|
|
#include <gtkmm.h>
|
||
|
|
#include <mutex>
|
||
|
|
#include <vector>
|
||
|
|
|
||
|
|
class Dispatcher {
|
||
|
|
private:
|
||
|
|
std::vector<std::function<void()>> functions;
|
||
|
|
std::mutex functions_mutex;
|
||
|
|
Glib::Dispatcher dispatcher;
|
||
|
|
sigc::connection connection;
|
||
|
|
public:
|
||
|
|
Dispatcher();
|
||
|
|
~Dispatcher();
|
||
|
|
void add(std::function<void()> function);
|
||
|
|
void disconnect();
|
||
|
|
};
|
||
|
|
|
||
|
|
#endif /* DISPATCHER_H_ */
|