pointerScalarFixedArray<T, R extends RType> method

StructPointerValueField<List<T>, RArray<R>> pointerScalarFixedArray<T, R extends RType>(
  1. F f
)

Creates a pointer to a fixed-size scalar array field for f.

The field represents a C-style T* pointing to exactly RArray.count scalar elements.

Implementation

StructPointerValueField<List<T>, RArray<R>> pointerScalarFixedArray<T, R extends RType>(F f) {
  _checkField(f);
  final type = _getFieldAs<RPointer<RArray<R>>>(f);
  final array = type.target;
  final scalarCodec = ScalarCodec<T, R>(array.element);
  final arrayCodec = ArrayCodec(type.target, scalarCodec, array.count);
  final pointerCodec = PointerCodec(type, arrayCodec);
  return .new(offset(f), pointerCodec);
}