载入中...
搜索中...
未找到
SquirrelOwnership.h
浏览该文件的文档.
76 explicit constexpr BorrowedSquirrelObject(const ssq::Object* object) noexcept : object_(object) {}
98[[nodiscard]] inline BorrowedSquirrelObject borrowSquirrelObject(const ssq::Object& object) noexcept {
160[[nodiscard]] inline eve::Result<OwnedSquirrelObject> ownSquirrelObject(BorrowedSquirrelObject borrowed) {
222[[nodiscard]] EVENGINE_API eve::Result<ssq::Object> makeOwnedSquirrelInstanceRaw(HSQUIRRELVM vm, void* object,
241[[nodiscard]] eve::Result<ssq::Object> makeOwnedSquirrelInstance(HSQUIRRELVM vm, Owned<T> object) {
#define EVENGINE_API_FOUNDATION_INLINE
仅供"只有内联成员"的类型使用的组宏:拥有者 dllexport,消费方不导入。
Definition Export.h:170
Move-only, checked operation results for the common layer.
Strong generation-qualified handles for non-ECS runtime registries.
Tag-free slot registry: handles, borrows, unique ownership and keep-alive pins.
Owning, renderer-independent dynamic values.
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={}, DiagnosticDetails details={}, std::string source={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.h:125
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:175
Borrowed view of a rooted Squirrel object for one synchronous call.
Definition SquirrelOwnership.h:71
constexpr const ssq::Object * get() const noexcept
Returns the borrowed object, or nullptr when unbound.
Definition SquirrelOwnership.h:89
bool isBound() const noexcept
Returns whether the view is bound to a non-empty object.
Definition SquirrelOwnership.h:91
constexpr BorrowedSquirrelObject() noexcept=default
Borrowed squirrel object.
Non-owning C++ observation with no implicit lifetime extension.
Definition RuntimeRegistry.h:42
Releases C++-owned Squirrel roots before Runtime destroys its VM.
Definition SquirrelOwnership.h:108
virtual void releaseSquirrelRoots() noexcept=0
Drops every C++-owned Squirrel root this listener still holds.
virtual ~ISquirrelRootReleaser()=default
I squirrel root releaser.
A rooted Squirrel reference owned by the C++ holder.
Definition SquirrelOwnership.h:128
ssq::Object release() &&noexcept
Transfers the rooted reference to the caller.
Definition SquirrelOwnership.h:149
bool isBound() const noexcept
Returns whether this owner contains a rooted non-empty object.
Definition SquirrelOwnership.h:147
OwnedSquirrelObject(const OwnedSquirrelObject &)=delete
OwnedSquirrelObject & operator=(const OwnedSquirrelObject &)=delete
OwnedSquirrelObject()=default
Owned squirrel object.
OwnedSquirrelObject(ssq::Object object) noexcept
Owned squirrel object.
Definition SquirrelOwnership.h:133
OwnedSquirrelObject(OwnedSquirrelObject &&) noexcept=default
Owned squirrel object.
Result< ssq::Object > makeOwnedSquirrelInstanceRaw(HSQUIRRELVM vm, void *object, SquirrelReleaseHook releaseHook, OwnedInstanceDestroy destroy, std::size_t typeHash)
Non-template core of makeOwnedSquirrelInstance.
Definition SquirrelOwnership.cpp:26
Diagnostic ownedInstanceArgumentDiagnostic()
Diagnostic for a null VM or null object, built once instead of per T.
Definition SquirrelOwnership.cpp:21
Definition BindingContracts.h:5
eve::Result< OwnedSquirrelObject > ownSquirrelObject(BorrowedSquirrelObject borrowed)
Promotes a borrowed VM object to an explicit rooted owner.
Definition SquirrelOwnership.h:160
ObjectSemantic
The only three meanings a script-facing object may have.
Definition SquirrelOwnership.h:40
@ Borrowed
BorrowedSquirrelObject borrowSquirrelObject(const ssq::Object &object) noexcept
Creates a one-call Borrowed view without retaining a VM reference.
Definition SquirrelOwnership.h:98
std::unique_ptr< T > Owned
C++ owning storage used by an object factory.
Definition RuntimeRegistry.h:33
const char * objectSemanticName(ObjectSemantic semantic) noexcept
Returns the stable name used by diagnostics and documentation.
Definition SquirrelOwnership.h:52
eve::Result< ssq::Object > makeOwnedSquirrelInstance(HSQUIRRELVM vm, Owned< T > object)
Creates a Squirrel instance that owns a C++ wrapper through a release hook.
Definition SquirrelOwnership.h:241
@ InvalidArgument