FloatPointer#
Extension on Pointer specialized for the type argument Float.
Properties#
value extension read / write#
The float at address.
A Dart double loses precision before being stored, and the float value is converted to a double when it is loaded.
The address must be 4-byte aligned.
Available on Pointer<T extends NativeType>, provided by the FloatPointer extension
Implementation
external double get value;
external void set value(double value);
Methods#
asTypedList() extension#
Creates a typed list view backed by memory in the address space.
The returned view will allow access to the memory range from address
to address + sizeOf<Float>() * length.
The user has to ensure the memory range is accessible while using the returned list.
If provided, finalizer will be run on the pointer once the typed list
is GCed. If provided, token will be passed to finalizer, otherwise
the this pointer itself will be passed.
The address must be 4-byte aligned.
Available on Pointer<T extends NativeType>, provided by the FloatPointer extension
Implementation
external Float32List asTypedList(
int length, {
@Since('3.1') Pointer<NativeFinalizerFunction>? finalizer,
@Since('3.1') Pointer<Void>? token,
});
deprecated elementAt() extension#
DEPRECATED
Use operator + instead
Pointer arithmetic (takes element size into account).
Available on Pointer<T extends NativeType>, provided by the FloatPointer extension
Implementation
@Deprecated('Use operator + instead')
Pointer<Float> elementAt(int index) =>
Pointer.fromAddress(address + sizeOf<Float>() * index);
Operators#
operator +() extension#
A pointer to the offsetth Float
after this one.
Returns a pointer to the Float
whose address is
offset times the size of Float
after the address of this pointer.
That is (this + offset).address == this.address + offset * sizeOf<Float>().
Also (this + offset).value is equivalent to this[offset],
and similarly for setting.
Available on Pointer<T extends NativeType>, provided by the FloatPointer extension
Implementation
@Since('3.3')
@pragma("vm:prefer-inline")
Pointer<Float> operator +(int offset) =>
Pointer.fromAddress(address + sizeOf<Float>() * offset);
operator -() extension#
A pointer to the offsetth Float
before this one.
Equivalent to this + (-offset).
Returns a pointer to the Float
whose address is
offset times the size of Float
before the address of this pointer.
That is, (this - offset).address == this.address - offset * sizeOf<Float>().
Also, (this - offset).value is equivalent to this[-offset],
and similarly for setting,
Available on Pointer<T extends NativeType>, provided by the FloatPointer extension
Implementation
@Since('3.3')
@pragma("vm:prefer-inline")
Pointer<Float> operator -(int offset) =>
Pointer.fromAddress(address - sizeOf<Float>() * offset);
operator []() extension#
The float at address + sizeOf<Float>() * index.
A Dart double loses precision before being stored, and the float value is converted to a double when it is loaded.
The address must be 4-byte aligned.
Available on Pointer<T extends NativeType>, provided by the FloatPointer extension
Implementation
external double operator [](int index);
operator []=() extension#
The float at address + sizeOf<Float>() * index.
A Dart double loses precision before being stored, and the float value is converted to a double when it is loaded.
The address must be 4-byte aligned.
Available on Pointer<T extends NativeType>, provided by the FloatPointer extension
Implementation
external void operator []=(int index, double value);