RaylibTempStructAllocator<X extends RaylibStruct<X>> class final

Extends RaylibTempAllocator with struct allocation, providing Allocate, _Ref, _RefOrNull, and _Extract helpers for Dart mirror objects (X).

Inheritance

Constructors

RaylibTempStructAllocator(RaylibTemp<RaylibBase> temp, {required StructType<X> struct})

Properties

$ → RaylibTempStructPointerAllocator<X>
Pointer allocator for this struct X.
latefinal
$1 → X
X view of $1Ptr.
no setter
$1Ptr → StructPointer<X>
Reusable single-element scratch slot, by pointer. Unlike $zeroPtr, this is expected to be written through, it's a fixed shared buffer, not a zero-invariant one, so callers may freely overwrite its contents between uses.
no setter
$2 → X
X view of $2Ptr.
no setter
$2Ptr → StructPointer<X>
Reusable single-element scratch slot, parallel to $1Ptr under a distinct key. Use when a call needs a second independent scratch struct alongside $1/$1Ptr (e.g. two out-parameters in one call).
no setter
$3 → X
X view of $3Ptr.
no setter
$3Ptr → StructPointer<X>
Reusable single-element scratch slot, parallel to $1Ptr/$2Ptr.
no setter
$4 → X
X view of $4Ptr.
no setter
$4Ptr → StructPointer<X>
Reusable single-element scratch slot, parallel to $1Ptr..$3Ptr.
no setter
$new → X
X view of $newPtr.
no setter
$newPtr → StructPointer<X>
Fresh, independently-owned scratch pointer, unlike $zeroPtr/$1Ptr..$4Ptr.
no setter
$zero → X
X view of $zeroPtr. Same read-only convention applies: do not mutate fields on this reference.
no setter
$zeroPtr → StructPointer<X>
Fixed scratch slot holding a zero-initialized X struct, by pointer.
no setter
byteSize → int
Size in bytes of a single element this allocator manages.
finalinherited
hashCode → int
The hash code for this object.
no setterinherited
indexSetterFunc → void Function(MemoryPointer<RStruct> ptr, int i, X value)
Writes value into the i-th element of the array at ptr.
finalinherited
name ↔ String
Debug name for this allocator, used in logging and diagnostics.
getter/setter pairinherited-setteroverride-getter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
slots → Map<String, (MemoryPointer<RStruct>, int)>
Active allocation slots, keyed by slot name. Each entry holds the pointer and its element count.
finalinherited
struct → StructType<X>
final
temp → RaylibTemp<RaylibBase>
finalinherited

Methods

