VisualScriptDispatcherRegistry
- Module
- VisualScripting
- Header
#include "VisualScripting/VisualScriptDispatcherRegistry.h"- Namespace
Mowo
Public functions
| Returns | Name | Description |
|---|---|---|
VisualScriptDispatcherRegistry& | Get | |
void | Bind | Bind handler (a function on the listener's class, captured in listenerCtx) to dispatcher on owner. |
void | Unbind | Remove a specific binding (owner, dispatcher, listener, handler). |
std::vector<VisualScriptDispatcherBinding> | Collect | Live bindings for (owner, dispatcher), pruning any whose owner or listener has been collected. |
void | RemoveObject | Drop every binding referencing obj as owner OR listener (call on EndPlay so a dead actor leaves no stale entries). |
void | RebindClass | Hot-reload repair: bindings capture the listener's VisualScriptClass* by value, so a Reregister that frees the old definition leaves them dangling — latents are purged for exactly this reason, and these two keep the binding table on the same rule. |
void | RemoveClass | |
void | Clear | |
size_t | Num | |
bool | BeginBroadcast | Nesting cap for cross-actor broadcasts (A's handler broadcasting back into B and so on — all synchronous, all on this stack). |
void | EndBroadcast |
Function details
Get
static VisualScriptDispatcherRegistry& Get()Bind
void Bind(MObject* owner, const std::string& dispatcher, const std::string& handler, const VisualScriptContext& listenerCtx)Bind handler (a function on the listener's class, captured in listenerCtx) to dispatcher on owner. Idempotent for an identical (owner, dispatcher, listener, handler) tuple.
Unbind
void Unbind(MObject* owner, const std::string& dispatcher, const std::string& handler, MObject* listener)Remove a specific binding (owner, dispatcher, listener, handler).
Collect
std::vector<VisualScriptDispatcherBinding> Collect(MObject* owner, const std::string& dispatcher)Live bindings for (owner, dispatcher), pruning any whose owner or listener has been collected.
RemoveObject
void RemoveObject(MObject* obj)Drop every binding referencing obj as owner OR listener (call on EndPlay so a dead actor leaves no stale entries).
RebindClass
void RebindClass(const VisualScriptClass* oldDef, const VisualScriptClass* newDef)Hot-reload repair: bindings capture the listener's VisualScriptClass* by value, so a Reregister that frees the old definition leaves them dangling — latents are purged for exactly this reason, and these two keep the binding table on the same rule. RebindClass re-points captured contexts at the swapped-in definition; RemoveClass drops bindings whose class is being unregistered outright.
RemoveClass
void RemoveClass(const VisualScriptClass* def)Clear
void Clear()Num
size_t Num() constBeginBroadcast
bool BeginBroadcast()Nesting cap for cross-actor broadcasts (A's handler broadcasting back into B and so on — all synchronous, all on this stack). Mirrors MWorld::FirePin's wire-recursion cap. Returns false when the cap is hit; a true return must be paired with EndBroadcast.
EndBroadcast
void EndBroadcast()