|
CheeseEngine
A 2D Game Engine
|
Typed event queue for a specific event type T. More...
#include <EventBus.hpp>
Public Member Functions | |
| void | Dispatch () override |
| Moves events to a local buffer, clears the original queue, and notifies subscribers. | |
| void | RemoveHandler (HandlerId id) override |
| Erases a callback from the handlers list if the ID matches. | |
Public Member Functions inherited from IEventQueue | |
| virtual | ~IEventQueue ()=default |
Public Attributes | |
| std::vector< T > | queue |
| Accumulated events for the current frame. | |
| std::vector< std::pair< HandlerId, std::function< void(const T &)> > > | handlers |
| Registered callbacks paired with their IDs. | |
Typed event queue for a specific event type T.
| T | : The type of the event being handled |
|
inlineoverridevirtual |
Moves events to a local buffer, clears the original queue, and notifies subscribers.
| None |
| None |
Implements IEventQueue.
|
inlineoverridevirtual |
Erases a callback from the handlers list if the ID matches.
| id | : The unique identifier of the handler to remove |
| None |
Implements IEventQueue.
| std::vector<std::pair<HandlerId, std::function<void(const T&)> > > EventQueue< T >::handlers |
Registered callbacks paired with their IDs.
| std::vector<T> EventQueue< T >::queue |
Accumulated events for the current frame.