NativeMemoryPointer<X extends RType> class

Inheritance
Available extensions

Constructors

NativeMemoryPointer(Pointer<NativeType> _ptr)

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 setterinherited
hashCode → int
The hash code for this object.
no setterinherited
hex → String
address in hexadecimal format.
no setterinherited
isFreed ↔ bool
If the underlying allocation has been freed.
getter/setter pairinherited
isNull → bool
Check if the pointer is a nullptr.
no setteroverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
value ↔ bool

Available on MemoryPointer<RBool>, provided by the BoolPointer extension

getter/setter pair
value ↔ double

Available on MemoryPointer<RFloat32>, provided by the Float32Pointer extension

getter/setter pair
value ↔ double

Available on MemoryPointer<RFloat64>, provided by the Float64Pointer extension

getter/setter pair
value ↔ int

Available on MemoryPointer<RInt8>, provided by the Int8Pointer extension

getter/setter pair
value ↔ int

Available on MemoryPointer<RInt16>, provided by the Int16Pointer extension

getter/setter pair
value ↔ int

Available on MemoryPointer<RInt32>, provided by the Int32Pointer extension

getter/setter pair
value ↔ int

Available on MemoryPointer<RInt64>, provided by the Int64Pointer extension

getter/setter pair
value ↔ int

Available on MemoryPointer<RSize>, provided by the SizePointer extension

getter/setter pair
value ↔ int

Available on MemoryPointer<RUint8>, provided by the Uint8Pointer extension

getter/setter pair
value ↔ int

Available on MemoryPointer<RUint16>, provided by the Uint16Pointer extension

getter/setter pair
value ↔ int

Available on MemoryPointer<RUint32>, provided by the Uint32Pointer extension

getter/setter pair
value ↔ int

Available on MemoryPointer<RUint64>, provided by the Uint64Pointer extension

getter/setter pair

Methods

asCopy<T extends TypedDataList>(int length) → T
Copies length bytes, viewed as T.
override
asNativePointer<R extends NativeType>() → Pointer<R>

Available on MemoryPointer<RType>, provided by the MemoryPointerAsNativePointer extension

asPointer<R extends NativeType>() → Pointer<R>
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 Y instead of X.
inherited
compareBytes(MemoryPointer<RType> other, int length, {int offset = 0, int otherOffset = 0}) → int
memcmp-style comparison of length bytes.
inherited
computeByteHash(int byteSize) → int
Hashes the bytes until byteSize.
inherited
copyBytesFrom(MemoryPointer<RType> src, int length, {int destOffset = 0, int srcOffset = 0}) → void
Bulk-copies length bytes from src into this pointer.
inherited
fillBytes(int value, int length, [int byteOffset = 0]) → void
Fills length bytes starting at byteOffset with the low byte of value.
inherited
free() → void
Frees the underlying allocation. Only call this if you actually own it.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
offsetBy<Y extends RType>(int byteOffset) → NativeMemoryPointer<Y>
Same buffer, address advanced by byteOffset bytes. Same type X. Backends implement via pointer arithmetic (native) or address+offset (wasm).
override
readArray(int count) → List<int>

Available on MemoryPointer<RInt16>, provided by the Int16Pointer extension

readArray(int count) → List<bool>

Available on MemoryPointer<RBool>, provided by the BoolPointer extension

readArray(int count) → List<int>

Available on MemoryPointer<RInt32>, provided by the Int32Pointer extension

readArray(int count) → List<int>

Available on MemoryPointer<RInt64>, provided by the Int64Pointer extension

readArray(int count) → List<int>

Available on MemoryPointer<RUint64>, provided by the Uint64Pointer extension

readArray(int count) → List<double>

Available on MemoryPointer<RFloat32>, provided by the Float32Pointer extension

readArray(int count) → List<int>

Available on MemoryPointer<RUint32>, provided by the Uint32Pointer extension

readArray(int count) → List<int>

Available on MemoryPointer<RUint16>, provided by the Uint16Pointer extension

readArray(int count) → List<int>

Available on MemoryPointer<RUint8>, provided by the Uint8Pointer extension

readArray(int count) → List<int>

Available on MemoryPointer<RInt8>, provided by the Int8Pointer extension

readArray(int count) → List<double>

Available on MemoryPointer<RFloat64>, provided by the Float64Pointer extension

readArray(int count) → List<int>

Available on MemoryPointer<RSize>, provided by the SizePointer extension

readBool([int byteOffset = 0]) → bool
Reads a value of type RBool at given address + byteOffset.
override
readBytes(int byteOffset, int length) → Uint8List
Reads length bytes at byteOffset.
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
readMatrix<D extends RaylibStruct<D>>(int rowCount, int rowLength, {bool owned = false, bool materialize = false}) → List<StructLiveList<D, RStruct>>

Available on MemoryPointer<RPointer<RStruct>>, provided by the MemoryPointerMatrixIO extension

readPtr<Y extends RType>([int byteOffset = 0]) → NativeMemoryPointer<Y>
Reads a pointer value at address + byteOffset and returns it typed as pointing to Y.
override
readPtrArray<X extends RType>(int count) → List<MemoryPointer<X>>

