5#ifndef WASMTIME_TYPES_GLOBAL_HH
6#define WASMTIME_TYPES_GLOBAL_HH
22 std::unique_ptr<wasm_globaltype_t, deleter> ptr;
bool is_mutable() const
Returns whether or not this global type is mutable.
Definition: global.hh:38
Ref(const GlobalType &ty)
Creates a new reference to the specified type.
Definition: global.hh:35
Ref(const wasm_globaltype_t *ptr)
Creates a new reference from the raw underlying C API representation.
Definition: global.hh:33
ValType::Ref content() const
Returns the type of value stored within this global type.
Definition: global.hh:43
Type information about a WebAssembly global.
Definition: global.hh:15
GlobalType & operator=(GlobalType &&other)=default
Moves the underlying type information from another global into this one.
Ref * operator->()
Returns the underlying Ref, a non-owning reference pointing to this instance.
Definition: global.hh:74
GlobalType(Ref other)
Clones a reference into a uniquely owned global type.
Definition: global.hh:57
GlobalType & operator=(const GlobalType &other)
Copies other type information into this one.
Definition: global.hh:62
GlobalType(ValType ty, bool mut)
Creates a new global type from the specified value type and mutability.
Definition: global.hh:52
Ref * operator*()
Returns the underlying Ref, a non-owning reference pointing to this instance.
Definition: global.hh:77
GlobalType(const GlobalType &other)
Copies other type information into this one.
Definition: global.hh:59
GlobalType(GlobalType &&other)=default
Moves the underlying type information from another global into this one.
A WebAssembly global.
Definition: wasmtime.hh:707
Non-owning reference to a ValType, must not be used after the original ValType is deleted.
Definition: types/val.hh:91
Type information about a WebAssembly value.
Definition: types/val.hh:66
An opaque object representing the type of a global.
wasm_globaltype_t * wasm_globaltype_copy(const wasm_globaltype_t *)
Creates a new value which matches the provided one.
const wasm_valtype_t * wasm_globaltype_content(const wasm_globaltype_t *)
Returns the type of value contained in a global.
wasm_globaltype_t * wasm_globaltype_new(wasm_valtype_t *, wasm_mutability_t)
Creates a new global type.
void wasm_globaltype_delete(wasm_globaltype_t *)
Deletes a type.
wasm_mutability_t wasm_globaltype_mutability(const wasm_globaltype_t *)
Returns whether or not a global is mutable.
uint8_t wasm_mutability_t
Boolean flag for whether a global is mutable or not.
Definition: wasm.h:158