template<typename T>
class uvw::Emitter< T >
Event emitter base class.
Almost everything in uvw
is an event emitter.
This is the base class from which resources and loops inherit.
Definition at line 83 of file emitter.h.
template<typename T >
template<typename E >
Registers a long-lived listener with the event emitter.
This method can be used to register a listener that is meant to be invoked more than once for the given event type.
The Connection object returned by the method can be freely discarded. It can be used later to disconnect the listener, if needed.
Listener is usually defined as a callable object assignable to a std::function<void(const E &, T &)
, where E
is the type of the event and T
is the type of the resource.
- Parameters
-
f | A valid listener to be registered. |
- Returns
- Connection object to be used later to disconnect the listener.
Definition at line 220 of file emitter.h.
template<typename T >
template<typename E >
Registers a short-lived listener with the event emitter.
This method can be used to register a listener that is meant to be invoked only once for the given event type.
The Connection object returned by the method can be freely discarded. It can be used later to disconnect the listener, if needed.
Listener is usually defined as a callable object assignable to a std::function<void(const E &, T &)
, where E
is the type of the event and T
is the type of the resource.
- Parameters
-
f | A valid listener to be registered. |
- Returns
- Connection object to be used later to disconnect the listener.
Definition at line 240 of file emitter.h.