OverSim
AbstractProxKeyComparator Class Reference

#include <Comparator.h>

Inheritance diagram for AbstractProxKeyComparator:
ProxKeyComparator< Metric, ProxComp > ProxKeyComparator< KeyPrefixMetric > AccordionPRComparator KademliaPRComparator

Public Member Functions

virtual ~AbstractProxKeyComparator ()
virtual int compare (const ProxKey &lhs, const ProxKey &rhs) const =0
 indicates which of the two given prox/key-pairs is closer to the relative key

Detailed Description

Definition at line 306 of file Comparator.h.

Constructor & Destructor Documentation

virtual AbstractProxKeyComparator::~AbstractProxKeyComparator ( )
inlinevirtual

Definition at line 309 of file Comparator.h.

{};

Member Function Documentation

virtual int AbstractProxKeyComparator::compare ( const ProxKey lhs,
const ProxKey rhs 
) const
pure virtual

indicates which of the two given prox/key-pairs is closer to the relative key

Parameters
lhsfirst prox/key-pair
rhssecond prox/key-pair
Returns
-1 if lhs is closer, 0 if lhs and rhs are equal and 1 if rhs closer to the relative key

Implemented in AccordionPRComparator, and KademliaPRComparator.

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


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