OverSim
KeyPrefixMetric Class Reference

OverlayKey prefix metric. More...

#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

Detailed Description

OverlayKey prefix metric.

Definition at line 180 of file Comparator.h.

Constructor & Destructor Documentation

KeyPrefixMetric::KeyPrefixMetric ( )
inline

Definition at line 183 of file Comparator.h.

{
}

Member Function Documentation

OverlayKey KeyPrefixMetric::distance ( const OverlayKey x,
const OverlayKey y 
) const
inline

calculates the distance from x to y with the prefix metric

Parameters
xorigination key
ydestination key
Returns
|differing suffix|

Definition at line 195 of file Comparator.h.

Referenced by KademliaPRComparator::compare(), AccordionPRComparator::compare(), Kademlia::distance(), BasePastry::distance(), and Kademlia::findNode().

void KeyPrefixMetric::setBitsPerDigit ( uint8_t  bitsPerDigit)
inline

Definition at line 202 of file Comparator.h.

{
}

Member Data Documentation

uint8_t KeyPrefixMetric::bitsPerDigit
private

Definition at line 208 of file Comparator.h.

Referenced by distance(), KeyPrefixMetric(), and setBitsPerDigit().


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