wavelength 1.0.0
Loading...
Searching...
No Matches
ScriptFunction Class Reference

Registry of the C++ routines a script command can call by name. More...

#include <scriptfunction.h>

Public Types

typedef void(* Handler) (DataArray *pCommand, void *pUserData)
 Routine a script command calls.

Static Public Member Functions

static void Register (Handler pfnHandler, const char *pszName, void *pUserData)
 Add a command to the registry.
static void Unregister (Handler pfnHandler)
 Remove the command that calls a routine.
static bool Dispatch (DataArray *pCommand)
 Run a script command through the routine registered for its name.

Detailed Description

Registry of the C++ routines a script command can call by name.

The class name is inferred.

Member Typedef Documentation

◆ Handler

typedef void(* ScriptFunction::Handler) (DataArray *pCommand, void *pUserData)

Routine a script command calls.

The dispatcher ignores the return value.

Parameters
pCommandThe command, with the command name as its first node.
pUserDataThe value given to Register().

Member Function Documentation

◆ Register()

void ScriptFunction::Register ( Handler pfnHandler,
const char * pszName,
void * pUserData )
static

Add a command to the registry.

Parameters
pfnHandlerThe routine the command calls.
pszNameThe command name.
pUserDataA value passed back to the handler unchanged.
Ghidra address:
NTSC-U/C: 0x002982c8
Ghidra address:
PAL: 0x002a1ed8

◆ Unregister()

void ScriptFunction::Unregister ( Handler pfnHandler)
static

Remove the command that calls a routine.

Parameters
pfnHandlerThe routine Register() was given.
Ghidra address:
NTSC-U/C: 0x00298520
Ghidra address:
PAL: 0x002a2130

◆ Dispatch()

bool ScriptFunction::Dispatch ( DataArray * pCommand)
static

Run a script command through the routine registered for its name.

An unregistered name is passed to DebugPrint().

Parameters
pCommandThe command, with the command name as its first node.
Returns
Whether a routine was registered for the name.
Ghidra address:
NTSC-U/C: 0x00298600
Ghidra address:
PAL: 0x002a2210

The documentation for this class was generated from the following file: