KademliaBucketEntry Class Reference

#include <KademliaNodeHandle.h>

Inheritance diagram for KademliaBucketEntry:
ProxNodeHandle NodeHandle TransportAddress

List of all members.

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)

Detailed Description

Definition at line 28 of file KademliaNodeHandle.h.


Constructor & Destructor Documentation

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     }


Member Function Documentation

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().

00062 { this->lastSeen = lastSeen; }

void KademliaBucketEntry::setPingSent ( bool  pingSent  )  [inline]

Definition at line 66 of file KademliaNodeHandle.h.

00066 { this->pingSent = pingSent; }

void KademliaBucketEntry::setRtt ( simtime_t  rtt  )  [inline]

Definition at line 52 of file KademliaNodeHandle.h.

Referenced by Kademlia::routingAdd().

00052 { this->prox.proximity = SIMTIME_DBL(rtt);  this->prox.accuracy = 1; } //deprecated

void KademliaBucketEntry::setStaleCount ( uint8_t  staleCount  )  [inline]

Definition at line 56 of file KademliaNodeHandle.h.

Referenced by resetStaleCount().

00056 { this->staleCount = staleCount; }


Friends And Related Function Documentation

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     };


Member Data Documentation

simtime_t KademliaBucketEntry::lastSeen [private]

Definition at line 73 of file KademliaNodeHandle.h.

Referenced by getLastSeen().

Definition at line 74 of file KademliaNodeHandle.h.

Referenced by KademliaBucketEntry().

Definition at line 68 of file KademliaNodeHandle.h.

Referenced by getStaleCount(), incStaleCount(), and KademliaBucketEntry().


The documentation for this class was generated from the following file:
Generated on Wed May 26 16:21:17 2010 for OverSim by  doxygen 1.6.3