|
guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
|
Base class that gives a system the input events of one type, one event per frame. More...
#include <headers/guillaume/event/event_manager.hpp>

Public Member Functions | |
| EventManager (EventBus &eventBus) | |
| Subscribe to a bus; events of type EventType published after this call are queued. | |
| virtual | ~EventManager (void)=default |
| Virtual destructor. | |
| bool | hasPendingEvents (void) const |
| Tell whether at least one event is queued, waiting for consumeNextEvent(). | |
Protected Member Functions | |
| void | consumeNextEvent (void) |
| Take the oldest queued event and make it the last event. | |
| std::shared_ptr< EventType > | getLastEvent (void) |
| Get the event taken by the most recent consumeNextEvent() that found one. | |
Base class that gives a system the input events of one type, one event per frame.
The input systems (systems::MouseButton, systems::MouseMotion, the hand systems, ...) derive from both ecs::SystemFiller and EventManager. The manager subscribes to the bus and queues the events as the engine polls them. The system then:
Things to watch out for:
| EventType | The exact event type to receive. |
Definition at line 90 of file event_manager.hpp.
| guillaume::event::EventManager< EventType >::EventManager | ( | EventBus & | eventBus | ) |
Subscribe to a bus; events of type EventType published after this call are queued.
| eventBus | The bus to subscribe to, normally the application's. It must outlive the manager's use. |
|
protected |
Take the oldest queued event and make it the last event.
When no event is queued, nothing changes: the last event stays the one of a previous call. Call it once per frame, in ecs::System::prepare.
|
protected |
Get the event taken by the most recent consumeNextEvent() that found one.
The event is not removed: every call returns the same event until consumeNextEvent() replaces it.
| bool guillaume::event::EventManager< EventType >::hasPendingEvents | ( | void | ) | const |
Tell whether at least one event is queued, waiting for consumeNextEvent().