Chord's finger table module.
More...
#include <ChordFingerTable.h>
Detailed Description
Chord's finger table module.
This modul contains the finger table of the Chord implementation.
- Author
- Markus Mauch, Ingmar Baumgart
- See Also
- Chord
Definition at line 52 of file ChordFingerTable.h.
Member Function Documentation
const NodeHandle & oversim::ChordFingerTable::getFinger |
( |
uint32_t |
pos | ) |
|
|
virtual |
Returns the NodeVector of a particular finger.
- Parameters
-
pos | number of the finger to get |
- Returns
- NodeVector of the particular finger(s)
Definition at line 176 of file ChordFingerTable.cc.
{
throw new cRuntimeError("ChordFingerTable::getFinger(): "
"Index out of bound");
}
}
++p;
}
}
Definition at line 197 of file ChordFingerTable.cc.
{
throw new cRuntimeError("ChordFingerTable::getFinger(): "
"Index out of bound");
}
for (Successors::const_iterator it =
fingerTable[p].second.begin();
nextHop->push_back(it->second);
}
}
} else {
return nextHop;
}
if (nextHop->size() == 0) {
} else {
}
}
return nextHop;
}
uint32_t oversim::ChordFingerTable::getSize |
( |
| ) |
|
|
virtual |
Returns the size of the finger table.
- Returns
- number of fingers
Definition at line 63 of file ChordFingerTable.cc.
bool oversim::ChordFingerTable::handleFailedNode |
( |
const TransportAddress & |
failed | ) |
|
Definition at line 134 of file ChordFingerTable.cc.
{
bool ret = false;
ret = true;
}
for (std::multimap<simtime_t, NodeHandle>::iterator it =
++it) {
if (failed == it->second) {
break;
}
}
}
return ret;
}
void oversim::ChordFingerTable::handleMessage |
( |
cMessage * |
msg | ) |
|
|
virtual |
Definition at line 50 of file ChordFingerTable.cc.
{
error(
"this module doesn't handle messages, it runs only in initialize()");
}
void oversim::ChordFingerTable::initialize |
( |
int |
stage | ) |
|
|
virtual |
void oversim::ChordFingerTable::initializeTable |
( |
uint32_t |
size, |
|
|
const NodeHandle & |
owner, |
|
|
Chord * |
overlay |
|
) |
| |
|
virtual |
Sets up the finger table.
Sets up the finger table and makes all fingers pointing to the node itself. Should be called on startup to initialize the finger table.
- Parameters
-
size | number of fingers |
owner | set all fingers to the key of node handle owner |
overlay | pointer to the main chord module |
Definition at line 55 of file ChordFingerTable.cc.
virtual int oversim::ChordFingerTable::numInitStages |
( |
| ) |
const |
|
inlinevirtual |
void oversim::ChordFingerTable::removeFinger |
( |
uint32_t |
pos | ) |
|
Deletes a particular finger.
- Parameters
-
pos | number of the finger to get |
Definition at line 156 of file ChordFingerTable.cc.
{
throw new cRuntimeError("ChordFingerTable::removeFinger(): "
"Index out of bound");
}
return;
} else {
tempSuccessors);
}
}
void oversim::ChordFingerTable::setFinger |
( |
uint32_t |
pos, |
|
|
const NodeHandle & |
node, |
|
|
Successors const * |
sucNodes = NULL |
|
) |
| |
|
virtual |
Sets a particular finger to point to node.
- Parameters
-
pos | number of the finger to set |
node | set finger to this node |
sucNodes | optional pointer containing a list of successors of this finger |
Definition at line 68 of file ChordFingerTable.cc.
{
throw new cRuntimeError("ChordFingerTable::setFinger(): "
"Index out of bound");
}
tempSuccessors));
}
if (sucNodes != NULL) {
} else {
}
}
void oversim::ChordFingerTable::setFinger |
( |
uint32_t |
pos, |
|
|
const Successors & |
nodes |
|
) |
| |
|
virtual |
bool oversim::ChordFingerTable::updateFinger |
( |
uint32_t |
pos, |
|
|
const NodeHandle & |
node, |
|
|
simtime_t |
rtt |
|
) |
| |
|
virtual |
Definition at line 96 of file ChordFingerTable.cc.
{
if (rtt < 0)
return false;
throw new cRuntimeError("ChordFingerTable::updateFinger(): "
"Index out of bound");
}
tempSuccessors));
}
Successors::iterator it;
it++) {
if (it->second == node) {
break;
}
}
return false;
}
fingerTable[p].second.insert(std::make_pair(rtt, node));
return true;
}
Member Data Documentation
std::deque<FingerEntry> oversim::ChordFingerTable::fingerTable |
|
private |
uint32_t oversim::ChordFingerTable::maxSize |
|
private |
Chord* oversim::ChordFingerTable::overlay |
|
private |
The documentation for this class was generated from the following files: