IndexAllocatorModel constructor

IndexAllocatorModel({
  1. required int capacity,
  2. Iterable<int>? initiallyAvailableIndices,
})

Creates an index allocator model.

When initiallyAvailableIndices is omitted, every index starts free in ascending order; otherwise they are offered in the given order.

Implementation

IndexAllocatorModel({
  required this.capacity,
  Iterable<int>? initiallyAvailableIndices,
}) : _initiallyFree = _initialFree(capacity, initiallyAvailableIndices) {
  reset();
}