Functor for CachedESTInfo sorting. More...
#include <CachedESTInfoHelper.h>
Public Member Functions | |
LessCachedESTInfo (const ESTAnalyzer *analyzer) | |
Constructor. | |
bool | operator() (const CachedESTInfo &estInfo1, const CachedESTInfo &estInfo2) |
operator() for CachedESTInfo. | |
Private Member Functions | |
LessCachedESTInfo & | operator= (const LessCachedESTInfo &src) |
A dummy operator=. | |
Private Attributes | |
const ESTAnalyzer *const | comparator |
The functor for comparing. |
Functor for CachedESTInfo sorting.
This Functor is used when sorting ESTs based on similarity/distance metric by the sort method defined in this class. This functor sorts methods in ascending order with the smallest values at top.
Definition at line 58 of file CachedESTInfoHelper.h.
LessCachedESTInfo::LessCachedESTInfo | ( | const ESTAnalyzer * | analyzer | ) | [inline] |
Constructor.
The constructor requires a pointer to the ESTAnalyzer that is being used for analysis. The analyzer is used to compare the metrics for sorting CachedESTInfo objects. This constructor is called in the MSTCache class for sorting cache entries.
[in] | analyzer | The analyzer to be used for comparing the metric values associated with two CachedESTInfo objects. |
Definition at line 73 of file CachedESTInfoHelper.h.
LessCachedESTInfo::operator() | ( | const CachedESTInfo & | estInfo1, | |
const CachedESTInfo & | estInfo2 | |||
) | [inline] |
operator() for CachedESTInfo.
The following operator provides a convenient mechanism for comparing CachedESTInfo objects for sorting. This operator overrides the default STL operator() by comparing only the metrics of two CachedESTInfo objects (ignoring the EST indexes and any other information). This method uses the metric comparison functionality provided by all EST analyzers.
[in] | estInfo1 | The first CachedESTInfo object to be used for comparison. |
[in] | estInfo2 | The second CachedESTInfo object to be used for comparison. |
true
if estInfo1.metric
is better than estInfo2.metric
. Otherwise it returns false
. Definition at line 98 of file CachedESTInfoHelper.h.
References comparator, ESTAnalyzer::compareMetrics(), and CachedESTInfo::metric.
LessCachedESTInfo& LessCachedESTInfo::operator= | ( | const LessCachedESTInfo & | src | ) | [private] |
A dummy operator=.
The operator=() is supressed for this class as it has constant members whose value is set when the object is created. These values cannot be changed during the lifetime of this object.
[in] | src | The source object from where data is to be copied. Currently this value is ignored. |
const ESTAnalyzer* const LessCachedESTInfo::comparator [private] |
The functor for comparing.
This comparator is set based on the template parameter associated with the enclosing class.
Definition at line 108 of file CachedESTInfoHelper.h.
Referenced by operator()().