pointerScalarArray<T, R extends RType> method

StructPointerArrayField<T, R> pointerScalarArray<T, R extends RType>(
  1. F f
)

Creates a variable-length scalar pointer array field for f.

The field represents a C-style T* where the number of elements is determined externally rather than encoded in the struct type.

Implementation

StructPointerArrayField<T, R> pointerScalarArray<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);
}