Pointer<T extends NativeType> class

Represents a pointer into the native C memory. Cannot be extended.

Inheritance
Available extensions
Annotations
  • @sealed

Constructors

Pointer.fromAddress(int ptr, [Memory? bindTo])
Constructs a pointer from an address.
factory

Properties

address int
Access to the raw pointer value.
final
boundMemory Memory
The Memory object this pointer is bound to.
final
hashCode int
The hash code for a Pointer only depends on its address.
no setteroverride
is64Bit bool

Available on Pointer<IntPtr>, provided by the IntPtrPointer extension

Returns true if the size of a pointer is 64-bit, false otherwise.
no setter
is64Bit bool

Available on Pointer<Pointer<T>>, provided by the PointerPointer extension

Returns true if the size of a pointer is 64-bit, false otherwise.
no setter
length int

Available on Pointer<Utf8>, provided by the Utf8Pointer extension

The number of UTF-8 code units in this zero-terminated UTF-8 string.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
size int?
How much memory in bytes the type this pointer points to occupies, or null for @unsized types.
final
value double

Available on Pointer<Double>, provided by the DoublePointer extension

The double at address.
getter/setter pair
value double

Available on Pointer<Float>, provided by the FloatPointer extension

The float at address.
getter/setter pair
value int

Available on Pointer<Int8>, provided by the Int8Pointer extension

The 8-bit integer at address.
getter/setter pair
value int

Available on Pointer<Int16>, provided by the Int16Pointer extension

The 16-bit integer at address.
getter/setter pair
value int

Available on Pointer<Int32>, provided by the Int32Pointer extension

The 32-bit integer at address.
getter/setter pair
value int

Available on Pointer<Int64>, provided by the Int64Pointer extension

The 64-bit integer at address.
getter/setter pair
value int

Available on Pointer<IntPtr>, provided by the IntPtrPointer extension

The 32-bit or 64-bit value at address.
getter/setter pair
value Pointer<T>

Available on Pointer<Pointer<T>>, provided by the PointerPointer extension

The pointer at address.
getter/setter pair
value int

Available on Pointer<Uint8>, provided by the Uint8Pointer extension

The 8-bit unsigned integer at address.
getter/setter pair
value int

Available on Pointer<Uint16>, provided by the Uint16Pointer extension

The 16-bit unsigned integer at address.
getter/setter pair
value int

Available on Pointer<Uint32>, provided by the Uint32Pointer extension

The 32-bit unsigned integer at address.
getter/setter pair
value int

Available on Pointer<Uint64>, provided by the Uint64Pointer extension

The 64-bit unsigned integer at address.
getter/setter pair

Methods

asFunction<DF extends Function>() → DF

Available on Pointer<NativeFunction<NF>>, provided by the NativeFunctionPointer extension

Convert to Dart function, automatically marshalling the arguments and return value.
asTypedList(int length) Float64List

Available on Pointer<Double>, provided by the DoublePointer extension

Creates a typed list view backed by memory in the address space.
asTypedList(int length) Float32List

Available on Pointer<Float>, provided by the FloatPointer extension

Creates a typed list view backed by memory in the address space.
asTypedList(int length) Int8List

Available on Pointer<Int8>, provided by the Int8Pointer extension

Creates a typed list view backed by memory in the address space.
asTypedList(int length) Int16List

Available on Pointer<Int16>, provided by the Int16Pointer extension

Creates a typed list view backed by memory in the address space.
asTypedList(int length) Int32List

Available on Pointer<Int32>, provided by the Int32Pointer extension

Creates a typed list view backed by memory in the address space.
asTypedList(int length) Int64List

Available on Pointer<Int64>, provided by the Int64Pointer extension

Creates a typed list view backed by memory in the address space.
asTypedList(int length) Uint8List

Available on Pointer<Uint8>, provided by the Uint8Pointer extension

Creates a typed list view backed by memory in the address space.
asTypedList(int length) Uint16List