Available on MemoryPointer<RPointer<RType>>, provided by the PointerArrayOnPointer extension

Reads count pointers from this pointer array.
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
readStringArray(int count) → List<String>

Available on MemoryPointer<RPointer<RChar>>, provided by the MemoryPointerStringIO extension

Reads count C strings from a char**-style pointer (this pointer points at an array of char* pointers, each read and decoded).
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.
inherited
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.
inherited
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.
inherited
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
toDartString([int? maxLength]) → String

Available on MemoryPointer<RInt32>, provided by the Utf32StringPointer extension

toDartString([int? maxLength]) → String

Available on MemoryPointer<RInt16>, provided by the Utf16StringPointer extension

toDartString([int? maxLength]) → String

Available on MemoryPointer<RInt8>, provided by the Utf8StringPointer extension

Reads a NUL-terminated C string starting at this pointer, decoded as UTF-8. Scans for the NUL byte itself, no length needed.
toString() → String
A string representation of this object.
inherited
writeArray(List<int> values) → void

Available on MemoryPointer<RUint16>, provided by the Uint16Pointer extension

writeArray(List<int> values) → void

Available on MemoryPointer<RUint8>, provided by the Uint8Pointer extension

writeArray(List<int> values) → void

Available on MemoryPointer<RSize>, provided by the SizePointer extension

writeArray(List<int> values) → void

Available on MemoryPointer<RInt64>, provided by the Int64Pointer extension

writeArray(List<int> values) → void

Available on MemoryPointer<RInt32>, provided by the Int32Pointer extension

writeArray(List<int> values) → void

Available on MemoryPointer<RInt16>, provided by the Int16Pointer extension

writeArray(List<int> values) → void

Available on MemoryPointer<RInt8>, provided by the Int8Pointer extension

writeArray(List<int> values) → void

Available on MemoryPointer<RUint64>, provided by the Uint64Pointer extension

writeArray(List<bool> values) → void

Available on MemoryPointer<RBool>, provided by the BoolPointer extension

writeArray(List<int> values) → void

Available on MemoryPointer<RUint32>, provided by the Uint32Pointer extension

writeArray(List<double> values) → void

Available on MemoryPointer<RFloat64>, provided by the Float64Pointer extension

writeArray(List<double> values) → void

Available on MemoryPointer<RFloat32>, provided by the Float32Pointer extension

writeBool(bool value, [int byteOffset = 0]) → void
Writes a value of type RBool at given address + byteOffset.
override
writeChar(int value, [int byteOffset = 0]) → void
Writes a value of type RChar at given address + byteOffset.
override
writeDouble(double value, [int byteOffset = 0]) → void
Writes a value of type RDouble at given address + byteOffset.
override
writeFloat(double value, [int byteOffset = 0]) → void
Writes a value of type RFloat at given address + byteOffset.
override
writeFloat32(double value, [int byteOffset = 0]) → void
Writes a value of type RFloat32 at given address + byteOffset.
override
writeFloat64(double value, [int byteOffset = 0]) → void
Writes a value of type RFloat64 at given address + byteOffset.
override
writeInt(int value, [int byteOffset = 0]) → void
Writes a value of type RInt at given address + byteOffset.
override
writeInt16(int value, [int byteOffset = 0]) → void
Writes a value of type RInt16 at given address + byteOffset.
override
writeInt32(int value, [int byteOffset = 0]) → void
Writes a value of type RInt32 at given address + byteOffset.
override
writeInt64(int value, [int byteOffset = 0]) → void
Writes a value of type RInt64 at given address + byteOffset.
override
writeInt8(int value, [int byteOffset = 0]) → void
Writes a value of type RInt8 at given address + byteOffset.
override
writeMatrix<D extends RaylibStruct<D>>(List<List<D>> rows) → void

Available on MemoryPointer<RPointer<RStruct>>, provided by the MemoryPointerMatrixIO extension

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 value of type RShort at given address + byteOffset.
override
writeSize(int value, [int byteOffset = 0]) → void
Writes a value of type RSize at given address + byteOffset.
override
writeString(String text, [int? maxLength, int byteOffset = 0]) → void

Available on MemoryPointer<RInt8>, provided by the Utf8StringPointer extension

Writes text into a buffer field at address + byteOffset. If maxLength is null, it's derived from the UTF-8 byte length of text (caller is responsible for the field actually being that size). Truncates if text exceeds maxLength; otherwise NUL-terminates and zero-pads the remainder.
writeString(String text, [int? maxLength, int elementOffset = 0]) → void

Available on MemoryPointer<RInt16>, provided by the Utf16StringPointer extension

Writes text into a buffer field at address + elementOffset*2. If maxLength is null, it's derived from the UTF-16 code unit length of text (caller is responsible for the field actually being that size).
writeString(String text, [int? maxLength, int elementOffset = 0]) → void

Available on MemoryPointer<RInt32>, provided by the Utf32StringPointer extension

