rfw2d
    Preparing search index...

    Class SizedBatcher<O>Abstract

    Type Parameters

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    batches: Batch<O, BatchEntry<O>>[] = []

    Batches. All batches in this collection are at least partially occupied.

    changeTracker: ChangeTracker

    Changes to objects will be propagated to the change tracker

    entryPool: Pool<BatchEntry<O>> = ...
    maximums?: { maxSize: number }
    queuedEntries: BatchEntry<O>[] = []

    New entries are queued until all changes are applied to a batch.

    Accessors

    • get size(): number

      Entries across all batches. Does not respect queued adds/deletes.

      Returns number

    Methods

    • Move data within a batch. Used if e.g. entries change size and multiple entries must be moved to fill gaps or crate space.

      Parameters

      • batch: Batch

        Affected batch

      • target: number

        Target element offset

      • start: number

        Start element offset

      • end: number

        End element offset

      Returns void

      Generally should call copyWithin on batch storage or its buffer.

    • Find an entry for object by doing a linear search through all batches and entries.

      Parameters

      • object: O

        Object to find entry for

      Returns undefined | BatchEntry<O>

      First entry, if present

      If Batcher#add was called multiple times with the same object, multiple entries can exist for the same object. In this case this method returns only the first entry it finds.

      Generally, the returned entry from Batcher#add should be stored to then reuse it for Batcher#change and Batcher#change calls.

    • Decide if a batch should be completely rebuilt. Generally this should be true if most/all of the batch's entries must be processed anyways.

      Parameters

      Returns boolean

      true if batch should be rebuilt.