prepare method
Computes the combinational next-head values for a pending edge.
Implementation
@mustCallSuper
void prepare({
required bool push,
required int pushIndex,
required bool pop,
required int popReplacementIndex,
}) {
_push = push;
_pop = pop;
_pushIndex = pushIndex;
bypass = false;
if (empty && push) {
nextFirstIndexValid = true;
nextFirstIndex = pushIndex;
} else if (push && pop && occupancy == 1) {
nextFirstIndexValid = true;
nextFirstIndex = pushIndex;
bypass = true;
} else if (pop && occupancy >= 2) {
nextFirstIndexValid = true;
nextFirstIndex = popReplacementIndex;
} else {
nextFirstIndexValid = !empty;
nextFirstIndex = firstIndex;
}
}