载入中...
搜索中...
未找到
SquirrelBinding.h 文件参考

The single Squirrel projection for common Result, Status and Value. 更多...

#include "common/Export.h"
#include "common/Result.h"
#include "common/Value.h"
#include <squirrel.h>
#include <simplesquirrel/simplesquirrel.hpp>
#include <cstddef>
#include <functional>
#include <string>
#include <type_traits>
#include <utility>

浏览源代码.

类

struct  eve::script::SquirrelValueOptions
 Limits and provenance used by the Squirrel ↔ Value adapter. 更多...
 
struct  eve::script::RootTable
 Receiver marker for callFunction(): bind the VM's root table as this. 更多...
 

命名空间

namespace  eve
 Build metadata (engine git commit, build time, third-party version).
 
namespace  eve::script
 

函数

Result< Value > eve::script::valueFromSquirrel (HSQUIRRELVM vm, SQInteger index, const SquirrelValueOptions &options={})
 Convert one Squirrel value into the canonical owning Value tree.
 
Result< Value > eve::script::valueFromSquirrel (const ssq::Object &object, const SquirrelValueOptions &options={})
 Convert a rooted Squirrel object into the canonical owning Value tree.
 
Result< void > eve::script::pushValue (HSQUIRRELVM vm, const Value &value, const SquirrelValueOptions &options={})
 Push a canonical Value into the active Squirrel VM.
 
ssq::Table eve::script::projectDiagnostic (HSQUIRRELVM vm, const Diagnostic &diagnostic)
 Project one Diagnostic using the common script table schema.
 
ssq::Table eve::script::projectStatus (HSQUIRRELVM vm, const Status &status)
 Project one Status using the common script table schema.
 
template<typename Receiver >
void eve::script::pushReceiver (HSQUIRRELVM vm, const Receiver &receiver)
 Push one callFunction() receiver (the root-table marker or a value).
 
template<typename Arg >
decltype(auto) eve::script::scriptArgument (const Arg &arg)
 Prepare one callFunction() argument, converting C strings to std::string.
 
std::string eve::script::reportScriptCallFailure (HSQUIRRELVM vm, const char *what)
 Report a failed engine-to-script call, consuming the VM's script error.
 
int eve::script::reportedScriptCallFailures ()
 Count of engine-to-script call failures reported since the last reset.
 
void eve::script::resetReportedScriptCallFailures ()
 Clear the failure count and the deduplication memory (diagnostics and tests).
 
SQRESULT eve::script::compileAndRunChunk (HSQUIRRELVM vm, const char *name, const char *source)
 Compile and run one embedded script chunk against the root table.
 
template<typename Receiver , typename... Args>
SQRESULT eve::script::callFunction (HSQUIRRELVM vm, const HSQOBJECT &fn, const Receiver &receiver, Args &&... args)
 Call a script function, deriving sq_call's parameter count from the pushes.
 
template<typename Receiver , typename... Args>
SQRESULT eve::script::callFunctionResult (HSQUIRRELVM vm, const HSQOBJECT &fn, const Receiver &receiver, Args &&... args)
 callFunction() that keeps the return value on top for the caller to read.
 
ssq::Table eve::script::projectStatusResult (HSQUIRRELVM vm, const Status &status)
 Project a checked native status that carries no payload.
 
ssq::Table eve::script::projectStatusResult (HSQUIRRELVM vm, const Status &status, const Value &value)
 Project a checked native status together with its canonical payload.
 
ssq::Table eve::script::projectStatusResult (HSQUIRRELVM vm, const Status &status, ssq::Object value)
 Project a checked native status together with an already-bound script object.
 
void eve::script::markResultHasValue (ssq::Table &result)
 Declare that a projected table received a payload the caller attached itself.
 
template<class T , class Projector >
ssq::Table eve::script::projectResult (HSQUIRRELVM vm, Result< T > &&result, Projector &&projector)
 Consume and project a value-bearing native Result.
 
ssq::Table eve::script::projectResult (HSQUIRRELVM vm, Result< void > &&result)
 Consume and project a void native Result using the common schema.
 
bool eve::script::ignoreResult (const ssq::Object &result, const std::string &reason)
 Mark a projected Result table as intentionally ignored by script.
 
void eve::script::exposeResultBindings (ssq::Table &eveTable)
 Expose the common script helpers under eve.result.
 
void eve::script::exposeProviderBindings (ssq::Table &eveTable)
 Expose eve.provider: script-published providers and capability seams.
 

变量

constexpr RootTable eve::script::rootTable {}
 

详细描述

The single Squirrel projection for common Result, Status and Value.

The conversion surface deliberately lives in common. Domain bindings may project their own checked result payload into eve::Value, but they must not invent a second result-table schema or a second recursive Squirrel value converter.

在文件 SquirrelBinding.h 中定义.