common: ModeCollector: locating the value of the mode
The ModeCollector class is used to collect values
of some type 'key', each associated with some object
identified by an 'ID'. The collector reports the 'mode'
value - the value associated with the largest number
of distinct IDs.
The results structure returned by the collector specifies
one of three possible mode_status_t values:
- no_mode_value - No clear victory for any value
- mode_value - we have a winner, but it has less than half of the
samples
- authorative_value - more than half of the samples are of the same
value