MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / ResourceType

Class ResourceType

include/ast/component/type.h:436–461  ·  view source on GitHub ↗

AST Component::ResourceType node.

Source from the content-addressed store, hash-verified

434
435/// AST Component::ResourceType node.
436class ResourceType {
437public:
438 ResourceType() noexcept : DtorSync(true) {}
439 ResourceType(bool Sync) noexcept : DtorSync(Sync) {}
440
441 std::optional<uint32_t> getDestructor() const noexcept { return Dtor; }
442 std::optional<uint32_t> getCallback() const noexcept { return DtorCallback; }
443
444 bool IsSync() noexcept { return DtorSync; }
445 std::optional<uint32_t> &getDestructor() noexcept { return Dtor; }
446 std::optional<uint32_t> &getCallback() noexcept { return DtorCallback; }
447
448 bool isAddrI64() const noexcept { return AddrI64; }
449 void setAddrI64(bool V) noexcept { AddrI64 = V; }
450
451private:
452 // Destructor is sync or not. True for sync, false for async.
453 bool DtorSync;
454 // Resource address width. False = i32 (0x7f), true = i64 (0x7e, memory64
455 // proposal).
456 bool AddrI64 = false;
457 // Destructor function index.
458 std::optional<uint32_t> Dtor;
459 // Destructor callback function index.
460 std::optional<uint32_t> DtorCallback;
461};
462
463// =============================================================================
464// Part 7: Type definition.

Callers 1

TESTFunction · 0.85

Calls

no outgoing calls

Tested by 1

TESTFunction · 0.68