OverSim
|
#include <BrooseBucket.h>
Public Member Functions | |
virtual int | numInitStages () const |
virtual void | initialize (int stage) |
virtual void | handleMessage (cMessage *msg) |
virtual bool | add (const NodeHandle &node, bool isAlive=false, simtime_t rtt=MAXTIME) |
adds a broose node handle to the bucket | |
virtual void | remove (const NodeHandle &node) |
removes a broose node handle from the bucket | |
virtual const BrooseHandle & | get (uint32_t pos=0) |
returns a specific broose handle | |
virtual const OverlayKey & | getDist (uint32_t pos=0) |
returns distance of a specific broose handle | |
virtual void | initializeBucket (int shiftingBits, uint32_t prefix, int size, Broose *overlay, bool isBBucket=false) |
initializes a bucket | |
virtual uint32_t | getSize () |
returns number of current entries | |
virtual uint32_t | getMaxSize () |
returns number of maximal entries | |
virtual void | fillVector (NodeVector *result) |
Fills a NodeVector with all bucket entries. | |
virtual bool | isEmpty () |
checks if the bucket is empty | |
virtual void | clear () |
removes all entries from the bucket | |
virtual int | longestPrefix (void) |
return the longest prefix of all entries | |
virtual bool | keyInRange (const OverlayKey &key) |
checks if the key close to the owner's id | |
virtual int | getPos (const NodeHandle &node) |
returns the position of a node in this bucket | |
virtual int | getFailedResponses (const NodeHandle &node) |
returns the number of failed responses to a specific broose handle | |
virtual void | increaseFailedResponses (const NodeHandle &node) |
increase the number of failed responses to a specific broose handle | |
virtual void | resetFailedResponses (const NodeHandle &node) |
resets the counter of failed responses to a specific broose handle | |
virtual void | setRTT (const NodeHandle &node, simtime_t rpcRTT) |
sets the round trip time to a specific broose handle | |
virtual simtime_t | getRTT (const NodeHandle &node) |
returns the round trip time to a specific broose handle | |
virtual void | setLastSeen (const NodeHandle &node, simtime_t lastSeen) |
updates the timestamp of a specific node | |
virtual simtime_t | getLastSeen (const NodeHandle &node) |
returns the timestamp of a specific node | |
void | output (int maxEntries=0) |
displays the content of the bucket on standard out |
Protected Attributes | |
std::map< OverlayKey, BrooseHandle > | bucket |
data structure representing the bucket | |
std::map< OverlayKey, BrooseHandle >::iterator | bucketIter |
iterator to navigate through the bucket | |
unsigned int | maxSize |
maximal size of the bucket | |
OverlayKey | key |
the node's key shifted to fit the bucket and used to measure distance to other keys | |
Broose * | overlay |
pointer to the main Broose module | |
bool | isBBucket |
true, if this bucket is the node's BBucket |
Broose bucket module.
This modul contains the bucket of the Broose implementation.
Definition at line 43 of file BrooseBucket.h.
|
virtual |
adds a broose node handle to the bucket
node | the NodeHandle to add |
isAlive | true, if it is known that the node is alive |
rtt | measured round-trip-time to node |
Definition at line 70 of file BrooseBucket.cc.
Referenced by Broose::changeState(), and Broose::handleBucketTimerExpired().
|
virtual |
removes all entries from the bucket
Definition at line 189 of file BrooseBucket.cc.
|
virtual |
Fills a NodeVector with all bucket entries.
result | a pointer to an existing NodeVector, which gets filled with all bucket entries |
Definition at line 194 of file BrooseBucket.cc.
|
virtual |
returns a specific broose handle
pos | position of the broose handle in the bucket |
Definition at line 137 of file BrooseBucket.cc.
Referenced by Broose::changeState(), and Broose::handleBucketTimerExpired().
|
virtual |
returns distance of a specific broose handle
pos | position of the broose handle in the bucket |
Definition at line 155 of file BrooseBucket.cc.
Referenced by keyInRange().
|
virtual |
returns the number of failed responses to a specific broose handle
node | broose handle to check |
Definition at line 273 of file BrooseBucket.cc.
|
virtual |
returns the timestamp of a specific node
node | broose handle to which the timestamp will be retrieved |
Definition at line 325 of file BrooseBucket.cc.
|
virtual |
returns number of maximal entries
Definition at line 179 of file BrooseBucket.cc.
|
virtual |
returns the position of a node in this bucket
node | broose handle to check |
Definition at line 262 of file BrooseBucket.cc.
|
virtual |
returns the round trip time to a specific broose handle
node | broose handle to which the rtt will be retrieved |
Definition at line 308 of file BrooseBucket.cc.
|
virtual |
returns number of current entries
Definition at line 174 of file BrooseBucket.cc.
Referenced by Broose::changeState(), and Broose::handleBucketTimerExpired().
|
virtual |
Definition at line 44 of file BrooseBucket.cc.
|
virtual |
increase the number of failed responses to a specific broose handle
node | broose handle which counter will be increased |
Definition at line 282 of file BrooseBucket.cc.
|
virtual |
Definition at line 36 of file BrooseBucket.cc.
|
virtual |
initializes a bucket
shiftingBits | specifies the kind of the bucket |
prefix | in case of a R bucket specifies the prefix |
size | maximal size of the bucket |
overlay | pointer to the main Broose module |
isBBucket | true, is this bucket is the node's BBucket |
Definition at line 49 of file BrooseBucket.cc.
Referenced by Broose::changeState(), and Broose::handleBucketTimerExpired().
|
virtual |
checks if the bucket is empty
Definition at line 184 of file BrooseBucket.cc.
|
virtual |
checks if the key close to the owner's id
key | key to check |
Definition at line 239 of file BrooseBucket.cc.
|
virtual |
return the longest prefix of all entries
Definition at line 202 of file BrooseBucket.cc.
|
inlinevirtual |
Definition at line 46 of file BrooseBucket.h.
void BrooseBucket::output | ( | int | maxEntries = 0 | ) |
displays the content of the bucket on standard out
maxEntries | the maximal number of entries which will be printed |
Definition at line 211 of file BrooseBucket.cc.
|
virtual |
removes a broose node handle from the bucket
node | broose handle which will be removed |
Definition at line 117 of file BrooseBucket.cc.
|
virtual |
resets the counter of failed responses to a specific broose handle
node | broose handle which counter will be reset |
Definition at line 290 of file BrooseBucket.cc.
|
virtual |
updates the timestamp of a specific node
node | broose handle to which the timestamp will be updated |
lastSeen | timestamp of the last message |
Definition at line 317 of file BrooseBucket.cc.
|
virtual |
sets the round trip time to a specific broose handle
node | broose handle to which the rtt will be stored |
rpcRTT | rtt to the specific node |
Definition at line 299 of file BrooseBucket.cc.
|
protected |
data structure representing the bucket
Definition at line 221 of file BrooseBucket.h.
Referenced by add(), clear(), fillVector(), get(), getDist(), getFailedResponses(), getLastSeen(), getPos(), getRTT(), getSize(), increaseFailedResponses(), initialize(), initializeBucket(), isEmpty(), keyInRange(), longestPrefix(), output(), remove(), resetFailedResponses(), setLastSeen(), and setRTT().
|
protected |
iterator to navigate through the bucket
Definition at line 222 of file BrooseBucket.h.
Referenced by add(), fillVector(), getFailedResponses(), getLastSeen(), getRTT(), increaseFailedResponses(), output(), remove(), resetFailedResponses(), setLastSeen(), and setRTT().
|
protected |
true, if this bucket is the node's BBucket
Definition at line 227 of file BrooseBucket.h.
Referenced by add(), initializeBucket(), keyInRange(), and remove().
|
protected |
the node's key shifted to fit the bucket and used to measure distance to other keys
Definition at line 225 of file BrooseBucket.h.
Referenced by add(), and initializeBucket().
|
protected |
maximal size of the bucket
Definition at line 224 of file BrooseBucket.h.
Referenced by add(), getMaxSize(), initializeBucket(), keyInRange(), output(), and remove().
|
protected |
pointer to the main Broose module
Definition at line 226 of file BrooseBucket.h.
Referenced by add(), initializeBucket(), keyInRange(), output(), and remove().