Functor for CachedESTInfo sorting. More...
#include <CachedESTInfoHelper.h>
Public Member Functions | |
GreaterCachedESTInfo (const ESTAnalyzer *analyzer) | |
Constructor. | |
bool | operator() (const CachedESTInfo &estInfo1, const CachedESTInfo &estInfo2) |
operator() for CachedESTInfo to compare two CachedESTInfo objects. | |
Private Member Functions | |
GreaterCachedESTInfo & | operator= (const GreaterCachedESTInfo &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 descending order with the smallest values at the bottom. This functor is useful for maintaing heaps with the best metric at the top.
Definition at line 132 of file CachedESTInfoHelper.h.
GreaterCachedESTInfo::GreaterCachedESTInfo | ( | 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 derived classes for sorting cache entries.
[in] | analyzer | The analyzer to be used for comparing the metric values associated with two CachedESTInfo objects. |
Definition at line 147 of file CachedESTInfoHelper.h.
GreaterCachedESTInfo::operator() | ( | const CachedESTInfo & | estInfo1, | |
const CachedESTInfo & | estInfo2 | |||
) | [inline] |
operator() for CachedESTInfo to compare two CachedESTInfo objects.
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 estInfo2.metric
is better than estInfo1.metric
. Otherwise it returns false
. Definition at line 173 of file CachedESTInfoHelper.h.
References comparator, ESTAnalyzer::compareMetrics(), and CachedESTInfo::metric.
GreaterCachedESTInfo& GreaterCachedESTInfo::operator= | ( | const GreaterCachedESTInfo & | 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 GreaterCachedESTInfo::comparator [private] |
The functor for comparing.
This comparator is set based on the template parameter associated with the enclosing class.
Definition at line 183 of file CachedESTInfoHelper.h.
Referenced by operator()().