5#ifndef WASMTIME_TYPES_TABLE_HH
6#define WASMTIME_TYPES_TABLE_HH
23 std::unique_ptr<wasm_tabletype_t, deleter> ptr;
43 std::optional<uint32_t>
max()
const {
45 if (limits->max == wasm_limits_max_default) {
65 limits.
max = wasm_limits_max_default;
72 : ptr(nullptr), ref(nullptr) {
Ref(const wasm_tabletype_t *ptr)
Creates a reference from the raw underlying C API representation.
Definition: table.hh:35
Ref(const TableType &ty)
Creates a reference to the provided TableType.
Definition: table.hh:37
std::optional< uint32_t > max() const
Returns the maximum size of this table type, in elements, if present.
Definition: table.hh:43
ValType::Ref element() const
Returns the type of value that is stored in this table.
Definition: table.hh:52
uint32_t min() const
Returns the minimum size of this table type, in elements.
Definition: table.hh:40
Type information about a WebAssembly table.
Definition: table.hh:16
TableType(const TableType &other)
Copies another table type into this one.
Definition: table.hh:82
TableType & operator=(TableType &&other)=default
Moves the table type resources from another type to this one.
TableType(ValType ty, uint32_t min, uint32_t max)
Definition: table.hh:71
TableType(Ref other)
Clones the given reference into a new table type.
Definition: table.hh:80
Ref * operator->()
Returns the underlying Ref, a non-owning reference pointing to this instance.
Definition: table.hh:97
TableType(ValType ty, uint32_t min)
Definition: table.hh:62
TableType & operator=(const TableType &other)
Copies another table type into this one.
Definition: table.hh:85
TableType(TableType &&other)=default
Moves the table type resources from another type to this one.
Ref * operator*()
Returns the underlying Ref, a non-owning reference pointing to this instance.
Definition: table.hh:100
A WebAssembly table.
Definition: wasmtime.hh:766
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
Limits for tables/memories in wasm modules.
Definition: wasm.h:164
uint32_t min
Definition: wasm.h:165
uint32_t max
Definition: wasm.h:166
An opaque object representing the type of a table.
const wasm_valtype_t * wasm_tabletype_element(const wasm_tabletype_t *)
Returns the element type of this table.
wasm_tabletype_t * wasm_tabletype_new(wasm_valtype_t *, const wasm_limits_t *)
Creates a new table type.
wasm_tabletype_t * wasm_tabletype_copy(const wasm_tabletype_t *)
Creates a new value which matches the provided one.
const wasm_limits_t * wasm_tabletype_limits(const wasm_tabletype_t *)
Returns the limits of this table.
void wasm_tabletype_delete(wasm_tabletype_t *)
Deletes a type.