|
guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
|
A queue of the events of one type published on an EventBus, waiting to be read. More...
#include <headers/guillaume/event/event_subscriber.hpp>
Public Member Functions | |
| EventSubscriber (EventBus &eventBus) | |
| Create an empty queue and subscribe it to a bus. | |
| ~EventSubscriber (void)=default | |
| Destroy the queue. The bus is not told: see the note of the class. | |
| bool | hasPendingEvents (void) const |
| Tell whether at least one event is waiting. | |
| std::shared_ptr< EventType > | getNextEvent (void) |
| Take the oldest waiting event out of the queue. | |
A queue of the events of one type published on an EventBus, waiting to be read.
The bus delivers events the moment the engine polls them. A subscriber stores them, in arrival order, until its owner is ready: Application reads its quit-event subscriber before each frame, and each input system reads its own (through EventManager) during the Event phase.
| EventType | The exact event type to queue. |
Definition at line 58 of file event_subscriber.hpp.
| guillaume::event::EventSubscriber< EventType >::EventSubscriber | ( | EventBus & | eventBus | ) |
Create an empty queue and subscribe it to a bus.
| eventBus | The bus whose events of type EventType are queued, starting with the next one published. |
| std::shared_ptr< EventType > guillaume::event::EventSubscriber< EventType >::getNextEvent | ( | void | ) |
Take the oldest waiting event out of the queue.
| bool guillaume::event::EventSubscriber< EventType >::hasPendingEvents | ( | void | ) | const |
Tell whether at least one event is waiting.