WasmStructAlloc<T extends StructDWeb<T>> class

Inheritance
Mixed-in types

Constructors

WasmStructAlloc(RaylibTemp temp, String name, {required int byteSize, required T factory()})

Properties

allocatorFunc int Function([int count])
Allocates count elements and returns the raw source pointer.
finalinherited
byteSize int
Size in bytes of a single element this allocator manages.
finalinherited
factory → T Function()
final
freeFunc → void Function(int ptr)
Frees the memory at ptr.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
indexerFunc ↔ T Function(WasmStructPointer<T> ptr, int i)
Returns the C struct at index i of the array at ptr.
latefinaloverride-getter
indexSetterFunc ↔ void Function(WasmStructPointer<T> ptr, int i, T value)
Overwrites the i-th element of the array at ptr with value.
latefinaloverride-getter
isPointerNull bool Function(WasmStructPointer<T> ptr)
Returns true if ptr is null or zero.
finalinherited
name String
Debug name for this allocator, used in logging and diagnostics.
finalinherited
nullptrFactory WasmStructPointer<T> Function()
Returns a null/zero pointer of type P.
finalinherited
pointerFactory WasmStructPointer<T> Function(int ptr)
Wraps a source pointer ptr into the platform pointer type P.
finalinherited
pointerToSource int Function(WasmStructPointer<T> ptr)
Unwraps a platform pointer ptr back to its source type S.
finalinherited
pointerToStruct ↔ T Function(WasmStructPointer<T> ptr)
Converts a P to its Dart-side X wrapper, referencing the memory at that pointer.
latefinaloverride-getter
printerFunc String Function(WasmStructPointer<T> ptr)
Returns a human-readable string representation of ptr.
finalinherited
refFunc ↔ T Function(WasmStructPointer<T> ptr)
Returns the V struct value referenced by ptr.
latefinaloverride-getter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
setCFunc ↔ void Function(WasmStructPointer<T> ptr, int i, T value)
Copies the raw C struct value into the i-th element of the array at ptr.
latefinaloverride-getter
setRefFunc WasmStructPointer<T> Function(WasmStructPointer<T> ptr, T value)
Assigns value to the struct referenced by ptr.
latefinaloverride-getter
slots Map<String, (WasmStructPointer<T>, int)>
Active allocation slots, keyed by slot name. Each entry holds the pointer and its element count.
finalinherited
temp RaylibTemp
finalinherited
updateFunc ↔ void Function(WasmStructPointer<T> ptr, T source)
Copies the fields of source into the native memory at ptr.
latefinaloverride-getter
writeIntoFunc ↔ void Function(WasmStructPointer<T> ptr, T value)
Writes the Dart value value into the struct at ptr.
latefinaloverride-getter
writeIntoIndexedFunc ↔ void Function(WasmStructPointer<T> ptr, int i, T value)
Writes the Dart value value into the i-th element of the array at ptr.
latefinaloverride-getter

Methods

Array(List<T> array, {String? key}) WasmStructPointer<T>
Writes array into a tracked slot of sufficient capacity.
inherited
At(String key, [int count = 1]) WasmStructPointer<T>
Returns the P stored in key, allocating (or reallocating) if necessary.
inherited
AtUnique(String key, [int count = 1]) WasmStructPointer<T>
Allocates (or reuses) a slot identified by a unique key suffix.
inherited
Copy(WasmStructPointer<T> src, int length, {String? key}) WasmStructPointer<T>
Copies length structs from src into a tracked slot using setCFunc.
inherited
dispose() → void
Frees all currently tracked slots and clears the slot table.
inherited
Extract1(void fn(int ptr)) → T
Allocates slot '1' as an uninitialized sret destination, passes its raw pointer to fn, then returns the struct fn wrote into it.
inherited
Extract2(void fn(int ptr)) → T
Allocates slot '2' as an uninitialized sret destination, passes its raw pointer to fn, then returns the struct fn wrote into it.
inherited
Extract3(void fn(int ptr)) → T
Allocates slot '3' as an uninitialized sret destination, passes its raw pointer to fn, then returns the struct fn wrote into it.
inherited
Extract4(void fn(int ptr)) → T
Allocates slot '4' as an uninitialized sret destination, passes its raw pointer to fn, then returns the struct fn wrote into it.
inherited
Extract5(void fn(int ptr)) → T
Allocates slot '5' as an uninitialized sret destination, passes its raw pointer to fn, then returns the struct fn wrote into it.
inherited
Extract6(void fn(int ptr)) → T
Allocates slot '6' as an uninitialized sret destination, passes its raw pointer to fn, then returns the struct fn wrote into it.
inherited
Extract7(void fn(int ptr)) → T
Allocates slot '7' as an uninitialized sret destination, passes its raw pointer to fn, then returns the struct fn wrote into it.
inherited
Extract8(void fn(int ptr)) → T
Allocates slot '8' as an uninitialized sret destination, passes its raw pointer to fn, then returns the struct fn wrote into it.
inherited
Fill(int count, T init(int), {String? key}) WasmStructPointer<T>
Fills a tracked slot of count structs, producing each element via init(i) and writing it through writeIntoIndexedFunc.
inherited
FillInto(int count, void init(int, T), {String? key}) WasmStructPointer<T>
Fills a tracked slot of count structs by calling init(i, struct) which writes directly into the native struct fields.
inherited
FillWith(int count, T init(WasmStructPointer<T>, int), {String? key}) WasmStructPointer<T>
Fills a tracked slot of count structs by setting each element to the C returned by init(ptr, i).
inherited
Free(String key) → void
Frees the native memory owned by slot key and removes it from the table.
inherited
getBaseKey(T value, [String? inner]) String
Builds a RaylibTempBase slot key from value's structName, tag, and an optional inner suffix.
inherited
getBaseKeyWithId(T value, [String? inner]) String
Like getBaseKey but prefixed with value's internalId, used for pointer-owning structs to prevent cross-instance key collisions.
inherited
Has(String key) bool
Returns true if a slot with the given key exists.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
PointerTo(T value, [String? key]) WasmStructPointer<T>
Allocates or syncs value to a tracked slot at key.
inherited
Raw([int count = 1]) WasmStructPointer<T>
Allocates count raw elements and returns the wrapped pointer.
inherited
RawArray(List<T> array) WasmStructPointer<T>
Allocates an unslotted array.
inherited
RawArrayPopulated(List<T> array) WasmStructPointer<T>
Allocates an unslotted array and populates it from array.
inherited
RawFillInto(int count, void init(int, T)) WasmStructPointer<T>
Allocates an unslotted array of count structs, populating each via init(i, struct) which writes directly into the native memory.
inherited
RawFillWith(int count, T init(WasmStructPointer<T>, int)) WasmStructPointer<T>
Allocates an unslotted array of count structs, setting each element to the C returned by init(ptr, i).
inherited
Ref1([T? o]) WasmStructPointer<T>
Allocates o into slot '1', or reuses the existing slot '1' allocation if o is null.
inherited
Ref1OrNull([T? o]) WasmStructPointer<T>
Allocates o into slot '1', or returns nullptr if o is null.
inherited
Ref2([T? o]) WasmStructPointer<T>
Allocates o into slot '2', or reuses the existing slot '2' allocation if o is null.
inherited
Ref2OrNull([T? o]) WasmStructPointer<T>
Allocates o into slot '2', or returns nullptr if o is null.
inherited
Ref3([T? o]) WasmStructPointer<T>
Allocates o into slot '3', or reuses the existing slot '3' allocation if o is null.
inherited
Ref3OrNull([T? o]) WasmStructPointer<T>
Allocates o into slot '3', or returns nullptr if o is null.
inherited
Ref4([T? o]) WasmStructPointer<T>
Allocates o into slot '4', or reuses the existing slot '4' allocation if o is null.
inherited
Ref4OrNull([T? o]) WasmStructPointer<T>
Allocates o into slot '4', or returns nullptr if o is null.
inherited
Ref5([T? o]) WasmStructPointer<T>
Allocates o into slot '5', or reuses the existing slot '5' allocation if o is null.
inherited
Ref5OrNull([T? o]) WasmStructPointer<T>
Allocates o into slot '5', or returns nullptr if o is null.
inherited
Ref6([T? o]) WasmStructPointer<T>
Allocates o into slot '6', or reuses the existing slot '6' allocation if o is null.
inherited
Ref6OrNull([T? o]) WasmStructPointer<T>
Allocates o into slot '6', or returns nullptr if o is null.
inherited
Ref7([T? o]) WasmStructPointer<T>
Allocates o into slot '7', or reuses the existing slot '7' allocation if o is null.
inherited
Ref7OrNull([T? o]) WasmStructPointer<T>
Allocates o into slot '7', or returns nullptr if o is null.
inherited
Ref8([T? o]) WasmStructPointer<T>
Allocates o into slot '8', or reuses the existing slot '8' allocation if o is null.
inherited
Ref8OrNull([T? o]) WasmStructPointer<T>
Allocates o into slot '8', or returns nullptr if o is null.
inherited
RefCapture(String key, dynamic fn(int ptr)) → T
Copies the native struct o into a uniquely-keyed tracked slot and returns its Dart-side X wrapper via pointerToStruct.
inherited
RefUpdate1<R>(T? o, R fn(WasmStructPointer<T> p)) → R
Allocates o into slot '1', calls fn with the pointer, then syncs native memory back into o via updateFunc.
inherited
RefUpdate2<R>(T? o, R fn(WasmStructPointer<T> p)) → R
Allocates o into slot '2', calls fn with the pointer, then syncs native memory back into o via updateFunc.
inherited
RefUpdate3<R>(T? o, R fn(WasmStructPointer<T> p)) → R
Allocates o into slot '3', calls fn with the pointer, then syncs native memory back into o via updateFunc.
inherited
RefUpdate4<R>(T? o, R fn(WasmStructPointer<T> p)) → R
Allocates o into slot '4', calls fn with the pointer, then syncs native memory back into o via updateFunc.
inherited
RefUpdate5<R>(T? o, R fn(WasmStructPointer<T> p)) → R
Allocates o into slot '5', calls fn with the pointer, then syncs native memory back into o via updateFunc.
inherited
RefUpdate6<R>(T? o, R fn(WasmStructPointer<T> p)) → R
Allocates o into slot '6', calls fn with the pointer, then syncs native memory back into o via updateFunc.
inherited
RefUpdate7<R>(T? o, R fn(WasmStructPointer<T> p)) → R
Allocates o into slot '7', calls fn with the pointer, then syncs native memory back into o via updateFunc.
inherited
RefUpdate8<R>(T? o, R fn(WasmStructPointer<T> p)) → R
Allocates o into slot '8', calls fn with the pointer, then syncs native memory back into o via updateFunc.
inherited
signature() String
Returns a string that identifies the concrete type of this allocator, including its type parameters.
inherited
Size([int count = 1]) int
Returns the total byte size for count elements.
inherited
Slot(String key) WasmStructPointer<T>?
Returns the pointer stored under key, or null if the slot does not exist. Does not allocate.
inherited
slotKey([String? key]) String
Returns the canonical slot key for key, falling back to 'struct' when key is null.
inherited
toString() String
A string representation of this object.
inherited
uniqueSlotKey(String key) String
Returns a slot key guaranteed to be unique within this temp context, by prefixing key with the next available ID.
inherited
Unslot(String key) → void
Removes the slot entry for key from the table without freeing the underlying memory.
inherited
Value([T? value, String? key]) WasmStructPointer<T>
Returns the pointer for slot key, optionally writing value into it.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited