#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.
: ProxNodeHandle() { staleCount = 0; pingSent = false; }
| KademliaBucketEntry::KademliaBucketEntry | ( | const NodeHandle & | handle, | |
| simtime_t | prox = MAXTIME | |||
| ) | [inline] |
Definition at line 41 of file KademliaNodeHandle.h.
: ProxNodeHandle(handle) { staleCount = 0; this->prox.proximity = SIMTIME_DBL(prox); this->prox.accuracy = 1.0; pingSent = false; }
| simtime_t KademliaBucketEntry::getLastSeen | ( | ) | [inline] |
Definition at line 64 of file KademliaNodeHandle.h.
{ return this->lastSeen; }
| bool KademliaBucketEntry::getPingSent | ( | ) | const [inline] |
Definition at line 68 of file KademliaNodeHandle.h.
{ return pingSent; };
| simtime_t KademliaBucketEntry::getRtt | ( | ) | const [inline] |
Definition at line 51 of file KademliaNodeHandle.h.
Referenced by Kademlia::routingAdd().
{ return getProx(); } //deprecated
| uint8_t KademliaBucketEntry::getStaleCount | ( | ) | const [inline] |
Definition at line 54 of file KademliaNodeHandle.h.
{ return staleCount; }
| void KademliaBucketEntry::incStaleCount | ( | ) | [inline] |
Definition at line 60 of file KademliaNodeHandle.h.
{ this->staleCount++; }
| void KademliaBucketEntry::resetStaleCount | ( | ) | [inline] |
Definition at line 58 of file KademliaNodeHandle.h.
{ 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().
{ this->staleCount = staleCount; }
| std::ostream& operator<< | ( | std::ostream & | os, | |
| const KademliaBucketEntry & | n | |||
| ) | [friend] |
Definition at line 76 of file KademliaNodeHandle.h.
{
os << (NodeHandle)n << " " << n.prox.proximity;
return os;
};
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().
1.7.1