Skip to main content

Module dispatch

Module dispatch 

Source
Expand description

IEventDispatcher<H>, for any handler type H, and the macro that writes a handler.

Every component hands out its events through the same template: a dispatcher whose first slots add, remove and look up a handler. It declares no destructor and no overload, so the slots are the declaration order on both ABIs, and one generic wrapper serves every event group. The accessors that return a dispatcher are generated (objects_event_dispatcher, npcs_event_dispatcher, …), and so are the handlers of the groups the SDK does not write by hand.

Modules§

priority
Where a handler runs relative to the others: EventPriority in events.hpp.

Structs§

EventDispatcher
IEventDispatcher<H>* — held by pointer only.

Functions§

add_event_handler⚠
addEventHandler(handler, priority). false means the handler was already registered, or the dispatcher is null.
event_handler_count⚠
count() — how many handlers are registered.
remove_event_handler⚠
removeEventHandler(handler). false means it was not registered.