OverSim
ChordFingerTable.cc File Reference
#include <cfloat>
#include "hashWatch.h"
#include "Chord.h"
#include "ChordSuccessorList.h"
#include "ChordFingerTable.h"

Go to the source code of this file.

Namespaces

namespace  oversim

Functions

 oversim::Define_Module (ChordFingerTable)
std::ostream & operator<< (std::ostream &os, const Successors &suc)
std::ostream & operator<< (std::ostream &os, const FingerEntry &entry)

Detailed Description

Author
Markus Mauch, Ingmar Baumgart

Definition in file ChordFingerTable.cc.

Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const Successors suc 
)

Definition at line 237 of file ChordFingerTable.cc.

{
for (Successors::const_iterator i = suc.begin(); i != suc.end(); i++) {
if (i != suc.begin()) {
os << endl;
}
os << i->second;
if (i->first == -1) {
continue;
} else if (i->first == MAXTIME) {
os << "; RTT: --- ";
} else {
os << "; RTT: " << i->first;
}
}
return os;
}
std::ostream& operator<< ( std::ostream &  os,
const FingerEntry entry 
)

Definition at line 258 of file ChordFingerTable.cc.

{
if (entry.second.size() > 0) {
os << "[ " << entry.first << " ]\n" << entry.second;
} else {
os << entry.first;
}
return os;
}