RTempLitAlloc<X, T extends NativeType> class

A RTempAlloc that also knows how to write Dart values of type X into native T memory, and supports typed-list array operations.

X is the Dart-side value type (e.g. int, double). T is the corresponding NativeType (e.g. Int32, Float).

Inheritance
Implementers

Constructors

RTempLitAlloc(RaylibTemp temp, String name, {required Pointer<T> allocatorFunc([int count]), required String printerFunc(Pointer<T> ptr), required Pointer<T> castFunc(Pointer<NativeType> ptr), required int sizeOfFunc(), required void literalSetterFunc(Pointer<T> ptr, X value), required void indexSetterFunc(Pointer<T> ptr, int i, X value)})

Properties

allocatorFunc Pointer<T> Function([int count])
Low-level allocation function. Called with an element count and returns a freshly allocated Pointer<T>.
getter/setter pairinherited
castFunc Pointer<T> Function(Pointer<NativeType> ptr)
Casts an untyped Pointer to Pointer<T>.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
indexSetterFunc ↔ void Function(Pointer<T> ptr, int i, X value)
Writes value into the i-th element of the array at ptr.
getter/setter pair
literalSetterFunc ↔ void Function(Pointer<T> ptr, X value)
Writes a single Dart value value into the memory pointed to by ptr.
getter/setter pair
name String
Human-readable name for this allocator, used in debug/log messages.
finalinherited
printerFunc String Function(Pointer<T> ptr)
Debug printer: converts a Pointer<T> to a human-readable string.
getter/setter pairinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sizeOfFunc int Function()
Returns the size in bytes of a single T element.
getter/setter pair

Methods

Array(List<X> array, {String? key}) Pointer<T>
Writes array into a slot of sufficient capacity and returns the pointer.
At(String key, [int count = 1]) Pointer<T>
Returns the Pointer<T> stored in key, allocating (or reallocating) if necessary.
inherited
Fill(int count, X init(int), {String? key}) Pointer<T>
Allocates (or reuses) a slot of count elements, populating each index i with the value returned by init(i).
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<T>
Allocates a fresh (unslotted) block of count elements and returns it.
RawArray(List<X> array) Pointer<T>
Allocates an unslotted array and populates it from array.
Ref1([X? o]) Pointer<T>
Writes o into slot '1' and returns its pointer.
Ref2([X? o]) Pointer<T>
Writes o into slot '2' and returns its pointer.
Ref3([X? o]) Pointer<T>
Writes o into slot '3' and returns its pointer.
Ref4([X? o]) Pointer<T>
Writes o into slot '4' and returns its pointer.
RefOrNull1(X? o) Pointer<T>
Writes o into slot '1' and returns its pointer, or returns nullptr if o is null.
RefOrNull2(X? o) Pointer<T>
Writes o into slot '2' and returns its pointer, or returns nullptr if o is null.
RefOrNull3(X? o) Pointer<T>
Writes o into slot '3' and returns its pointer, or returns nullptr if o is null.
RefOrNull4(X? o) Pointer<T>
Writes o into slot '4' and returns its pointer, or returns nullptr if o is null.
signature() String
Returns a string that identifies the concrete type of this allocator, including its type parameters (e.g. "RTempAlloc<Float>").
override
Size([int count = 1]) int
Returns the total byte size for count elements.
Slot(String key) 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
Value([X? value, String? key]) Pointer<T>
Returns the pointer for the slot identified by key (default: 'default'), writing value into it when provided.

Operators

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