GS: Add GSAsyncMode(bool) class to set async mode of script DoCommands

In asynchronous mode, don't wait for result of executed command,
just fire-and-forget, and return estimated cost/result
This commit is contained in:
Jonathan G Rennison
2023-05-23 20:52:08 +01:00
parent df6c35a48a
commit cd9930542d
9 changed files with 214 additions and 5 deletions

View File

@@ -28,6 +28,11 @@ struct CommandAuxiliaryBase;
*/
typedef bool (ScriptModeProc)();
/**
* The callback function for Async Mode-classes.
*/
typedef bool (ScriptAsyncModeProc)();
/**
* Uper-parent object of all API classes. You should never use this class in
* your script, as it doesn't publish any public functions. It is used
@@ -173,6 +178,21 @@ protected:
*/
static ScriptObject *GetDoCommandModeInstance();
/**
* Set the current async mode of your script to this proc.
*/
static void SetDoCommandAsyncMode(ScriptAsyncModeProc *proc, ScriptObject *instance);
/**
* Get the current async mode your script is currently under.
*/
static ScriptModeProc *GetDoCommandAsyncMode();
/**
* Get the instance of the current async mode your script is currently under.
*/
static ScriptObject *GetDoCommandAsyncModeInstance();
/**
* Set the delay of the DoCommand.
*/