OverSim
Comparator< T > Class Template Reference

Default Comparator. More...

#include <Comparator.h>

Public Member Functions

virtual ~Comparator ()
 virtual destructor
virtual int compare (const T &lhs, const T &rhs) const
 compares two variables of type T and indicates which one is smaller or if they are equal

Detailed Description

template<class T>
class Comparator< T >

Default Comparator.

Definition at line 34 of file Comparator.h.

Constructor & Destructor Documentation

template<class T>
virtual Comparator< T >::~Comparator ( )
inlinevirtual

virtual destructor

Definition at line 40 of file Comparator.h.

{}

Member Function Documentation

template<class T>
virtual int Comparator< T >::compare ( const T &  lhs,
const T &  rhs 
) const
inlinevirtual

compares two variables of type T and indicates which one is smaller or if they are equal

Parameters
lhsfirst variable to compare
rhssecond variable to compare
Returns
-1 if rhs is smaller, 0 if lhs and rhs are equal and 1 if rhs is greater

Reimplemented in KeyDistanceComparator< KeyPrefixMetric >, KeyDistanceComparator< Metric >, KeyDistanceComparator< KeyXorMetric >, and IterativeLookup.

Definition at line 52 of file Comparator.h.

Referenced by BaseKeySortedVector< LookupEntry >::add(), and BaseKeySortedVector< LookupEntry >::isAddable().

{
return lhs.compareTo(rhs);
}

The documentation for this class was generated from the following file: