CppExperiments/EventManager/EventManager.h
Andrea Bontempi 8a1f664443 Init
2021-10-21 15:00:01 +02:00

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