KeyRingMetric Class Reference

#include <Comparator.h>

List of all members.


Detailed Description

OverlayKey Ring Metric.

Definition at line 108 of file Comparator.h.


Public Member Functions

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

Member Function Documentation

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

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 118 of file Comparator.h.

00120     {
00121         OverlayKey dist1(x - y);
00122         OverlayKey dist2(y - x);
00123 
00124         if (dist1 > dist2)
00125             return dist2;
00126         else
00127             return dist1;
00128     }


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

Generated on Wed Mar 25 16:32:53 2009 for OverSim by  doxygen 1.5.5