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
-
- Object
- RTempAlloc<
T> - RTempLitAlloc
- 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
countand returns a freshly allocatedPointer<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
valueinto thei-th element of the array atptr.getter/setter pair -
literalSetterFunc
↔ void Function(Pointer<
T> ptr, X value) -
Writes a single Dart value
valueinto the memory pointed to byptr.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
Telement.getter/setter pair
Methods
-
Array(
List< X> array, {String? key}) → Pointer<T> -
Writes
arrayinto a slot of sufficient capacity and returns the pointer. -
At(
String key, [int count = 1]) → Pointer< T> -
Returns the
Pointer<T>stored inkey, allocating (or reallocating) if necessary.inherited -
Fill(
int count, X init(int), {String? key}) → Pointer< T> -
Allocates (or reuses) a slot of
countelements, populating each indexiwith the value returned byinit(i). -
Free(
String key) → void -
Frees the native memory owned by slot
keyand removes it from the table.inherited -
Has(
String key) → bool -
Returns
trueif a slot with the givenkeyexists.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
countelements and returns it. -
RawArray(
List< X> array) → Pointer<T> -
Allocates an unslotted array and populates it from
array. -
Ref1(
[X? o]) → Pointer< T> -
Writes
ointo slot'1'and returns its pointer. -
Ref2(
[X? o]) → Pointer< T> -
Writes
ointo slot'2'and returns its pointer. -
Ref3(
[X? o]) → Pointer< T> -
Writes
ointo slot'3'and returns its pointer. -
Ref4(
[X? o]) → Pointer< T> -
Writes
ointo slot'4'and returns its pointer. -
RefOrNull1(
X? o) → Pointer< T> -
Writes
ointo slot'1'and returns its pointer, or returns nullptr ifoisnull. -
RefOrNull2(
X? o) → Pointer< T> -
Writes
ointo slot'2'and returns its pointer, or returns nullptr ifoisnull. -
RefOrNull3(
X? o) → Pointer< T> -
Writes
ointo slot'3'and returns its pointer, or returns nullptr ifoisnull. -
RefOrNull4(
X? o) → Pointer< T> -
Writes
ointo slot'4'and returns its pointer, or returns nullptr ifoisnull. -
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
countelements. -
Slot(
String key) → Pointer< T> ? -
Returns the pointer stored under
key, ornullif 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
keyfrom 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'), writingvalueinto it when provided.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited