RTempLitPtrAlloc<X, T extends NativeType> class

A slot-based allocator for arrays of pointers to literal elements.

Manages Pointer<Pointer<T>> slots; each inner pointer is produced by rawArrayFunc from a List<X>.

Inheritance

Constructors

RTempLitPtrAlloc(RaylibTemp temp, String name, {required Pointer<Pointer<T>> allocatorFunc([int count]), required String printerFunc(Pointer<Pointer<T>> ptr), required Pointer<T> rawArrayFunc(List<X> array)})

Properties

allocatorFunc Pointer<Pointer<T>> Function([int count])
Low-level allocation function. Called with an element count and returns a freshly allocated Pointer<T>.
getter/setter pairinherited
hashCode int
The hash code for this object.
no setterinherited
name String
Human-readable name for this allocator, used in debug/log messages.
finalinherited
printerFunc String Function(Pointer<Pointer<T>> ptr)
Debug printer: converts a Pointer<T> to a human-readable string.
getter/setter pairinherited
rawArrayFunc Pointer<T> Function(List<X> array)
Converts a flat List<X> into an allocated Pointer<T> array.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

At(String key, [int count = 1]) Pointer<Pointer<T>>
Returns the Pointer<T> stored in key, allocating (or reallocating) if necessary.
inherited
Fill(List<List<X>> arrays, {String? key}) Pointer<Pointer<T>>
Writes each sub-array in arrays into a tracked slot via rawArrayFunc and returns the outer Pointer<Pointer<T>>]
FillRaw(int count, Pointer<T> init(int), {String? key}) Pointer<Pointer<T>>
Fills a tracked slot of count pointers by calling init(i) for each index and storing the result.
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]) Pointer<Pointer<T>>
Allocates an unslotted Pointer<Pointer<T>> of count elements.
RawArray(List<List<X>> arrays) Pointer<Pointer<T>>
Allocates an unslotted pointer-of-pointers from a list of value arrays.
signature() String
Returns a string that identifies the concrete type of this allocator, including its type parameters (e.g. "RTempAlloc<Float>").
override
Slot(String key) Pointer<Pointer<T>>?
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

Operators

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