#include <Comparator.h>

Public Member Functions | |
| KademliaPRComparator (const OverlayKey &relativeKey, uint32_t bitsPerDigit=1) | |
| int | compare (const ProxKey &lhs, const ProxKey &rhs) const |
| indicates which of the two given prox/key-pairs is closer to the relative key | |
Definition at line 340 of file Comparator.h.
| KademliaPRComparator::KademliaPRComparator | ( | const OverlayKey & | relativeKey, | |
| uint32_t | bitsPerDigit = 1 | |||
| ) | [inline] |
Definition at line 343 of file Comparator.h.
00344 : ProxKeyComparator<KeyPrefixMetric, StdProxComparator>(relativeKey, bitsPerDigit) { }
| int KademliaPRComparator::compare | ( | const ProxKey & | lhs, | |
| const ProxKey & | rhs | |||
| ) | const [inline, virtual] |
indicates which of the two given prox/key-pairs is closer to the relative key
| lhs | first prox/key-pair | |
| rhs | second prox/key-pair |
Implements AbstractProxKeyComparator.
Definition at line 346 of file Comparator.h.
00347 { 00348 int temp = m.distance(lhs.key, key).compareTo(m.distance(rhs.key, key)); 00349 if (temp != 0) { 00350 return temp; 00351 } 00352 return pc.compare(lhs.prox, rhs.prox); 00353 }
1.5.8