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
-
- Object
- RaylibTempAllocator<
RStruct> - RaylibTempArrayAllocator<
X, RStruct> - RaylibTempStructAllocator
Constructors
-
RaylibTempStructAllocator(RaylibTemp<
RaylibBase> temp, {required StructType<X> struct})
Properties
-
$
→ RaylibTempStructPointerAllocator<
X> -
Pointer allocator for this struct
X.latefinal - $1 → X
-
Xview 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
-
Xview 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
-
Xview of $3Ptr.no setter -
$3Ptr
→ StructPointer<
X> -
Reusable single-element scratch slot, parallel to $1Ptr/$2Ptr.
no setter
- $4 → X
-
Xview of $4Ptr.no setter -
$4Ptr
→ StructPointer<
X> -
Reusable single-element scratch slot, parallel to $1Ptr..$3Ptr.
no setter
- $new → X
-
Xview of $newPtr.no setter -
$newPtr
→ StructPointer<
X> -
Fresh, independently-owned scratch pointer, unlike $zeroPtr/$1Ptr..$4Ptr.
no setter
- $zero → X
-
Xview 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
Xstruct, 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
valueinto thei-th element of the array atptr.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
valueto a tracked slot atkey. -
Array(
List< X> array, {String? key}) → MemoryPointer<RStruct> -
Writes
arrayinto 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
keysuffix.inherited -
AtUniqueStruct(
{String key = '_unique_', int count = 1}) → StructPointer< X> -
Copy(
MemoryPointer< RType> src, int length, {String? key}) → StructPointer<X> -
Copies
lengthstructs fromsrcinto 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
keyand removes it from the table.inherited -
getBaseKey(
X value, [String? inner]) → String -
Builds a RaylibTemp slot key from
value'stagand an optionalinnersuffix. -
Has(
String key) → bool -
Returns
trueif a slot with the givenkeyexists.inherited -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
Raw(
[int count = 1]) → MemoryPointer< RStruct> -
Allocates
countraw 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
valueinto it. -
Ref1(
[X? o]) → StructPointer< X> -
Allocates
ointo slot@slot:1, or reuses the existing slot@slot:1allocation ifoisnull. -
Ref2(
[X? o]) → StructPointer< X> -
Allocates
ointo slot@slot:2, or reuses the existing slot@slot:2allocation ifoisnull. -
Ref3(
[X? o]) → StructPointer< X> -
Allocates
ointo slot@slot:3, or reuses the existing slot@slot:3allocation ifoisnull. -
Ref4(
[X? o]) → StructPointer< X> -
Allocates
ointo slot@slot:4, or reuses the existing slot@slot:4allocation ifoisnull. -
Ref5(
[X? o]) → StructPointer< X> -
Allocates
ointo slot@slot:5, or reuses the existing slot@slot:5allocation ifoisnull. -
Ref6(
[X? o]) → StructPointer< X> -
Allocates
ointo slot@slot:6, or reuses the existing slot@slot:6allocation ifoisnull. -
Ref7(
[X? o]) → StructPointer< X> -
Allocates
ointo slot@slot:7, or reuses the existing slot@slot:7allocation ifoisnull. -
Ref8(
[X? o]) → StructPointer< X> -
Allocates
ointo slot@slot:8, or reuses the existing slot@slot:8allocation ifoisnull. -
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
keyand passes it tofn. -
RefOrNull1(
[X? o]) → StructPointer< X> -
Allocates
ointo slot@slot:1, or returnsnullptrifoisnull. -
RefOrNull2(
[X? o]) → StructPointer< X> -
Allocates
ointo slot@slot:2, or returnsnullptrifoisnull. -
RefOrNull3(
[X? o]) → StructPointer< X> -
Allocates
ointo slot@slot:3, or returnsnullptrifoisnull. -
RefOrNull4(
[X? o]) → StructPointer< X> -
Allocates
ointo slot@slot:4, or returnsnullptrifoisnull. -
RefOrNull5(
[X? o]) → StructPointer< X> -
Allocates
ointo slot@slot:5, or returnsnullptrifoisnull. -
RefOrNull6(
[X? o]) → StructPointer< X> -
Allocates
ointo slot@slot:6, or returnsnullptrifoisnull. -
RefOrNull7(
[X? o]) → StructPointer< X> -
Allocates
ointo slot@slot:7, or returnsnullptrifoisnull. -
RefOrNull8(
[X? o]) → StructPointer< X> -
Allocates
ointo slot@slot:8, or returnsnullptrifoisnull. -
RefUnique(
X? x) → StructPointer< X> -
Size(
[int count = 1]) → int -
Returns the total byte size for
countelements.inherited -
Slot(
String key) → MemoryPointer< RStruct> ? -
Returns the pointer stored under
key, ornullif 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
keyfrom the table without freeing the underlying memory.inherited -
Value(
[X? value, String? key]) → StructPointer< X> -
Returns the pointer for slot
key, optionally writingvalueinto it. -
ValueUnique(
X? value, {String key = '__value_unique__'}) → StructPointer< X> -
Returns the pointer for the slot identified by a unique
keysuffix optionally writingvalueinto it.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited