1#ifndef WASMTIME_TYPES_VAL_CLASS_HH
2#define WASMTIME_TYPES_VAL_CLASS_HH
27 std::unique_ptr<wasm_valtype_t, deleter> ptr;
63 return reinterpret_cast<Ref *
>(&list->
data[0]);
68 return reinterpret_cast<Ref *
>(&list->
data[list->
size]);
103 wasmtime_ty = other.wasmtime_ty;
109 ptr = std::move(other.ptr);
111 wasmtime_ty = other.wasmtime_ty;
Global compilation state in Wasmtime.
Definition: engine.hh:22
Type information for a WebAssembly function.
Definition: types/func.hh:15
Type information about a WebAssembly global.
Definition: types/global.hh:15
Representation of a reference type in WebAssembly.
Definition: types/val.hh:210
Type information about a WebAssembly table.
Definition: types/table.hh:16
Non-owning reference to a list of ValType instances. Must not be used after the original owner is del...
Definition: types/_val_class.hh:51
ListRef(const wasm_valtype_vec_t *list)
Creates a list from the raw underlying C API.
Definition: types/_val_class.hh:56
size_t size() const
Returns how many types are in this list.
Definition: types/_val_class.hh:72
iterator begin() const
Pointer to the beginning of iteration.
Definition: types/_val_class.hh:62
iterator end() const
Pointer to the end of iteration.
Definition: types/_val_class.hh:67
const Ref * iterator
This list iterates over a list of ValType::Ref instances.
Definition: types/_val_class.hh:59
Non-owning reference to a ValType, must not be used after the original ValType is deleted.
Definition: types/_val_class.hh:32
Ref(const ValType &ty)
Copy constructor.
Definition: types/_val_class.hh:41
Ref(const wasm_valtype_t *ptr)
Instantiates from the raw C API representation.
Definition: types/_val_class.hh:39
bool operator==(const Ref &other) const
Tests if this type is equal to another.
Definition: types/_val_class.hh:44
Type information about a WebAssembly value.
Definition: types/_val_class.hh:19
static ValType f64()
Convenience constructor for the f64 value type.
Definition: types/_val_class.hh:127
static ValType v128()
Convenience constructor for the v128 value type.
Definition: types/_val_class.hh:130
static ValType exnref()
Convenience constructor for the exnref value type.
Definition: types/val.hh:316
bool is_i64() const
Returns if this is the i64 wasm type.
Definition: types/_val_class.hh:180
bool is_f32() const
Returns if this is the f32 wasm type.
Definition: types/_val_class.hh:183
bool is_f64() const
Returns if this is the f64 wasm type.
Definition: types/_val_class.hh:186
static ValType i64()
Convenience constructor for the i64 value type.
Definition: types/_val_class.hh:121
const RefType * as_ref() const
Returns if this is a reference type.
Definition: types/val.hh:292
const wasm_valtype_t * capi() const
Returns the underlying C API representation of this type.
Definition: types/_val_class.hh:174
ValType & operator=(const ValType &other)
Copies the contents of another type into this one.
Definition: types/_val_class.hh:93
bool is_v128() const
Returns if this is the v128 wasm type.
Definition: types/_val_class.hh:189
static ValType i32()
Convenience constructor for the i32 value type.
Definition: types/_val_class.hh:118
static ValType f32()
Convenience constructor for the f32 value type.
Definition: types/_val_class.hh:124
Ref * operator->()
Returns the underlying Ref, a non-owning reference pointing to this instance.
Definition: types/_val_class.hh:155
Ref * operator*()
Returns the underlying Ref, a non-owning reference pointing to this instance.
Definition: types/_val_class.hh:158
ValType & operator=(ValType &&other)
Moves the memory owned by another value type into this one.
Definition: types/_val_class.hh:108
ValType(ValType &&other)
Moves the memory owned by another value type into this one.
Definition: types/_val_class.hh:102
bool is_i32() const
Returns if this is the i32 wasm type.
Definition: types/_val_class.hh:177
static ValType funcref()
Convenience constructor for the funcref value type.
Definition: types/_val_class.hh:137
bool operator==(const Ref &other) const
Equality operator, compares the underlying types for equality.
Definition: types/_val_class.hh:161
static ValType externref()
Convenience constructor for the externref value type.
Definition: types/_val_class.hh:140
static ValType anyref()
Convenience constructor for the anyref value type.
Definition: types/val.hh:308
ValType(const ValType &other)
Copies one type to a new one.
Definition: types/_val_class.hh:91
ValType(Ref other)
Copies a Ref to a new owned value.
Definition: types/_val_class.hh:89
const wasmtime_valtype_t * wasmtime_capi() const
Returns the underlying C API representation of this type.
Definition: types/_val_class.hh:171
bool operator==(const ValType &other) const
Equality operator, compares the underlying types for equality.
Definition: types/_val_class.hh:166
An object representing the type of a value.
A list of wasm_valtype_t values.
Definition: wasm.h:183
wasm_valtype_t ** data
Pointer to the base of this vector.
Definition: wasm.h:183
size_t size
Length of this vector.
Definition: wasm.h:183
A WebAssembly value type.
Definition: types/val.h:131
wasmtime_valtype_kind_t kind
Discriminant of which value type this is.
Definition: types/val.h:133
#define WASMTIME_VALTYPE_KIND_I64
The WebAssembly i64 type.
Definition: types/val.h:116
WASM_API_EXTERN wasm_valtype_t * wasmtime_valtype_to_wasm(const wasm_engine_t *engine, const wasmtime_valtype_t *ty)
Converts ty into a wasm_valtype_t and returns a pointer to it.
#define WASMTIME_VALTYPE_KIND_I32
The WebAssembly i32 type.
Definition: types/val.h:114
WASM_API_EXTERN void wasmtime_valtype_new(const wasm_valtype_t *ty, wasmtime_valtype_t *out)
Creates a new type in out from the type in ty.
WASM_API_EXTERN void wasmtime_valtype_clone(const wasmtime_valtype_t *ty, wasmtime_valtype_t *out)
Clones ty into out.
#define WASMTIME_VALTYPE_KIND_F32
The WebAssembly f32 type.
Definition: types/val.h:118
WASM_API_EXTERN bool wasmtime_wasm_valtype_equal(const wasm_valtype_t *a, const wasm_valtype_t *b)
Returns whether a is logically equal to b.
WASM_API_EXTERN void wasmtime_valtype_delete(wasmtime_valtype_t *ty)
Deletes any payload of ty, if applicable.
#define WASMTIME_VALTYPE_KIND_V128
The WebAssembly v128 type.
Definition: types/val.h:122
#define WASMTIME_VALTYPE_KIND_F64
The WebAssembly f64 type.
Definition: types/val.h:120
void wasm_valtype_delete(wasm_valtype_t *)
Deletes a type.
wasm_valtype_t * wasm_valtype_copy(const wasm_valtype_t *)
Creates a new value which matches the provided one.
wasm_valtype_t * wasm_valtype_new(wasm_valkind_t)
Creates a new value type from the specified kind.