NativeStructPtrAlloc<C extends Struct, D extends StructD<C, D>> class

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

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

Inheritance
Mixed-in types

Constructors

NativeStructPtrAlloc(RaylibTemp temp, String name, {required Pointer<Pointer<C>> allocatorFunc([int count]), required Pointer<C> valueFunc([D?, String?]), required Pointer<C> rawArrayFunc(List<D> array)})

Properties

allocatorFunc Pointer<Pointer<C>> Function([int count])
Allocates count elements and returns the raw source pointer.
finalinherited
byteSize int
Size in bytes of a single element this allocator manages.
finalinherited
freeFunc → void Function(Pointer<Pointer<C>> ptr)
Frees the memory at ptr.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
indexSetterFunc ↔ void Function(Pointer<Pointer<C>> ptr, int i, Pointer<C> value)
Overwrites the i-th element of the array at ptr with value.
latefinaloverride-getter
isPointerNull bool Function(Pointer<Pointer<C>> ptr)
Returns true if ptr is null or zero.
finalinherited
name String
Debug name for this allocator, used in logging and diagnostics.
finalinherited
nullptrFactory Pointer<Pointer<C>> Function()
Returns a null/zero pointer of type P.
finalinherited
pointerFactory Pointer<Pointer<C>> Function(Pointer<Pointer<C>> ptr)
Wraps a source pointer ptr into the platform pointer type P.
finalinherited
pointerToSource Pointer<Pointer<C>> Function(Pointer<Pointer<C>> ptr)
Unwraps a platform pointer ptr back to its source type S.
finalinherited
printerFunc String Function(Pointer<Pointer<C>> ptr)
Returns a human-readable string representation of ptr.
finalinherited
rawArrayFunc Pointer<C> Function(List<D> array)
Converts a List<D> of Dart struct wrappers into an allocated P array.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
slots Map<String, (Pointer<Pointer<C>>, int)>
Active allocation slots, keyed by slot name. Each entry holds the pointer and its element count.
finalinherited
temp RaylibTemp
finalinherited
valueFunc Pointer<C> Function([D?, String?])
Converts an D of Dart struct wrapper into an allocated P pointer.
final

Methods

Array(List<D> array, {String? key}) Pointer<Pointer<C>>
Writes array into a tracked slot of sufficient capacity.
inherited
At(String key, [int count = 1]) Pointer<Pointer<C>>
Returns the P stored in key, allocating (or reallocating) if necessary.
inherited
AtUnique(String key, [int count = 1]) Pointer<Pointer<C>>
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
Fill(List<List<D>> arrays, {String? key}) Pointer<Pointer<C>>
Writes each sub-array in arrays into a tracked slot and returns the outer PP
inherited
FillRaw(int count, Pointer<C> init(int), {String? key}) Pointer<Pointer<C>>
Fills a tracked slot of count pointers by calling init(i) for each index.
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]) Pointer<Pointer<C>>
Allocates count raw elements and returns the wrapped pointer.
inherited
RawArray(List<D> array) Pointer<Pointer<C>>
Allocates an unslotted array.
inherited
RawArrayPopulated(List<List<D>> arrays) Pointer<Pointer<C>>
Allocates an unslotted pointer-of-pointers from a list of struct arrays.
inherited
signature() String
Returns a string that identifies the concrete type of this allocator, including its type parameters.
inherited
Size([int count = 1]) int
Returns the total byte size for count elements.
inherited
Slot(String key) Pointer<Pointer<C>>?
Returns the pointer stored under key, or null if the slot does not exist. Does not allocate.
inherited
slotKey([String? key]) String
Returns the canonical slot key for key, falling back to 'struct' when key is null.
inherited
toString() String
A string representation of this object.
inherited
uniqueSlotKey(String key) String
Returns a slot key guaranteed to be unique within this temp context, by prefixing key with the next available ID.
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