RaylibTempScalarAllocator<X, R extends RType> class final

Extends RaylibTempAllocator with the ability to write individual Dart values directly into allocated memory.

Inheritance
Implementers

Constructors

RaylibTempScalarAllocator(RaylibTemp<RaylibBase> temp, {required int byteSize, required void indexSetterFunc(MemoryPointer<R> ptr, int i, X value)})

Properties

$1Ptr → MemoryPointer<R>
Reusable single-element scratch slot, mutable (unlike $zeroPtr).
no setter
$2Ptr → MemoryPointer<R>
Reusable single-element scratch slot, mutable (unlike $zeroPtr).
no setter
$3Ptr → MemoryPointer<R>
Reusable single-element scratch slot, mutable (unlike $zeroPtr).
no setter
$4Ptr → MemoryPointer<R>
Reusable single-element scratch slot, mutable (unlike $zeroPtr).
no setter
$newPtr → MemoryPointer<R>
Fresh, independently-owned scratch pointer, unlike $zeroPtr..$4Ptr.
no setter
$zeroPtr → MemoryPointer<R>
Fixed scratch slot holding a zero-initialized value.
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<R> 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
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
slots → Map<String, (MemoryPointer<R>, int)>
Active allocation slots, keyed by slot name. Each entry holds the pointer and its element count.
finalinherited
temp → RaylibTemp<RaylibBase>
finalinherited

Methods

Array(List<X> array, {String? key}) → MemoryPointer<R>
Writes array into a slot of sufficient capacity and returns the pointer.
inherited
At(String key, [int count = 1]) → MemoryPointer<R>
Returns the pointer stored in key, allocating (or reallocating) if necessary.
inherited
AtUnique({String key = '@unique:', int count = 1}) → MemoryPointer<R>
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
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
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
Raw([int count = 1]) → MemoryPointer<R>
Allocates count raw elements and returns the wrapped pointer.
inherited
RawArray(List<X> array) → MemoryPointer<R>
Allocates an unslotted array and populates it from array.
inherited
Ref1([X? o]) → MemoryPointer<R>
Writes o into slot @slot:1 and returns its pointer.
Ref2([X? o]) → MemoryPointer<R>
Writes o into slot @slot:2 and returns its pointer.
Ref3([X? o]) → MemoryPointer<R>
Writes o into slot @slot:3 and returns its pointer.
Ref4([X? o]) → MemoryPointer<R>
Writes o into slot @slot:4 and returns its pointer.
RefOrNull1(X? o) → MemoryPointer<R>
Writes o into slot @slot:1 and returns its pointer, or returns nullptr if o is null.
RefOrNull2(X? o) → MemoryPointer<R>
Writes o into slot @slot:2 and returns its pointer, or returns nullptr if o is null.
RefOrNull3(X? o) → MemoryPointer<R>
Writes o into slot @slot:3 and returns its pointer, or returns nullptr if o is null.
RefOrNull4(X? o) → MemoryPointer<R>
Writes o into slot @slot:4 and returns its pointer, or returns nullptr if o is null.
Size([int count = 1]) → int
Returns the total byte size for count elements.
inherited
Slot(String key) → MemoryPointer<R>?
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]) → MemoryPointer<R>
Returns the pointer for the slot identified by key (default: default), writing value into it when provided.
ValueUnique(X? value, {String key = '@valueUnique:'}) → MemoryPointer<R>
Returns the pointer for the slot identified by a unique key suffix writing value into it when provided.

Operators

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