26 template <
class TItem,
class TEstimator >
44 bool add(TItem item, TEstimator est,
46 = [](TEstimator currentBest, TEstimator newEst) {
return newEst < currentBest;}
Multiple entries can be added, but only the one will be kept, which has the best quality estimator.
TItem const & getBestMatch() const
std::function< bool(TEstimator, TEstimator)> EstimatorComparison
Lambda typedef for the function comparing estimators.
TEstimator m_bestEstimator
Stores the estimator value of the best match.
std::optional< TItem > m_bestMatch
Stores the best matched item.
bool add(TItem item, TEstimator est, EstimatorComparison estComparison=[](TEstimator currentBest, TEstimator newEst) {return newEst< currentBest;})
Add a new item with an estimator value.
void setBestMatch(TItem item, TEstimator est)
Set a new item as the best match.
Abstract base class for different kinds of events.