OverSim
KademliaBucket Class Reference

#include <KademliaBucket.h>

Inheritance diagram for KademliaBucket:
BaseKeySortedVector< KademliaBucketEntry > vector

Public Member Functions

 KademliaBucket (uint16_t maxSize=0, const Comparator< OverlayKey > *comparator=NULL)
 ~KademliaBucket ()
void setLastUsage (simtime_t time)
simtime_t getLastUsage () const
- Public Member Functions inherited from BaseKeySortedVector< KademliaBucketEntry >
 BaseKeySortedVector (uint16_t maxSize=0, const Comparator< OverlayKey > *comparator=NULL, const AbstractProxComparator *proxComparator=NULL, const AbstractProxKeyComparator *proxKeyComparator=NULL, uint16_t sizeProx=0, uint16_t sizeComb=0)
 constructor
virtual ~BaseKeySortedVector ()
 destructor
bool isAddable (const KademliaBucketEntry &element) const
 indicates if an object of type T can be added to the NodeVector
bool isFull () const
 indicates if NodeVector holds maxSize nodes
bool isEmpty () const
 indicates if NodeVector holds at least one node
int add (const KademliaBucketEntry &element)
 adds an element of type T in increasing order to the NodeVector and returns the position of the added element or -1 if the element was not added
const bool contains (const OverlayKey &key) const
 Searches for an OverlayKey in NodeVector and returns true, if it is found.
const KademliaBucketEntryfind (const OverlayKey &key) const
 searches for an OverlayKey in NodeVector
iterator findIterator (const OverlayKey &key)
 Searches for an OberlayKey in a NodeVector and returns an appropriate iterator.
void downsizeTo (const uint32_t maxElements)
 Downsize the vector to a maximum of maxElements.
void setComparator (const Comparator< OverlayKey > *comparator)

Public Attributes

std::list< KademliaBucketEntryreplacementCache

Private Attributes

simtime_t lastUsage

Additional Inherited Members

- Public Types inherited from BaseKeySortedVector< KademliaBucketEntry >
typedef std::vector
< KademliaBucketEntry >
::iterator 
iterator
 iterator for this vector
typedef std::vector
< KademliaBucketEntry >
::const_iterator 
const_iterator
 read-only iterator for this vector
- Static Public Attributes inherited from BaseKeySortedVector< KademliaBucketEntry >
static const KademliaBucketEntry UNSPECIFIED_ELEMENT
 unspecified element of type T

Detailed Description

Definition at line 28 of file KademliaBucket.h.

Constructor & Destructor Documentation

KademliaBucket::KademliaBucket ( uint16_t  maxSize = 0,
const Comparator< OverlayKey > *  comparator = NULL 
)
KademliaBucket::~KademliaBucket ( )

Definition at line 33 of file KademliaBucket.cc.

{
}

Member Function Documentation

simtime_t KademliaBucket::getLastUsage ( ) const
inline

Definition at line 39 of file KademliaBucket.h.

Referenced by Kademlia::handleBucketRefreshTimerExpired(), and operator<<().

{
return this->lastUsage;
}
void KademliaBucket::setLastUsage ( simtime_t  time)
inline

Definition at line 35 of file KademliaBucket.h.

Referenced by Kademlia::handleBucketRefreshTimerExpired(), and Kademlia::setBucketUsage().

{
this->lastUsage = time;
}

Member Data Documentation

simtime_t KademliaBucket::lastUsage
private

Definition at line 46 of file KademliaBucket.h.

Referenced by getLastUsage(), KademliaBucket(), and setLastUsage().

std::list<KademliaBucketEntry> KademliaBucket::replacementCache

Definition at line 43 of file KademliaBucket.h.

Referenced by Kademlia::routingAdd(), and Kademlia::routingTimeout().


The documentation for this class was generated from the following files: