Open 3D Engine AzCore API Reference
24.09
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
|
Public Types | |
using | Callback = AZStd::function< void(Params...)> |
using | Handler = EventHandler< Params... > |
Public Member Functions | |
AZ_CLASS_ALLOCATOR (Event< Params... >, AZ::SystemAllocator) | |
Event (Event &&rhs) | |
Event & | operator= (Event &&rhs) |
Event & | ClaimHandlers (Event &&other) |
bool | HasHandlerConnected () const |
Returns true if at least one handler is connected to this event. | |
void | DisconnectAllHandlers () |
Disconnects all connected handlers. | |
void | Signal (const Params &... params) const |
Friends | |
class | EventHandler< Params... > |
A specialized type of EBus useful for eventing on a specific event type Whereas with EBus you would have to define a bus, implement the bus, and manage connecting and disconnecting from the bus Event only requires you declare an Event<>, and then connect Event<>::Handlers Note that this system does not provide any thread safety, Handler Connect and Disconnect must happen on the same thread dispatching Events It is safe to connect or disconnect handlers during a signal, in this case we don't guarantee the signal will be dispatched to the disconnected handler Example Usage:
Take the handlers registered with the other event and move them to this event. The other will event will be cleared after call
other | event to move handlers |
void AZ::Event< Params >::Signal | ( | const Params &... | params | ) | const |
Signal an event.
params | variadic set of event parameters |