载入中...
搜索中...
未找到
SquirrelBinding.h
浏览该文件的文档.
51[[nodiscard]] EVENGINE_API_FOUNDATION Result<Value> valueFromSquirrel(HSQUIRRELVM vm, SQInteger index,
75[[nodiscard]] EVENGINE_API_FOUNDATION ssq::Table projectDiagnostic(HSQUIRRELVM vm, const Diagnostic& diagnostic);
78[[nodiscard]] EVENGINE_API_FOUNDATION ssq::Table projectStatus(HSQUIRRELVM vm, const Status& status);
180EVENGINE_API_FOUNDATION SQRESULT compileAndRunChunk(HSQUIRRELVM vm, const char* name, const char* source);
212SQRESULT callFunction(HSQUIRRELVM vm, const HSQOBJECT& fn, const Receiver& receiver, Args&&... args) {
240SQRESULT callFunctionResult(HSQUIRRELVM vm, const HSQOBJECT& fn, const Receiver& receiver, Args&&... args) {
264[[nodiscard]] EVENGINE_API_FOUNDATION ssq::Table projectStatusResult(HSQUIRRELVM vm, const Status& status);
273[[nodiscard]] EVENGINE_API_FOUNDATION ssq::Table projectStatusResult(HSQUIRRELVM vm, const Status& status,
284[[nodiscard]] EVENGINE_API_FOUNDATION ssq::Table projectStatusResult(HSQUIRRELVM vm, const Status& status,
309[[nodiscard]] ssq::Table projectResult(HSQUIRRELVM vm, Result<T>&& result, Projector&& projector) {
315 return projectStatusResult(vm, status, std::invoke(std::forward<Projector>(projector), std::move(payload)));
319[[nodiscard]] EVENGINE_API_FOUNDATION ssq::Table projectResult(HSQUIRRELVM vm, Result<void>&& result);
327[[nodiscard]] EVENGINE_API_FOUNDATION bool ignoreResult(const ssq::Object& result, const std::string& reason);
#define EVENGINE_API_FOUNDATION_INLINE
仅供"只有内联成员"的类型使用的组宏:拥有者 dllexport,消费方不导入。
Definition Export.h:170
Move-only, checked operation results for the common layer.
Owning, renderer-independent dynamic values.
Definition BindingContracts.h:5
SQRESULT callFunction(HSQUIRRELVM vm, const HSQOBJECT &fn, const Receiver &receiver, Args &&... args)
Call a script function, deriving sq_call's parameter count from the pushes.
Definition SquirrelBinding.h:212
bool ignoreResult(const ssq::Object &result, const std::string &reason)
Mark a projected Result table as intentionally ignored by script.
Definition SquirrelBinding.cpp:545
int reportedScriptCallFailures()
Count of engine-to-script call failures reported since the last reset.
Definition SquirrelBinding.cpp:75
SQRESULT compileAndRunChunk(HSQUIRRELVM vm, const char *name, const char *source)
Compile and run one embedded script chunk against the root table.
Definition SquirrelBinding.cpp:59
ssq::Table projectDiagnostic(HSQUIRRELVM vm, const Diagnostic &diagnostic)
Project one Diagnostic using the common script table schema.
Definition SquirrelBinding.cpp:456
SQRESULT callFunctionResult(HSQUIRRELVM vm, const HSQOBJECT &fn, const Receiver &receiver, Args &&... args)
callFunction() that keeps the return value on top for the caller to read.
Definition SquirrelBinding.h:240
void resetReportedScriptCallFailures()
Clear the failure count and the deduplication memory (diagnostics and tests).
Definition SquirrelBinding.cpp:81
Result< void > pushValue(HSQUIRRELVM vm, const Value &value, const SquirrelValueOptions &options)
Push a canonical Value into the active Squirrel VM.
Definition SquirrelBinding.cpp:439
void markResultHasValue(ssq::Table &result)
Declare that a projected table received a payload the caller attached itself.
Definition SquirrelBinding.cpp:538
ssq::Table projectStatus(HSQUIRRELVM vm, const Status &status)
Project one Status using the common script table schema.
Definition SquirrelBinding.cpp:520
ssq::Table projectStatusResult(HSQUIRRELVM vm, const Status &status)
Project a checked native status that carries no payload.
Definition SquirrelBinding.cpp:524
ssq::Table projectResult(HSQUIRRELVM vm, Result< void > &&result)
Consume and project a void native Result using the common schema.
Definition SquirrelBinding.cpp:540
void exposeProviderBindings(ssq::Table &eveTable)
Expose eve.provider: script-published providers and capability seams.
Definition SquirrelBinding.cpp:606
std::string reportScriptCallFailure(HSQUIRRELVM vm, const char *what)
Report a failed engine-to-script call, consuming the VM's script error.
Definition SquirrelBinding.cpp:52
void pushReceiver(HSQUIRRELVM vm, const Receiver &receiver)
Push one callFunction() receiver (the root-table marker or a value).
Definition SquirrelBinding.h:92
void exposeResultBindings(ssq::Table &eveTable)
Expose the common script helpers under eve.result.
Definition SquirrelBinding.cpp:585
Result< Value > valueFromSquirrel(HSQUIRRELVM vm, SQInteger index, const SquirrelValueOptions &options)
Convert one Squirrel value into the canonical owning Value tree.
Definition SquirrelBinding.cpp:412
decltype(auto) scriptArgument(const Arg &arg)
Prepare one callFunction() argument, converting C strings to std::string.
Definition SquirrelBinding.h:117
Receiver marker for callFunction(): bind the VM's root table as this.
Definition SquirrelBinding.h:87
Limits and provenance used by the Squirrel ↔ Value adapter.
Definition SquirrelBinding.h:36