#pragma once #include #include #include #include #include "Context.hpp" #include "RemotePeer.hpp" #include "events/types.hpp" #include "events/base/BaseEvent.hpp" #include "tasks/types.hpp" #include "tasks/base/BaseTask.hpp" #include "utils/StatList.hpp" class EventManager { public: EventManager(); void loop(); void loopSender(); void loopReceiver(); private: std::thread senderThread; /// the thread sending communication std::thread receiverThread; /// the thread receiving communication std::map> eventRegistry; /// hold the event to call depending on the event type std::map> taskRegistry; /// hold the task to call depending on the server status Context context; /// context used between the events types };