Counter

Counter is a utility class to keep a count of items

Members

Functions

get
uint get(T v)

Get an element from storage

mostCommon
auto mostCommon(uint limit)

Find the most common item, using a schwartz sorting algorithm.

reset
void reset(T v)

Reset the count of an element

resetAll
void resetAll()

Reset the count of all elements

tick
void tick(T v)

Increment the total amount of items, and the specified item, by one

Variables

storage
uint[T] storage;

The associative array with the actual data

total
uint total;

The total amount of items

Meta