RaylibTempStringAllocator class final

Extends RaylibTempAllocator with string allocation, handling UTF-8 encoding and null-termination into temporary slots.

Inheritance

Constructors

RaylibTempStringAllocator(RaylibTemp<RaylibBase> temp, {required int byteSize, required int slotCount})

Properties

byteSize → int
Size in bytes of a single element this allocator manages.
finalinherited
hashCode → int
The hash code for this object.
no setterinherited
name ↔ String
Debug name for this allocator, used in logging and diagnostics.
getter/setter pairinherited-setteroverride-getter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
slotCount ↔ int
Number of anonymous (ring-buffer) string slots pre-reserved on construction.
getter/setter pair
slots → Map<String, (MemoryPointer<RInt8>, int)>
Active allocation slots, keyed by slot name. Each entry holds the pointer and its element count.
finalinherited
stringAnonIndex ↔ int
getter/setter pair
stringCapacities ↔ List<int>
getter/setter pair
stringSlots ↔ List<MemoryPointer<RInt8>>
getter/setter pair
stringSlotsKeyed → Map<String, int>
final
stringSlotsPtrsKeyed → Map<String, (MemoryPointer<RPointer<RChar>>, int)>
final
temp → RaylibTemp<RaylibBase>
finalinherited

Methods

Array(List<String> array, {String? key}) → MemoryPointer<RPointer<RChar>>
Writes each string in array into keyed sub-slots and returns a tracked pointer of length array.length.
At(String key, [int count = 1]) → MemoryPointer<RInt8>
Returns the pointer stored in key, allocating (or reallocating) if necessary.
inherited
AtPtr(String key, [int count = 1]) → MemoryPointer<RPointer<RChar>>
AtUnique({String key = '@unique:', int count = 1}) → MemoryPointer<RInt8>
Allocates (or reuses) a slot identified by a unique key suffix.
inherited
dispose() → void
Frees all currently tracked slots and clears the slot table.
override
Free(String key) → void
Frees the native memory owned by slot key and removes it from the table.
override
Has(String key) → bool
Returns true if a slot with the given key exists.
inherited
Length(String text, [int? bufferSize]) → int
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
Raw([int count = 1]) → MemoryPointer<RInt8>
Allocates count raw elements and returns the wrapped pointer.
inherited
RawPtr(int count) → MemoryPointer<RPointer<RChar>>
Returns the pointer of pointers.
RawValue(String text, [int? bufferSize]) → MemoryPointer<RInt8>
Returns the pointer for text.
Ref1([String? o, int? bufferSize]) → MemoryPointer<RInt8>
Writes o into slot @slot:1 and returns its pointer.
Ref2([String? o, int? bufferSize]) → MemoryPointer<RInt8>
Writes o into slot @slot:2 and returns its pointer.
Ref3([String? o, int? bufferSize]) → MemoryPointer<RInt8>
Writes o into slot @slot:3 and returns its pointer.
Ref4([String? o, int? bufferSize]) → MemoryPointer<RInt8>
Writes o into slot @slot:4 and returns its pointer.
RefOrNull1(String? o, [int? bufferSize]) → MemoryPointer<RInt8>
Writes o into slot @slot:1 and returns its pointer, or returns nullptr if o is null.
RefOrNull2(String? o, [int? bufferSize]) → MemoryPointer<RInt8>
Writes o into slot @slot:2 and returns its pointer, or returns nullptr if o is null.
RefOrNull3(String? o, [int? bufferSize]) → MemoryPointer<RInt8>
Writes o into slot @slot:3 and returns its pointer, or returns nullptr if o is null.
RefOrNull4(String? o, [int? bufferSize]) → MemoryPointer<RInt8>
Writes o into slot @slot:4 and returns its pointer, or returns nullptr if o is null.
reset() → void
Resets all slot bookkeeping structures to their initial state.
Size([int count = 1]) → int
Returns the total byte size for count elements.
inherited
Slot(String key) → MemoryPointer<RChar>?
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(String text, [String? key, int? bufferSize]) → MemoryPointer<RInt8>
Returns the pointer for text using the next anonymous ring-buffer slot.
ValueAt(String key, [String? text, int? bufferSize]) → MemoryPointer<RInt8>
Returns the pointer for the keyed slot key, optionally writing text into it.
ValueAtUnique(String text, {String key = '@valueUnique:', int? bufferSize}) → MemoryPointer<RInt8>
Returns the pointer for the slot identified by a unique key suffix optionally writing text into it.
ValueOrNull([String? text, String? key, int? bufferSize]) → MemoryPointer<RInt8>
Writes text into slot using Value and returns its pointer, or returns nullptr if text is null.

Operators

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