Pointer<T extends NativeType> class

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

Inheritance

Constructors

Pointer.allocate({int count: 1 })
Allocate count elements of type T on the native heap via malloc() and return a pointer to the newly allocated memory. [...]
factory
Pointer.fromAddress(int ptr)
Construction from raw integer.
factory

Properties

address int
Access to the raw pointer value. On 32-bit systems, the upper 32-bits of the result are 0.
read-only
hashCode int
The hash code for a Pointer only depends on its address.
read-only, override
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

asExternalTypedData({int count: 1 }) TypedData
Creates an external typed data array backed by this pointer. [...]
asFunction<R extends Function>() → R
Convert to Dart function, automatically marshalling the arguments and return value. [...]
cast<U extends NativeType>() Pointer<U>
Cast Pointer to a Pointer.
elementAt(int index) Pointer<T>
Pointer arithmetic (takes element size into account).
free() → void
Free memory on the C heap pointed to by this pointer with free(). [...]
load<R>() → R
Load a Dart value from this location. [...]
offsetBy(int offsetInBytes) Pointer<T>
Pointer arithmetic (byte offset).
store(Object value) → void
Store a Dart value into this location. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) bool
Equality for Pointers only depends on their address.
override

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 [...]