2 #include <samchon/API.hpp> 5 #include <unordered_set> 6 #include <unordered_map> 11 #include <condition_variable> 13 #include <samchon/library/RWMutex.hpp> 54 typedef void(*Listener)(std::shared_ptr<Event>,
void*);
61 std::unordered_map<int, std::unordered_map<Listener, std::unordered_set<void*>>>
listeners;
122 void addEventListener(
int, Listener,
void* =
nullptr);
135 void removeEventListener(
int, Listener,
void* =
nullptr);
147 void dispatch(std::shared_ptr<Event>);
150 void deliver(std::shared_ptr<Event>);
156 static std::condition_variable cv;
157 static std::mutex cv_mtx;
159 static std::unordered_multimap<EventDispatcher*, std::shared_ptr<Event>> eventMap;
160 static std::mutex sMtx;
std::unordered_map< int, std::unordered_map< Listener, std::unordered_set< void * > > > listeners
A container storing listeners.
Abstract class for dispatching Event.
RWMutex mtx
A rw_mutex for concurrency.
static size_t THREAD_SIZE
Numer of threads for background.
Top level namespace of products built from samchon.