Allocate(X value, [String? key]) → StructPointer<X>
Allocates or syncs value to a tracked slot at key.
Array(List<X> array, {String? key}) → MemoryPointer<RStruct>
Writes array into a slot of sufficient capacity and returns the pointer.
inherited
ArrayStruct(List<X> array, {String? key}) → StructPointer<X>
At(String key, [int count = 1]) → MemoryPointer<RStruct>
Returns the pointer stored in key, allocating (or reallocating) if necessary.
inherited
AtStruct(String key, [int count = 1]) → StructPointer<X>
AtUnique({String key = '@unique:', int count = 1}) → MemoryPointer<RStruct>
Allocates (or reuses) a slot identified by a unique key suffix.
inherited
AtUniqueStruct({String key = '_unique_', int count = 1}) → StructPointer<X>
Copy(MemoryPointer<RType> src, int length, {String? key}) → StructPointer<X>
Copies length structs from src into a tracked slot.
dispose() → void
Frees all currently tracked slots and clears the slot table.
override
Extract1(dynamic fn(StructPointer<X> ptr)) → X
Extracts a struct result using temporary slot @slot:1.
Extract2(dynamic fn(StructPointer<X> ptr)) → X
Extracts a struct result using temporary slot @slot:2.
Extract3(dynamic fn(StructPointer<X> ptr)) → X
Extracts a struct result using temporary slot @slot:3.
Extract4(dynamic fn(StructPointer<X> ptr)) → X
Extracts a struct result using temporary slot @slot:4.
Extract5(dynamic fn(StructPointer<X> ptr)) → X
Extracts a struct result using temporary slot @slot:5.
Extract6(dynamic fn(StructPointer<X> ptr)) → X
Extracts a struct result using temporary slot @slot:6.
Extract7(dynamic fn(StructPointer<X> ptr)) → X
Extracts a struct result using temporary slot @slot:7.
Extract8(dynamic fn(StructPointer<X> ptr)) → X
Extracts a struct result using temporary slot @slot:8.
Free(String key) → void
Frees the native memory owned by slot key and removes it from the table.
inherited
getBaseKey(X value, [String? inner]) → String
Builds a RaylibTemp slot key from value's tag and an optional inner suffix.
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
Raw([int count = 1]) → MemoryPointer<RStruct>
Allocates count raw elements and returns the wrapped pointer.
inherited
RawArray(List<X> array) → MemoryPointer<RStruct>
Allocates an unslotted array and populates it from array.
inherited
RawArrayStruct(List<X> array) → StructPointer<X>
RawStruct([int count = 1]) → StructPointer<X>
RawValue([X? value]) → StructPointer<X>
Allocates an unslotted pointer, optionally writing value into it.
Ref1([X? o]) → StructPointer<X>
Allocates o into slot @slot:1, or reuses the existing slot @slot:1 allocation if o is null.
Ref2([X? o]) → StructPointer<X>
Allocates o into slot @slot:2, or reuses the existing slot @slot:2 allocation if o is null.
Ref3([X? o]) → StructPointer<X>
Allocates o into slot @slot:3, or reuses the existing slot @slot:3 allocation if o is null.
Ref4([X? o]) → StructPointer<X>
Allocates o into slot @slot:4, or reuses the existing slot @slot:4 allocation if o is null.
Ref5([X? o]) → StructPointer<X>
Allocates o into slot @slot:5, or reuses the existing slot @slot:5 allocation if o is null.
Ref6([X? o]) → StructPointer<X>
Allocates o into slot @slot:6, or reuses the existing slot @slot:6 allocation if o is null.
Ref7([X? o]) → StructPointer<X>
Allocates o into slot @slot:7, or reuses the existing slot @slot:7 allocation if o is null.
Ref8([X? o]) → StructPointer<X>
Allocates o into slot @slot:8, or reuses the existing slot @slot:8 allocation if o is null.
RefCapture(String key, dynamic fn(StructPointer<X> ptr)) → X
Allocates a uniquely-keyed temporary slot and passes it to fn.
RefCaptureCached(String key, dynamic fn(StructPointer<X> ptr)) → X
Uses a stable temporary slot identified by key and passes it to fn.
RefOrNull1([X? o]) → StructPointer<X>
Allocates o into slot @slot:1, or returns nullptr if o is null.
RefOrNull2([X? o]) → StructPointer<X>
Allocates o into slot @slot:2, or returns nullptr if o is null.
RefOrNull3([X? o]) → StructPointer<X>
Allocates o into slot @slot:3, or returns nullptr if o is null.
RefOrNull4([X? o]) → StructPointer<X>
Allocates o into slot @slot:4, or returns nullptr if o is null.
RefOrNull5([X? o]) → StructPointer<X>
Allocates o into slot @slot:5, or returns nullptr if o is null.
RefOrNull6([X? o]) → StructPointer<X>
Allocates o into slot @slot:6, or returns nullptr if o is null.
RefOrNull7([X? o]) → StructPointer<X>
Allocates o into slot @slot:7, or returns nullptr if o is null.
RefOrNull8([X? o]) → StructPointer<X>
Allocates o into slot @slot:8, or returns nullptr if o is null.
RefUnique(X? x) → StructPointer<X>
Size([int count = 1]) → int
Returns the total byte size for count elements.
inherited
Slot(String key) → MemoryPointer<RStruct>?
Returns the pointer stored under key, or null if the slot does not exist. Does not allocate.
inherited
toString() → String
A string representation of this object.
inherited
Unslot(String key) → void
Removes the slot entry for key from the table without freeing the underlying memory.
inherited
Value([X? value, String? key]) → StructPointer<X>
Returns the pointer for slot key, optionally writing value into it.
ValueUnique(X? value, {String key = '__value_unique__'}) → StructPointer<X>
Returns the pointer for the slot identified by a unique key suffix optionally writing value into it.

Operators

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