RaylibTempStringAllocator class final
Extends RaylibTempAllocator with string allocation, handling UTF-8 encoding and null-termination into temporary slots.
- Inheritance
-
- Object
- RaylibTempAllocator<
RChar> - RaylibTempStringAllocator
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< , int)>RChar> > -
final
-
temp
→ RaylibTemp<
RaylibBase> -
finalinherited
Methods
-
Array(
List< String> array, {String? key}) → MemoryPointer<RPointer< RChar> > -
Writes each string in
arrayinto keyed sub-slots and returns a tracked pointer of lengtharray.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
keysuffix.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
keyand removes it from the table.override -
Has(
String key) → bool -
Returns
trueif a slot with the givenkeyexists.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
countraw 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
ointo slot@slot:1and returns its pointer. -
Ref2(
[String? o, int? bufferSize]) → MemoryPointer< RInt8> -
Writes
ointo slot@slot:2and returns its pointer. -
Ref3(
[String? o, int? bufferSize]) → MemoryPointer< RInt8> -
Writes
ointo slot@slot:3and returns its pointer. -
Ref4(
[String? o, int? bufferSize]) → MemoryPointer< RInt8> -
Writes
ointo slot@slot:4and returns its pointer. -
RefOrNull1(
String? o, [int? bufferSize]) → MemoryPointer< RInt8> -
Writes
ointo slot@slot:1and returns its pointer, or returnsnullptrifoisnull. -
RefOrNull2(
String? o, [int? bufferSize]) → MemoryPointer< RInt8> -
Writes
ointo slot@slot:2and returns its pointer, or returnsnullptrifoisnull. -
RefOrNull3(
String? o, [int? bufferSize]) → MemoryPointer< RInt8> -
Writes
ointo slot@slot:3and returns its pointer, or returnsnullptrifoisnull. -
RefOrNull4(
String? o, [int? bufferSize]) → MemoryPointer< RInt8> -
Writes
ointo slot@slot:4and returns its pointer, or returnsnullptrifoisnull. -
reset(
) → void - Resets all slot bookkeeping structures to their initial state.
-
Size(
[int count = 1]) → int -
Returns the total byte size for
countelements.inherited -
Slot(
String key) → MemoryPointer< RChar> ? -
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(
String text, [String? key, int? bufferSize]) → MemoryPointer< RInt8> -
Returns the pointer for
textusing the next anonymous ring-buffer slot. -
ValueAt(
String key, [String? text, int? bufferSize]) → MemoryPointer< RInt8> -
Returns the pointer for the keyed slot
key, optionally writingtextinto it. -
ValueAtUnique(
String text, {String key = '@valueUnique:', int? bufferSize}) → MemoryPointer< RInt8> -
Returns the pointer for the slot identified by a unique
keysuffix optionally writingtextinto it. -
ValueOrNull(
[String? text, String? key, int? bufferSize]) → MemoryPointer< RInt8> -
Writes
textinto slot usingValueand returns its pointer, or returnsnullptriftextisnull.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited