|
uvw 3.4.0
|
Event emitter base class. More...
#include <emitter.h>
Public Member Functions | |
| template<typename Type> | |
| void | on (listener_t< Type > f) |
| Registers a long-lived listener with the event emitter. | |
| template<typename Type> | |
| void | reset () noexcept |
| Disconnects the listener for the given event type. | |
| void | reset () noexcept |
| Disconnects all listeners. | |
| template<typename Type> | |
| bool | has () const noexcept |
| Checks if there is a listener registered for the specific event. | |
Event emitter base class.
Almost everything in uvw is an event emitter.
This is the base class from which resources and loops inherit.
|
inlinenoexcept |
|
inline |
Registers a long-lived listener with the event emitter.
This method is used to register a listener with the emitter.
A listener is usually defined as a callable object assignable to a std::function<void(const Event &, Elem &), where Event is the type of the event and Elem is the type of the resource.
| f | A valid listener to be registered. |