#include <Comparator.h>
Public Member Functions | |
| KeyPrefixMetric () | |
| OverlayKey | distance (const OverlayKey &x, const OverlayKey &y) const |
| calculates the distance from x to y with the prefix metric | |
| void | setBitsPerDigit (uint8_t bitsPerDigit) |
Private Attributes | |
| uint8_t | bitsPerDigit |
Definition at line 159 of file Comparator.h.
| KeyPrefixMetric::KeyPrefixMetric | ( | ) | [inline] |
| OverlayKey KeyPrefixMetric::distance | ( | const OverlayKey & | x, | |
| const OverlayKey & | y | |||
| ) | const [inline] |
calculates the distance from x to y with the prefix metric
| x | origination key | |
| y | destination key |
Definition at line 174 of file Comparator.h.
Referenced by KademliaPRComparator::compare().
00176 { 00177 return OverlayKey::getLength() / bitsPerDigit 00178 - x.sharedPrefixLength(y, bitsPerDigit); 00179 }
| void KeyPrefixMetric::setBitsPerDigit | ( | uint8_t | bitsPerDigit | ) | [inline] |
Definition at line 181 of file Comparator.h.
00182 { 00183 this->bitsPerDigit = bitsPerDigit; 00184 }
uint8_t KeyPrefixMetric::bitsPerDigit [private] |
1.5.8