#include <Comparator.h>

Public Member Functions | |
| int | compare (const Prox &lhs, const Prox &rhs) const |
| indicates which of the two given proximities is "better" | |
Definition at line 271 of file Comparator.h.
indicates which of the two given proximities is "better"
| lhs | first proximity value | |
| rhs | second proximity value |
Implements AbstractProxComparator.
Definition at line 274 of file Comparator.h.
Referenced by KademliaPRComparator::compare().
00275 { 00276 // return 0 if accuracy is too low 00277 if (lhs.accuracy < 0.5 || rhs.accuracy < 0.5) return 0; 00278 00279 if (lhs.proximity < rhs.proximity) return -1; 00280 if (lhs.proximity > rhs.proximity) return 1; 00281 return 0; 00282 }
1.5.8