StructPointer<D extends RaylibStruct<D> > class
final
A MemoryPointer<RStruct> that also knows its element type D, so it can
offer .value/[]/[]= the similar way scalar RType extensions do.
- Inheritance
-
- Object
- MemoryPointer<
RStruct> - StructPointer
- Available extensions
Constructors
-
StructPointer(MemoryPointer<
RType> ptr, StructType<D> structType) -
StructPointer.nullable(MemoryPointer<
RType> ? ptr, StructType<D> structType) -
factory
Properties
- address → int
-
Debug/logging only. Do NOT branch logic on this.
no setteroverride
- allocationKey → String?
-
The key of the temporary allocation backing this pointer.
no setteroverride
- detached → D
-
Returns a copy of the struct's current value, detached from its
underlying memory.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- hex → String
-
address in hexadecimal format.
no setteroverride
- isFreed ↔ bool
-
If the underlying allocation has been freed.
getter/setter pairinherited
- isNull → bool
-
Check if the pointer is a
nullptr.no setteroverride -
ptr
→ MemoryPointer<
RType> -
final
- ref ↔ D
-
Returns a live view of the struct backed by this memory.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
structType
→ StructType<
D> -
final
- toJS → JSNumber
-
Available on StructPointer<
RaylibStruct> , provided by the StructPointerAsWasmPointer extensionno setter - value → D
-
Returns the current value of the struct.
no setter
Methods
-
asCopy<
T extends TypedDataList> (int length) → T -
Copies
lengthbytes, viewed asT.override -
asView<
T extends TypedDataList> (int length) → T -
Zero-copy view as
T.override -
cast<
Y extends RType> () → MemoryPointer< Y> -
Reinterprets this pointer as pointing to
Yinstead ofX.override -
compareBytes(
MemoryPointer< RType> other, int length, {int offset = 0, int otherOffset = 0}) → int -
memcmp-style comparison of
lengthbytes.override -
computeByteHash(
int byteSize) → int -
Hashes the bytes until
byteSize.override -
copyBytesFrom(
MemoryPointer< RType> src, int length, {int destOffset = 0, int srcOffset = 0}) → void -
Bulk-copies
lengthbytes fromsrcinto this pointer.override -
fillBytes(
int value, int length, [int byteOffset = 0]) → void -
Fills
lengthbytes starting atbyteOffsetwith the low byte ofvalue.override -
free(
) → void -
Frees the underlying allocation. Only call this if you
actually own it.
override
-
live(
{List< D> ? initial, bool owned = true}) → StructLiveList<D, RStruct> -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
offsetBy<
Y extends RType> (int byteOffset) → MemoryPointer< Y> -
Same buffer, address advanced by
byteOffsetbytes. Same typeX. Backends implement via pointer arithmetic (native) or address+offset (wasm).override -
owned(
int i) → D -
Returns the struct at
ias a memory-backed value. -
readArray(
int count, {bool owned = true}) → List< D> -
Reads
countstructs sequentially from the memory referenced by this pointer. -
readBool(
[int byteOffset = 0]) → bool -
Reads a value of type RBool at given
address + byteOffset.override -
readBytes(
int byteOffset, int length) → Uint8List -
Reads
lengthbytes atbyteOffset.override -
readChar(
[int byteOffset = 0]) → int -
Reads a value of type RChar at given
address + byteOffset.override -
readDouble(
[int byteOffset = 0]) → double -
Reads a value of type RDouble at given
address + byteOffset.override -
readFloat(
[int byteOffset = 0]) → double -
Reads a value of type RFloat at given
address + byteOffset.override -
readFloat32(
[int byteOffset = 0]) → double -
Reads a value of type RFloat32 at given
address + byteOffset.override -
readFloat64(
[int byteOffset = 0]) → double -
Reads a value of type RFloat64 at given
address + byteOffset.override -
readInt(
[int byteOffset = 0]) → int -
Reads a value of type RInt at given
address + byteOffset.override -
readInt16(
[int byteOffset = 0]) → int -
Reads a value of type RInt16 at given
address + byteOffset.override -
readInt32(
[int byteOffset = 0]) → int -
Reads a value of type RInt32 at given
address + byteOffset.override -
readInt64(
[int byteOffset = 0]) → int -
Reads a value of type RInt64 at given
address + byteOffset.override -
readInt8(
[int byteOffset = 0]) → int -
Reads a value of type RInt8 at given
address + byteOffset.override -
readPtr<
Y extends RType> ([int byteOffset = 0]) → MemoryPointer< Y> -
Reads a pointer value at
address + byteOffsetand returns it typed as pointing toY.override -
readShort(
[int byteOffset = 0]) → int -
Reads a value of type RShort at given
address + byteOffset.override -
readSize(
[int byteOffset = 0]) → int -
Reads a value of type RSize at given
address + byteOffset.override -
readStringUTF16(
[int? maxLength, int byteOffset = 0]) → String -
Reads a fixed-size char-buffer field as a UTF-16 string, stopping early at NUL if present.
override
-
readStringUTF32(
[int? maxLength, int byteOffset = 0]) → String -
Reads a fixed-size char-buffer field as a UTF-32 string, stopping early at NUL if present.
override
-
readStringUTF8(
[int? maxLength, int byteOffset = 0]) → String -
Reads a fixed-size char-buffer field as a UTF-8 string, stopping early at NUL if present.
override
-
readUint16(
[int byteOffset = 0]) → int -
Reads a value of type RUint16 at given
address + byteOffset.override -
readUint32(
[int byteOffset = 0]) → int -
Reads a value of type RUint32 at given
address + byteOffset.override -
readUint64(
[int byteOffset = 0]) → int -
Reads a value of type RUint64 at given
address + byteOffset.override -
readUint8(
[int byteOffset = 0]) → int -
Reads a value of type RUint8 at given
address + byteOffset.override -
readUnsignedChar(
[int byteOffset = 0]) → int -
Reads a value of type RUnsignedChar at given
address + byteOffset.override -
readUnsignedInt(
[int byteOffset = 0]) → int -
Reads a value of type RUnsignedInt at given
address + byteOffset.override -
readUnsignedShort(
[int byteOffset = 0]) → int -
Reads a value of type RUnsignedShort at given
address + byteOffset.override -
toString(
) → String -
A string representation of this object.
inherited
-
writeArray(
List< D> items) → void -
Writes
itemssequentially into the memory referenced by this pointer. -
writeBool(
bool value, [int byteOffset = 0]) → void -
Writes a
valueof type RBool at givenaddress + byteOffset.override -
writeChar(
int value, [int byteOffset = 0]) → void -
Writes a
valueof type RChar at givenaddress + byteOffset.override -
writeDouble(
double value, [int byteOffset = 0]) → void -
Writes a
valueof type RDouble at givenaddress + byteOffset.override -
writeFloat(
double value, [int byteOffset = 0]) → void -
Writes a
valueof type RFloat at givenaddress + byteOffset.override -
writeFloat32(
double value, [int byteOffset = 0]) → void -
Writes a
valueof type RFloat32 at givenaddress + byteOffset.override -
writeFloat64(
double value, [int byteOffset = 0]) → void -
Writes a
valueof type RFloat64 at givenaddress + byteOffset.override -
writeInt(
int value, [int byteOffset = 0]) → void -
Writes a
valueof type RInt at givenaddress + byteOffset.override -
writeInt16(
int value, [int byteOffset = 0]) → void -
Writes a
valueof type RInt16 at givenaddress + byteOffset.override -
writeInt32(
int value, [int byteOffset = 0]) → void -
Writes a
valueof type RInt32 at givenaddress + byteOffset.override -
writeInt64(
int value, [int byteOffset = 0]) → void -
Writes a
valueof type RInt64 at givenaddress + byteOffset.override -
writeInt8(
int value, [int byteOffset = 0]) → void -
Writes a
valueof type RInt8 at givenaddress + byteOffset.override -
writePtr(
MemoryPointer< RType> ? value, [int byteOffset = 0]) → void -
Writes a pointer at given
address + byteOffset.override -
writeShort(
int value, [int byteOffset = 0]) → void -
Writes a
valueof type RShort at givenaddress + byteOffset.override -
writeSize(
int value, [int byteOffset = 0]) → void -
Writes a
valueof type RSize at givenaddress + byteOffset.override -
writeStringUTF16(
String text, [int? maxLength, int byteOffset = 0]) → void -
Writes a UTF-16
textinto a fixed-sizemaxLength-byte buffer field ataddress + byteOffset. Truncates if too long; otherwise NUL-terminates and zero-pads the remainder.override -
writeStringUTF32(
String text, [int? maxLength, int byteOffset = 0]) → void -
Writes a UTF-32
textinto a fixed-sizemaxLength-byte buffer field ataddress + byteOffset. Truncates if too long; otherwise NUL-terminates and zero-pads the remainder.override -
writeStringUTF8(
String text, [int? maxLength, int byteOffset = 0]) → void -
Writes a UTF-8
textinto a fixed-sizemaxLength-byte buffer field ataddress + byteOffset. Truncates if too long; otherwise NUL-terminates and zero-pads the remainder.override -
writeUint16(
int value, [int byteOffset = 0]) → void -
Writes a
valueof type RUint16 at givenaddress + byteOffset.override -
writeUint32(
int value, [int byteOffset = 0]) → void -
Writes a
valueof type RUint32 at givenaddress + byteOffset.override -
writeUint64(
int value, [int byteOffset = 0]) → void -
Writes a
valueof type RUint64 at givenaddress + byteOffset.override -
writeUint8(
int value, [int byteOffset = 0]) → void -
Writes a
valueof type RUint8 at givenaddress + byteOffset.override -
writeUnsignedChar(
int value, [int byteOffset = 0]) → void -
Writes a
valueof type RUnsignedChar at givenaddress + byteOffset.override -
writeUnsignedInt(
int value, [int byteOffset = 0]) → void -
Writes a
valueof type RUnsignedInt at givenaddress + byteOffset.override -
writeUnsignedShort(
int value, [int byteOffset = 0]) → void -
Writes a
valueof type RUnsignedShort at givenaddress + byteOffset.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator [](
int i) → D -
Returns a detached copy of the struct at
i. -
operator []=(
int i, D v) → void -
Writes the current field values of
vinto the struct ati.