Available on Pointer<Uint16>, provided by the Uint16Pointer extension

Creates a typed list view backed by memory in the address space.
asTypedList(int length) Uint32List

Available on Pointer<Uint32>, provided by the Uint32Pointer extension

Creates a typed list view backed by memory in the address space.
asTypedList(int length) Uint64List

Available on Pointer<Uint64>, provided by the Uint64Pointer extension

Creates a typed list view backed by memory in the address space.
cast<U extends NativeType>() Pointer<U>
Casts this pointer to an other type.
elementAt(int index) Pointer<T>
Pointer arithmetic (takes element size into account).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDartString({int? length}) String

Available on Pointer<Utf8>, provided by the Utf8Pointer extension

Converts this UTF-8 encoded string to a Dart string.
toString() String
A string representation of this object.
inherited
viewSingle(int index) ByteData
Returns a view of a single element at index (takes element size into account).

Operators

operator ==(Object other) bool
Two pointers are equal if their address is the same, independently of their type argument and of the memory they are bound to.
override
operator [](int index) double

Available on Pointer<Double>, provided by the DoublePointer extension

The double at address + size * index.
operator [](int index) double

Available on Pointer<Float>, provided by the FloatPointer extension

The float at address + size * index.
operator [](int index) int

Available on Pointer<Int8>, provided by the Int8Pointer extension

The 8-bit integer at address + size * index.
operator [](int index) int

Available on Pointer<Int16>, provided by the Int16Pointer extension

The 16-bit integer at address + size * index.
operator [](int index) int

Available on Pointer<Int32>, provided by the Int32Pointer extension

The 32-bit integer at address + size * index.
operator [](int index) int

Available on Pointer<Int64>, provided by the Int64Pointer extension

The 64-bit integer at address + size * index.
operator [](int index) int

Available on Pointer<IntPtr>, provided by the IntPtrPointer extension

The 32-bit or 64-bit integer at address + size * index.
operator [](int index) Pointer<T>

Available on Pointer<Pointer<T>>, provided by the PointerPointer extension

The pointer at address + size * index.
operator [](int index) int

Available on Pointer<Uint8>, provided by the Uint8Pointer extension

The 8-bit unsigned integer at address + size * index.
operator [](int index) int

Available on Pointer<Uint16>, provided by the Uint16Pointer extension

The 16-bit unsigned integer at address + size * index.
operator [](int index) int

Available on Pointer<Uint32>, provided by the Uint32Pointer extension

The 32-bit unsigned integer at address + size * index.
operator [](int index) int

Available on Pointer<Uint64>, provided by the Uint64Pointer extension

The 64-bit unsigned integer at address + size * index.
operator []=(int index, double value) → void

Available on Pointer<Double>, provided by the DoublePointer extension

operator []=(int index, double value) → void

Available on Pointer<Float>, provided by the FloatPointer extension

operator []=(int index, int value) → void

Available on Pointer<Int8>, provided by the Int8Pointer extension

operator []=(int index, int value) → void

Available on Pointer<Int16>, provided by the Int16Pointer extension

operator []=(int index, int value) → void

Available on Pointer<Int32>, provided by the Int32Pointer extension

operator []=(int index, int value) → void

Available on Pointer<Int64>, provided by the Int64Pointer extension

operator []=(int index, int value) → void

Available on Pointer<IntPtr>, provided by the IntPtrPointer extension

operator []=(int index, Pointer<T> value) → void

Available on Pointer<Pointer<T>>, provided by the PointerPointer extension

operator []=(int index, int value) → void

Available on Pointer<Uint8>, provided by the Uint8Pointer extension

operator []=(int index, int value) → void

Available on Pointer<Uint16>, provided by the Uint16Pointer extension

operator []=(int index, int value) → void

Available on Pointer<Uint32>, provided by the Uint32Pointer extension

operator []=(int index, int value) → void

Available on Pointer<Uint64>, provided by the Uint64Pointer extension