Writes text into a buffer field at address + elementOffset*4. If maxLength is null, it's derived from the UTF-32 code unit (rune) length of text (caller is responsible for the field actually being that size).
writeStringArray(List<String> strings, [List<int>? slotSizes]) → void

Available on MemoryPointer<RPointer<RChar>>, provided by the MemoryPointerStringIO extension

Writes strings into this pre-allocated char**-sized buffer. Both the outer array (strings.length pointer slots) and each inner char* target buffer must already exist. [slotSizesi] is the real allocated byte capacity of slot i's buffer (bytes available, terminator included), if not provided, string's length is used instead.
writeStringUTF16(String text, [int? maxLength, int byteOffset = 0]) → void
Writes a UTF-16 text into a fixed-size maxLength-byte buffer field at address + byteOffset. Truncates if too long; otherwise NUL-terminates and zero-pads the remainder.
inherited
writeStringUTF32(String text, [int? maxLength, int byteOffset = 0]) → void
Writes a UTF-32 text into a fixed-size maxLength-byte buffer field at address + byteOffset. Truncates if too long; otherwise NUL-terminates and zero-pads the remainder.
inherited
writeStringUTF8(String text, [int? maxLength, int byteOffset = 0]) → void
Writes a UTF-8 text into a fixed-size maxLength-byte buffer field at address + byteOffset. Truncates if too long; otherwise NUL-terminates and zero-pads the remainder.
inherited
writeUint16(int value, [int byteOffset = 0]) → void
Writes a value of type RUint16 at given address + byteOffset.
override
writeUint32(int value, [int byteOffset = 0]) → void
Writes a value of type RUint32 at given address + byteOffset.
override
writeUint64(int value, [int byteOffset = 0]) → void
Writes a value of type RUint64 at given address + byteOffset.
override
writeUint8(int value, [int byteOffset = 0]) → void
Writes a value of type RUint8 at given address + byteOffset.
override
writeUnsignedChar(int value, [int byteOffset = 0]) → void
Writes a value of type RUnsignedChar at given address + byteOffset.
override
writeUnsignedInt(int value, [int byteOffset = 0]) → void
Writes a value of type RUnsignedInt at given address + byteOffset.
override
writeUnsignedShort(int value, [int byteOffset = 0]) → void
Writes a value of type RUnsignedShort at given address + byteOffset.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited
operator [](int i) → bool

Available on MemoryPointer<RBool>, provided by the BoolPointer extension

operator [](int i) → double

Available on MemoryPointer<RFloat32>, provided by the Float32Pointer extension

operator [](int i) → double

Available on MemoryPointer<RFloat64>, provided by the Float64Pointer extension

operator [](int i) → int

Available on MemoryPointer<RInt8>, provided by the Int8Pointer extension

operator [](int i) → int

Available on MemoryPointer<RInt16>, provided by the Int16Pointer extension

operator [](int i) → int

Available on MemoryPointer<RInt32>, provided by the Int32Pointer extension

operator [](int i) → int

Available on MemoryPointer<RInt64>, provided by the Int64Pointer extension

operator [](int i) → int

Available on MemoryPointer<RSize>, provided by the SizePointer extension

operator [](int i) → int

Available on MemoryPointer<RUint8>, provided by the Uint8Pointer extension

operator [](int i) → int

Available on MemoryPointer<RUint16>, provided by the Uint16Pointer extension

operator [](int i) → int

Available on MemoryPointer<RUint32>, provided by the Uint32Pointer extension

operator [](int i) → int

Available on MemoryPointer<RUint64>, provided by the Uint64Pointer extension

operator []=(int i, bool v) → void

Available on MemoryPointer<RBool>, provided by the BoolPointer extension

operator []=(int i, double v) → void

Available on MemoryPointer<RFloat32>, provided by the Float32Pointer extension

operator []=(int i, double v) → void

Available on MemoryPointer<RFloat64>, provided by the Float64Pointer extension

operator []=(int i, int v) → void

Available on MemoryPointer<RInt8>, provided by the Int8Pointer extension

operator []=(int i, int v) → void

Available on MemoryPointer<RInt16>, provided by the Int16Pointer extension

operator []=(int i, int v) → void

Available on MemoryPointer<RInt32>, provided by the Int32Pointer extension

operator []=(int i, int v) → void

Available on MemoryPointer<RInt64>, provided by the Int64Pointer extension

operator []=(int i, int v) → void

Available on MemoryPointer<RSize>, provided by the SizePointer extension

operator []=(int i, int v) → void

Available on MemoryPointer<RUint8>, provided by the Uint8Pointer extension

operator []=(int i, int v) → void

Available on MemoryPointer<RUint16>, provided by the Uint16Pointer extension

operator []=(int i, int v) → void

Available on MemoryPointer<RUint32>, provided by the Uint32Pointer extension

operator []=(int i, int v) → void

Available on MemoryPointer<RUint64>, provided by the Uint64Pointer extension

Static Methods

orNull<Y extends RType>(Pointer<NativeType>? p) → NativeMemoryPointer<Y>?