6 #ifndef UTILS_EVENT_HANDLER_H 7 #define UTILS_EVENT_HANDLER_H 8 #include <Utils/AtomicQueue.h> 28 while (!events_.IsEmpty())
30 auto ev = events_.Pop();
40 Event(
const std::string &_id) : id(_id) {};
46 template<
typename T =
Event,
typename... Args>
49 events_.Push(std::make_shared<T>(args...));
Queue which allows calling members from multiple threads without interference.
Definition: AtomicQueue.h:16
Default event. Inherit this structure to create custom event.
Definition: EventHandler.h:38
void RegisterEvent(Args... args)
Adds new event to the event queue.
Definition: EventHandler.h:47
virtual void PollEvents()
Request to process all registered events.
Definition: EventHandler.h:26
General namespace for utilities.
Definition: BulletConversions.h:9
std::string EventId
Unique identifier of event.
Definition: EventHandler.h:36
virtual void ProcessEvent([[maybe_unused]] const Event *e)
Process a single event during polling.
Definition: EventHandler.h:44
Provides an interface for registering and processing events for inherited classes.
Definition: EventHandler.h:22