Pointer class - dart:ffi library (original) (raw)

Pointer<T extends NativeType> class final

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

Implemented types

Available extensions

Constructors

Pointer.fromAddress(int ptr)

Construction from raw integer.

factory

Properties

addressint

Access to the raw pointer value. On 32-bit systems, the upper 32-bits of the result are 0.

no setter

hashCodeint

The hash code for a Pointer only depends on its address.

no setteroverride

ref ↔ T

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

A Dart view of the struct referenced by this pointer.

getter/setter pair

ref ↔ T

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

A Dart view of the union referenced by this pointer.

getter/setter pair

runtimeTypeType

A representation of the runtime type of the object.

no setterinherited

valueint

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

The integer at address.

getter/setter pair

valuebool

Available on Pointer<Bool>, provided by the BoolPointer extension

The bool at address.

getter/setter pair

valuedouble

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

The double at address.

getter/setter pair

valuedouble

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

The float at address.

getter/setter pair

valueint

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

The 8-bit two's complement integer at address.

getter/setter pair

valueint

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

The 16-bit two's complement integer at address.

getter/setter pair

valueint

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

The 32-bit two's complement integer at address.

getter/setter pair

valueint

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

The 64-bit two's complement integer at address.

getter/setter pair

valuePointer<T>

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

The pointer at address.

getter/setter pair

valueint

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

The 8-bit unsigned integer at address.

getter/setter pair

valueint

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

The 16-bit unsigned integer at address.

getter/setter pair

valueint

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

The 32-bit unsigned integer at address.

getter/setter pair

valueint

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

The 64-bit unsigned integer at address.

getter/setter pair

Methods

asFunction<@DartRepresentationOf('NF') DF extends Function>({bool isLeaf = false})→ 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, {Pointer<NativeFinalizerFunction>? finalizer, Pointer<Void>? token})→ 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, {Pointer<NativeFinalizerFunction>? finalizer, Pointer<Void>? token})→ 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, {Pointer<NativeFinalizerFunction>? finalizer, Pointer<Void>? token})→ 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, {Pointer<NativeFinalizerFunction>? finalizer, Pointer<Void>? token})→ 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, {Pointer<NativeFinalizerFunction>? finalizer, Pointer<Void>? token})→ 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, {Pointer<NativeFinalizerFunction>? finalizer, Pointer<Void>? token})→ 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, {Pointer<NativeFinalizerFunction>? finalizer, Pointer<Void>? token})→ 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, {Pointer<NativeFinalizerFunction>? finalizer, Pointer<Void>? token})→ 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, {Pointer<NativeFinalizerFunction>? finalizer, Pointer<Void>? token})→ 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, {Pointer<NativeFinalizerFunction>? finalizer, Pointer<Void>? token})→ 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>

Cast Pointer to a Pointer.

elementAt(int index)→ Pointer<T>

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

Pointer arithmetic (takes element size into account).

elementAt(int index)→ Pointer<Bool>

Available on Pointer<Bool>, provided by the BoolPointer extension

Pointer arithmetic (takes element size into account).

elementAt(int index)→ Pointer<Double>

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

Pointer arithmetic (takes element size into account).

elementAt(int index)→ Pointer<Float>

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

Pointer arithmetic (takes element size into account).

elementAt(int index)→ Pointer<Int8>

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

Pointer arithmetic (takes element size into account).

elementAt(int index)→ Pointer<Int16>

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

Pointer arithmetic (takes element size into account).

elementAt(int index)→ Pointer<Int32>

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

Pointer arithmetic (takes element size into account).

elementAt(int index)→ Pointer<Int64>

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

Pointer arithmetic (takes element size into account).

elementAt(int index)→ Pointer<Pointer<T>>

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

Pointer arithmetic (takes element size into account).

elementAt(int index)→ Pointer<T>

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

Pointer arithmetic (takes element size into account)

elementAt(int index)→ Pointer<Uint8>

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

Pointer arithmetic (takes element size into account).

elementAt(int index)→ Pointer<Uint16>

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

Pointer arithmetic (takes element size into account).

elementAt(int index)→ Pointer<Uint32>

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

Pointer arithmetic (takes element size into account).

elementAt(int index)→ Pointer<Uint64>

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

Pointer arithmetic (takes element size into account).

elementAt(int index)→ Pointer<T>

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

Pointer arithmetic (takes element size into account).

noSuchMethod(Invocation invocation)→ dynamic

Invoked when a nonexistent method or property is accessed.

inherited

refWithFinalizer(Pointer<NativeFinalizerFunction> finalizer, {Pointer<Void>? token})→ T

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

A Dart view of the struct referenced by this pointer.

refWithFinalizer(Pointer<NativeFinalizerFunction> finalizer, {Pointer<Void>? token})→ T

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

A Dart view of the union referenced by this pointer.

toString()→ String

A string representation of this object.

inherited

Operators

operator +(int offset)→ Pointer<T>

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

A pointer to the offsetth T after this one.

operator +(int offset)→ Pointer<T>

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

A pointer to the offsetth T after this one.

operator +(int offset)→ Pointer<Bool>

Available on Pointer<Bool>, provided by the BoolPointer extension

A pointer to the offsetth Bool after this one.

operator +(int offset)→ Pointer<Double>

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

A pointer to the offsetth Double after this one.

operator +(int offset)→ Pointer<Float>

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

A pointer to the offsetth Float after this one.

operator +(int offset)→ Pointer<Int8>

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

A pointer to the offsetth Int8 after this one.

operator +(int offset)→ Pointer<Int16>

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

A pointer to the offsetth Int16 after this one.

operator +(int offset)→ Pointer<Int32>

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

A pointer to the offsetth Int32 after this one.

operator +(int offset)→ Pointer<Int64>

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

A pointer to the offsetth Int64 after this one.

operator +(int offset)→ Pointer<Pointer<T>>

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

A pointer to the offsetth Pointer after this one.

operator +(int offset)→ Pointer<T>

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

A pointer to the offsetth T after this one.

operator +(int offset)→ Pointer<Uint8>

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

A pointer to the offsetth Uint8 after this one.

operator +(int offset)→ Pointer<Uint16>

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

A pointer to the offsetth Uint16 after this one.

operator +(int offset)→ Pointer<Uint32>

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

A pointer to the offsetth Uint32 after this one.

operator +(int offset)→ Pointer<Uint64>

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

A pointer to the offsetth Uint64 after this one.

operator -(int offset)→ Pointer<T>

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

A pointer to the offsetth T before this one.

operator -(int offset)→ Pointer<Uint32>

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

A pointer to the offsetth Uint32 before this one.

operator -(int offset)→ Pointer<Uint8>

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

A pointer to the offsetth Uint8 before this one.

operator -(int offset)→ Pointer<Int16>

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

A pointer to the offsetth Int16 before this one.

operator -(int offset)→ Pointer<Int32>

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

A pointer to the offsetth Int32 before this one.

operator -(int offset)→ Pointer<Float>

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

A pointer to the offsetth Float before this one.

operator -(int offset)→ Pointer<Bool>

Available on Pointer<Bool>, provided by the BoolPointer extension

A pointer to the offsetth Bool before this one.

operator -(int offset)→ Pointer<Int64>

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

A pointer to the offsetth Int64 before this one.

operator -(int offset)→ Pointer<Pointer<T>>

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

A pointer to the offsetth Pointer before this one.

operator -(int offset)→ Pointer<Int8>

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

A pointer to the offsetth Int8 before this one.

operator -(int offset)→ Pointer<T>

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

A pointer to the offsetth T before this one.

operator -(int offset)→ Pointer<T>

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

A pointer to the offsetth T before this one.

operator -(int offset)→ Pointer<Uint64>

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

A pointer to the offsetth Uint64 before this one.

operator -(int offset)→ Pointer<Uint16>

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

A pointer to the offsetth Uint16 before this one.

operator -(int offset)→ Pointer<Double>

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

A pointer to the offsetth Double before this one.

operator ==(Object other)→ bool

Equality for Pointers only depends on their address.

override

operator [](int index)→ double

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

The float at address + sizeOf<Float>() * index.

operator [](int index)→ bool

Available on Pointer<Bool>, provided by the BoolPointer extension

The bool at address + sizeOf<Bool>() * index.

operator [](int index)→ int

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

The 64-bit two's complement integer at address + sizeOf<Int64>() * index.

operator [](int index)→ int

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

The 16-bit two's complement integer at address + sizeOf<Int16>() * index.

operator [](int index)→ Pointer<T>

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

Load a Dart value from this location offset by index.

operator [](int index)→ int

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

The 32-bit unsigned integer at address + sizeOf<Uint32>() * index.

operator [](int index)→ double

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

The double at address + sizeOf<Double>() * index.

operator [](int index)→ int

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

The 8-bit two's complement integer at address + sizeOf<Int8>() * index.

operator [](int index)→ T

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

Creates a reference to access the fields of this struct backed by native memory at address + sizeOf<T>() * index.

operator [](int index)→ T

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

Creates a reference to access the fields of this union backed by native memory at address + sizeOf<T>() * index.

operator [](int index)→ int

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

The 32-bit two's complement integer at address + sizeOf<Int32>() * index.

operator [](int index)→ int

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

The 8-bit unsigned integer at address + sizeOf<Uint8>() * index.

operator [](int index)→ int

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

The integer at address + sizeOf<T>() * index.

operator [](int index)→ int

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

The 64-bit unsigned integer at address + sizeOf<Uint64>() * index.

operator [](int index)→ int

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

The 16-bit unsigned integer at address + sizeOf<Uint16>() * index.

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

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

The 16-bit unsigned integer at address + sizeOf<Uint16>() * index.

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

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

The 8-bit unsigned integer at address + sizeOf<Uint8>() * index.

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

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

Copies the value struct into native memory, starting ataddress * sizeOf<T>() * index.

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

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

Store a Dart value into this location offset by index.

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

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

The 32-bit unsigned integer at address + sizeOf<Uint32>() * index.

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

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

The integer at address + sizeOf<T>() * index.

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

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

The double at address + sizeOf<Double>() * index.

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

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

The 32-bit two's complement integer at address + sizeOf<Int32>() * index.

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

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

The 64-bit unsigned integer at address + sizeOf<Uint64>() * index.

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

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

The float at address + sizeOf<Float>() * index.

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

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

The 16-bit two's complement integer at address + sizeOf<Int16>() * index.

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

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

The 8-bit two's complement integer at address + sizeOf<Int8>() * index.

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

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

Copies the value union into native memory, starting ataddress * sizeOf<T>() * index.

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

Available on Pointer<Bool>, provided by the BoolPointer extension

The bool at address + sizeOf<Bool>() * index.

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

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

The 64-bit two's complement integer at address + sizeOf<Int64>() * index.

Static Methods

fromFunction<T extends Function>(Function f, [Object? exceptionalReturn])→ Pointer<NativeFunction<T>>

Convert Dart function to a C function pointer, automatically marshalling the arguments and return value