Generates events and keep tracks of registered callbacks.
More...
#include <gui_event_emitter.hpp>
Generates events and keep tracks of registered callbacks.
Definition at line 23 of file gui_event_emitter.hpp.
◆ event_emitter() [1/3]
lxgui::gui::event_emitter::event_emitter |
( |
| ) |
|
|
default |
◆ event_emitter() [2/3]
lxgui::gui::event_emitter::event_emitter |
( |
const event_emitter & |
| ) |
|
|
delete |
◆ event_emitter() [3/3]
◆ fire_event()
void lxgui::gui::event_emitter::fire_event |
( |
const std::string & |
event_name, |
|
|
event_data |
data = event_data{} |
|
) |
| |
Emmit a new event.
- Parameters
-
event_name | The ID of the event which has occurred |
data | The payload of the event |
Definition at line 10 of file gui_event_emitter.cpp.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ register_event()
Registers a callback to an event.
- Parameters
-
event_name | The name of the event to listen to |
callback | The function to execute when the event is triggered |
- Returns
- A object representing the connection between this emitter and the callback.
- Note
- To avoid dangling references, the caller should store the returned connection object, and use it to terminate the connection when the owner of the callback is destroyed. This can be done automatically if using the event_receiver helper class.
- See also
- fire_event
Definition at line 6 of file gui_event_emitter.cpp.
The documentation for this class was generated from the following files: