|
Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
|
Type-safe signal for event publishing. More...
#include <Signal.hpp>
Public Types | |
| using | Callback = std::function<void(Args...)> |
Public Member Functions | |
| Signal ()=default | |
| ~Signal ()=default | |
| Signal (Signal &&) noexcept=default | |
| Signal & | operator= (Signal &&) noexcept=default |
| Signal (const Signal &)=delete | |
| Signal & | operator= (const Signal &)=delete |
| void | publish (Args... args) |
| Publish an event to all subscribers. | |
| usize | size () const |
| Get the number of active subscribers. | |
| bool | empty () const |
| Check if there are any subscribers. | |
Friends | |
| class | Sink< Signal< void(Args...)> > |
Type-safe signal for event publishing.
Signal<void(Args...)> allows publishing events to multiple subscribers. Connections are managed through the Sink interface which returns RAII Connection handles.
| Args | The argument types for the callback |
Definition at line 62 of file Signal.hpp.
| using esengine::Signal< void(Args...)>::Callback = std::function<void(Args...)> |
Definition at line 64 of file Signal.hpp.
|
default |
Referenced by Signal(), Signal(), operator=(), and operator=().
|
default |
|
defaultnoexcept |
References Signal().
|
delete |
References Signal().
|
inlinenodiscard |
Check if there are any subscribers.
Definition at line 110 of file Signal.hpp.
|
delete |
References Signal().
|
defaultnoexcept |
References Signal().
|
inline |
Publish an event to all subscribers.
| args | Arguments to pass to callbacks |
Definition at line 79 of file Signal.hpp.
References publish().
Referenced by publish().
|
inlinenodiscard |
Get the number of active subscribers.
Definition at line 102 of file Signal.hpp.
Definition at line 110 of file Signal.hpp.