13 public int Start(
int startingValue = 0) => Math.Abs(
Push(startingValue));
16 public new int Next() => Math.Abs(++
Top);
20 bool reached =
Top >= bounds;
bool Reached(int bounds)
See if the top counter has reached the target value
A stack of counters for garbage-free iterations
virtual T Push(T entry)
Push a new entry onto the top of the stack
override void Dispose()
Send back to recycling
Intentionally simple stack implementation
new int Next()
Increment he top counter
int Start(int startingValue=0)
Add a new counter and set it to the starting value
T Top
Get/set the value at the top of the stack.
virtual T Pop()
Pop an entry from the top of the stack
static new CounterFifo Instance
Retrieve a new (cached) instance