mirror of
https://github.com/Andreabont/CppExperiments.git
synced 2024-11-09 12:51:44 +00:00
27 lines
453 B
C++
27 lines
453 B
C++
#ifndef EMAN_H
|
|
#define EMAN_H
|
|
|
|
#include <string>
|
|
#include <functional>
|
|
#include <map>
|
|
#include <list>
|
|
|
|
struct EventInfo {
|
|
|
|
std::string eventName;
|
|
|
|
};
|
|
|
|
class EventManager {
|
|
|
|
private:
|
|
std::map<std::string, std::list<std::function<void(EventInfo)>>> callBackList;
|
|
|
|
public:
|
|
void eventRegister(std::string eventName, std::function<void(EventInfo)> callBack);
|
|
void eventDispatch(std::string eventName);
|
|
|
|
};
|
|
|
|
#endif // EMAN_H
|