#include <Comparator.h>

Public Member Functions | |
| KeyDistanceComparator (const OverlayKey &relativeKey) | |
| constructor | |
| int | compare (const OverlayKey &lhs, const OverlayKey &rhs) const |
| indicates which of the two given keys is closer to the relative key | |
Private Attributes | |
| Metric | m |
| indicates which metric to use for the comparison | |
| OverlayKey | key |
| the relative key to which distances are compared | |
Definition at line 194 of file Comparator.h.
| KeyDistanceComparator< Metric >::KeyDistanceComparator | ( | const OverlayKey & | relativeKey | ) | [inline] |
constructor
Definition at line 204 of file Comparator.h.
00205 { 00206 this->key = relativeKey; 00207 }
| int KeyDistanceComparator< Metric >::compare | ( | const OverlayKey & | lhs, | |
| const OverlayKey & | rhs | |||
| ) | const [inline, virtual] |
indicates which of the two given keys is closer to the relative key
| lhs | first key | |
| rhs | second key |
Reimplemented from Comparator< OverlayKey >.
Definition at line 218 of file Comparator.h.
Referenced by Kademlia::handleFailedNode(), and Kademlia::routingTimeout().
OverlayKey KeyDistanceComparator< Metric >::key [private] |
the relative key to which distances are compared
Definition at line 198 of file Comparator.h.
Referenced by KeyDistanceComparator< KeyPrefixMetric >::compare(), KeyDistanceComparator< KeyXorMetric >::compare(), KeyDistanceComparator< KeyPrefixMetric >::KeyDistanceComparator(), and KeyDistanceComparator< KeyXorMetric >::KeyDistanceComparator().
Metric KeyDistanceComparator< Metric >::m [private] |
indicates which metric to use for the comparison
Definition at line 197 of file Comparator.h.
Referenced by KeyDistanceComparator< KeyPrefixMetric >::compare(), KeyDistanceComparator< KeyXorMetric >::compare(), and KeyDistanceComparator< KeyPrefixMetric >::KeyDistanceComparator().
1.5.8