pointerScalar<T, R extends RType> method

StructPointerValueField<T, R> pointerScalar<T, R extends RType>(
  1. F f
)

Creates a pointer-to-scalar field for f.

The field represents a C-style T* pointer to a scalar value.

Implementation

StructPointerValueField<T, R> pointerScalar<T, R extends RType>(F f) {
  _checkField(f);
  final type = _getFieldAs<RPointer<R>>(f);
  final scalarCodec = ScalarCodec<T, R>(type.target);
  final pointerCodec = PointerCodec(type, scalarCodec);
  return .new(offset(f), pointerCodec);
}