|
Toast Engine
|
Public Member Functions | |
| ThreadListener (bool state) | |
| void | clear () |
| clears away all callbacks | |
| template<typename TEvent> | |
| void | unsubscribe (std::string_view name) noexcept |
| unsubscribes every event in type TEvent with that name | |
| template<typename TEvent, EventCallback< TEvent & > F> | |
| void | subscribe (std::string name, F &&callback, char priority=0) noexcept |
| subscribes a callback to an TEvent | |
| template<typename TEvent, EventCallback< TEvent & > F> | |
| void | subscribe (F &&callback, char priority=0) noexcept |
| subscribes a callback to an TEvent (name will be set to "unnamed") | |
| void | enabled (bool state) |
| enables/disables the callbacks in the listener | |
| auto | enabled () const -> bool |
| void | pollEvents () |
| iterates through the event_queue and calls the callbacks | |
|
nodiscard |
| void event::ThreadListener::pollEvents | ( | ) |
iterates through the event_queue and calls the callbacks

|
noexcept |
subscribes a callback to an TEvent (name will be set to "unnamed")
| callback | |
| priority | (higher priority happens first) |
|
noexcept |
subscribes a callback to an TEvent
| name | of the callback |
| callback | |
| priority | (higher priority happens first) |

|
noexcept |
unsubscribes every event in type TEvent with that name
| name | event callback name/s to remove |