#include <KademliaNodeHandle.h>
Public Member Functions | |
KademliaBucketEntry () | |
Constructs an unspecified NodeHandle. | |
KademliaBucketEntry (const NodeHandle &handle, simtime_t prox=MAXTIME) | |
simtime_t | getRtt () const |
void | setRtt (simtime_t rtt) |
uint8_t | getStaleCount () const |
void | setStaleCount (uint8_t staleCount) |
void | resetStaleCount () |
void | incStaleCount () |
void | setLastSeen (simtime_t lastSeen) |
simtime_t | getLastSeen () |
void | setPingSent (bool pingSent) |
bool | getPingSent () const |
Private Attributes | |
uint8_t | staleCount |
simtime_t | lastSeen |
bool | pingSent |
Friends | |
std::ostream & | operator<< (std::ostream &os, const KademliaBucketEntry &n) |
Definition at line 28 of file KademliaNodeHandle.h.
KademliaBucketEntry::KademliaBucketEntry | ( | ) | [inline] |
Constructs an unspecified NodeHandle.
Definition at line 34 of file KademliaNodeHandle.h.
00035 : ProxNodeHandle() 00036 { 00037 staleCount = 0; 00038 pingSent = false; 00039 }
KademliaBucketEntry::KademliaBucketEntry | ( | const NodeHandle & | handle, | |
simtime_t | prox = MAXTIME | |||
) | [inline] |
Definition at line 41 of file KademliaNodeHandle.h.
00042 : ProxNodeHandle(handle) 00043 { 00044 staleCount = 0; 00045 this->prox.proximity = SIMTIME_DBL(prox); 00046 this->prox.accuracy = 1.0; 00047 pingSent = false; 00048 }
simtime_t KademliaBucketEntry::getLastSeen | ( | ) | [inline] |
Definition at line 64 of file KademliaNodeHandle.h.
00064 { return this->lastSeen; }
bool KademliaBucketEntry::getPingSent | ( | ) | const [inline] |
Definition at line 68 of file KademliaNodeHandle.h.
00068 { return pingSent; };
simtime_t KademliaBucketEntry::getRtt | ( | ) | const [inline] |
Definition at line 51 of file KademliaNodeHandle.h.
Referenced by Kademlia::routingAdd().
00051 { return getProx(); } //deprecated
uint8_t KademliaBucketEntry::getStaleCount | ( | ) | const [inline] |
Definition at line 54 of file KademliaNodeHandle.h.
00054 { return staleCount; }
void KademliaBucketEntry::incStaleCount | ( | ) | [inline] |
Definition at line 60 of file KademliaNodeHandle.h.
00060 { this->staleCount++; }
void KademliaBucketEntry::resetStaleCount | ( | ) | [inline] |
Definition at line 58 of file KademliaNodeHandle.h.
00058 { this->setStaleCount(0); }
void KademliaBucketEntry::setLastSeen | ( | simtime_t | lastSeen | ) | [inline] |
Definition at line 62 of file KademliaNodeHandle.h.
Referenced by Kademlia::routingAdd().
void KademliaBucketEntry::setPingSent | ( | bool | pingSent | ) | [inline] |
Definition at line 66 of file KademliaNodeHandle.h.
void KademliaBucketEntry::setRtt | ( | simtime_t | rtt | ) | [inline] |
Definition at line 52 of file KademliaNodeHandle.h.
Referenced by Kademlia::routingAdd().
void KademliaBucketEntry::setStaleCount | ( | uint8_t | staleCount | ) | [inline] |
Definition at line 56 of file KademliaNodeHandle.h.
Referenced by resetStaleCount().
00056 { this->staleCount = staleCount; }
std::ostream& operator<< | ( | std::ostream & | os, | |
const KademliaBucketEntry & | n | |||
) | [friend] |
Definition at line 76 of file KademliaNodeHandle.h.
00078 { 00079 os << (NodeHandle)n << " " << n.prox.proximity; 00080 return os; 00081 };
simtime_t KademliaBucketEntry::lastSeen [private] |
Definition at line 73 of file KademliaNodeHandle.h.
Referenced by getLastSeen().
bool KademliaBucketEntry::pingSent [private] |
Definition at line 74 of file KademliaNodeHandle.h.
Referenced by KademliaBucketEntry().
uint8_t KademliaBucketEntry::staleCount [private] |
Definition at line 68 of file KademliaNodeHandle.h.
Referenced by getStaleCount(), incStaleCount(), and KademliaBucketEntry().