WasmStringAlloc class

Inheritance
Mixed-in types

Constructors

WasmStringAlloc(RaylibTemp temp, String name, {required int slotCount})

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
freeFunc → void Function(int ptr)
Frees the memory at ptr.
finalinherited
freePPFunc ↔ void Function(WasmStringPointerPointer ptr)
latefinaloverride-getter
hashCode int
The hash code for this object.
no setterinherited
indexSetterFunc ↔ void Function(WasmStringPointerPointer ptrptr, int i, WasmStringPointer ptr)
latefinaloverride-getter
isPointerNull bool Function(WasmStringPointer ptr)
Returns true if ptr is null or zero.
finalinherited
name String
Debug name for this allocator, used in logging and diagnostics.
finalinherited
nullptrFactory WasmStringPointer Function()
Returns a null/zero pointer of type P.
finalinherited
pointerFactory WasmStringPointer Function(int ptr)
Wraps a source pointer ptr into the platform pointer type P.
finalinherited
pointerToSource int Function(WasmStringPointer ptr)
Unwraps a platform pointer ptr back to its source type S.
finalinherited
printerFunc String Function(WasmStringPointer ptr)
Returns a human-readable string representation of ptr.
finalinherited
ptrAllocatorFunc WasmStringPointerPointer Function(int count)
latefinaloverride-getter
ptrByteSize int
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
slotCount int
Number of anonymous (ring-buffer) string slots pre-reserved on construction.
final
slots Map<String, (WasmStringPointer, int)>
Active allocation slots, keyed by slot name. Each entry holds the pointer and its element count.
finalinherited
stringAnonIndex int
getter/setter pairinherited
stringCapacities List<int>
getter/setter pairinherited
stringSlots List<WasmStringPointer>
getter/setter pairinherited
stringSlotsKeyed Map<String, int>
finalinherited
stringSlotsPtrsKeyed Map<String, (WasmStringPointerPointer, int)>
finalinherited
temp RaylibTemp
finalinherited

Methods

Array(List<String> array, {String? key}) WasmStringPointerPointer
Writes each string in array into keyed sub-slots and returns a tracked PP of length array.length.
inherited
At(String key, [int count = 1]) WasmStringPointer
Returns the P stored in key, allocating (or reallocating) if necessary.
inherited
AtPtr(String key, [int count = 1]) WasmStringPointerPointer
inherited
AtUnique(String key, [int count = 1]) WasmStringPointer
Allocates (or reuses) a slot identified by a unique key suffix.
inherited
dispose() → void
Frees all currently tracked slots and clears the slot table.
inherited
Fill(int count, WasmStringPointer init(int), {String? key}) WasmStringPointerPointer
Fills a tracked PP of count elements by calling init for each index.
inherited
Free(String key) → void
Frees the native memory owned by slot key and removes it from the table.
inherited
Has(String key) bool
Returns true if a slot with the given key exists.
inherited
Length(String text, [int? bufferSize]) int
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
Raw([int count = 1]) WasmStringPointer
Allocates count raw elements and returns the wrapped pointer.
inherited
reallocSlotIfRequired(int slot, int length) → void
inherited
Ref1([String? o, int? bufferSize]) WasmStringPointer
Writes o into slot '1' and returns its pointer.
inherited
Ref2([String? o, int? bufferSize]) WasmStringPointer
Writes o into slot '2' and returns its pointer.
inherited
Ref3([String? o, int? bufferSize]) WasmStringPointer
Writes o into slot '3' and returns its pointer.
inherited
Ref4([String? o, int? bufferSize]) WasmStringPointer
Writes o into slot '4' and returns its pointer.
inherited
RefOrNull1(String? o) WasmStringPointer
Writes o into slot '1' and returns its pointer, or returns nullptr if o is null.
inherited
RefOrNull2(String? o) WasmStringPointer
Writes o into slot '2' and returns its pointer, or returns nullptr if o is null.
inherited
RefOrNull3(String? o) WasmStringPointer
Writes o into slot '3' and returns its pointer, or returns nullptr if o is null.
inherited
RefOrNull4(String? o) WasmStringPointer
Writes o into slot '4' and returns its pointer, or returns nullptr if o is null.
inherited
reset() → void
Resets all slot bookkeeping structures to their initial state.
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) WasmStringPointer?
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(String text, [String? key]) WasmStringPointer
Returns a P for text using the next anonymous ring-buffer slot.
inherited
ValueAt(String key, [String? text, int? bufferSize]) WasmStringPointer
Returns the P for the keyed slot key, optionally writing text into it.
inherited
ValueOrNull([String? text, String? key]) WasmStringPointer
Writes text into slot using Value and returns its pointer, or returns nullptr if text is null.
inherited
writeToSlot(int slot, String text, [int? bufferSize]) WasmStringPointer
Writes text into slot slot, reallocating if the current capacity is insufficient for the UTF-8 encoded length.
override

Operators

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