KeyRingMetric Class Reference

OverlayKey Ring Metric. More...

#include <Comparator.h>

List of all members.

Static Public Member Functions

static OverlayKey distance (const OverlayKey &x, const OverlayKey &y)
 calculates the distance from x to y on a bidirectional ring

Detailed Description

OverlayKey Ring Metric.

Definition at line 111 of file Comparator.h.


Member Function Documentation

static OverlayKey KeyRingMetric::distance ( const OverlayKey x,
const OverlayKey y 
) [inline, static]

calculates the distance from x to y on a bidirectional ring

Parameters:
x origination key
y destination key
Returns:
|y-x| on a bidirectional ring

Definition at line 121 of file Comparator.h.

00123     {
00124         OverlayKey dist1(x - y);
00125         OverlayKey dist2(y - x);
00126 
00127         if (dist1 > dist2)
00128             return dist2;
00129         else
00130             return dist1;
00131     }


The documentation for this class was generated from the following file:
Generated on Wed May 26 16:21:18 2010 for OverSim by  doxygen 1.6.3