RTempStructPtrAlloc<T extends Struct, X extends StructD<X, T>> class

A slot-based allocator for arrays of pointers to native structs of type T.

Manages Pointer<Pointer<T>> slots where each inner Pointer<T> is produced from a List<X> via rawArrayFunc.

Inheritance

Constructors

RTempStructPtrAlloc(RaylibTemp temp, String name, {required Pointer<Pointer<T>> allocatorFunc([int count]), required String printerFunc(Pointer<Pointer<T>> ptr), required Pointer<T> valueFunc([X?, String?]), required Pointer<T> rawArrayFunc(List<X> array), required void indexSetterFunc(Pointer<Pointer<T>> ptr, int i, Pointer<T> value)})

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
indexSetterFunc ↔ void Function(Pointer<Pointer<T>> ptr, int i, Pointer<T> value)
Overwrites the i-th element of the array at ptr with value.
getter/setter pair
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 List<X> of Dart struct wrappers into an allocated Pointer<T> array.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
valueFunc Pointer<T> Function([X?, String?])
Converts an X of Dart struct wrapper into an allocated Pointer<T> pointer.
getter/setter pair

Methods

Array(List<X> array, {String? key}) Pointer<Pointer<T>>
Writes array into a tracked slot of sufficient capacity.
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 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.
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 struct 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