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.
22 lines
370 B
22 lines
370 B
#ifndef CPPJS_EVENTBUS_H
|
|
#define CPPJS_EVENTBUS_H
|
|
|
|
#include <map>
|
|
#include <vector>
|
|
|
|
class EventBus {
|
|
private:
|
|
std::map<std::string, std::vector<void (*)()>> _bus;
|
|
|
|
public:
|
|
void addHandler(std::string key, void (*func)());
|
|
void fire(std::string key);
|
|
};
|
|
|
|
extern EventBus g_event_bus;
|
|
EventBus g_event_bus;
|
|
|
|
#include "EventBus.cpp"
|
|
|
|
#endif //CPPJS_EVENTBUS_H
|