OverSim
|
A common overlay key class. More...
#include <OverlayKey.h>
Public Member Functions | |
OverlayKey () | |
Default constructor. | |
OverlayKey (uint32_t num) | |
Constructs an overlay key initialized with a common integer. | |
OverlayKey (const unsigned char *buffer, uint32_t size) | |
Constructs a key out of a buffer. | |
OverlayKey (const std::string &str, uint32_t base=16) | |
Constructs a key out of a string number. | |
OverlayKey (const OverlayKey &rhs) | |
Copy constructor. | |
~OverlayKey () | |
Default destructor. | |
std::string | toString (uint32_t base=16) const |
Returns a string representation of this key. | |
bool | isUnspecified () const |
Returns true, if the key is unspecified. | |
bool | operator< (const OverlayKey &compKey) const |
compares this to a given OverlayKey | |
bool | operator> (const OverlayKey &compKey) const |
compares this to a given OverlayKey | |
bool | operator<= (const OverlayKey &compKey) const |
compares this to a given OverlayKey | |
bool | operator>= (const OverlayKey &compKey) const |
compares this to a given OverlayKey | |
bool | operator== (const OverlayKey &compKey) const |
compares this to a given OverlayKey | |
bool | operator!= (const OverlayKey &compKey) const |
compares this to a given OverlayKey | |
int | compareTo (const OverlayKey &compKey) const |
Unifies all compare operations in one method. | |
OverlayKey & | operator= (const OverlayKey &rhs) |
assigns OverlayKey of rhs to this->key | |
OverlayKey & | operator-- () |
substracts 1 from this->key | |
OverlayKey & | operator++ () |
adds 1 to this->key | |
OverlayKey & | operator+= (const OverlayKey &rhs) |
adds rhs->key to this->key | |
OverlayKey & | operator-= (const OverlayKey &rhs) |
substracts rhs->key from this->key | |
OverlayKey | operator+ (const OverlayKey &rhs) const |
adds rhs->key to this->key | |
OverlayKey | operator- (const OverlayKey &rhs) const |
substracts rhs->key from this->key | |
OverlayKey | operator-- (int) |
substracts 1 from this->key | |
OverlayKey | operator++ (int) |
adds 1 to this->key | |
OverlayKey | operator>> (uint32_t num) const |
bitwise shift right | |
OverlayKey | operator<< (uint32_t num) const |
bitwise shift left | |
OverlayKey | operator& (const OverlayKey &rhs) const |
bitwise AND of rhs->key and this->key | |
OverlayKey | operator| (const OverlayKey &rhs) const |
bitwise OR of rhs->key and this->key | |
OverlayKey | operator^ (const OverlayKey &rhs) const |
bitwise XOR of rhs->key and this->key | |
OverlayKey | operator~ () const |
bitwise NOT of this->key | |
OverlayKeyBit | operator[] (uint32_t n) |
returns the n-th bit of this->key | |
OverlayKey & | setBit (uint32_t pos, bool value) |
sets a bit of this->key | |
uint32_t | getBitRange (uint32_t p, uint32_t n) const |
Returns a sub integer at position p with n-bits. | |
double | toDouble () const |
bool | getBit (uint32_t p) const |
size_t | hash () const |
Returns a hash value for the key. | |
int | log_2 () const |
Returns the position of the msb in this key, which represents just the logarithm to base 2. | |
OverlayKey | randomSuffix (uint32_t pos) const |
Fills the suffix starting at pos with random bits to lsb. | |
OverlayKey | randomPrefix (uint32_t pos) const |
Fills the prefix starting at pos with random bits to msb. | |
uint32_t | sharedPrefixLength (const OverlayKey &compKey, uint32_t bitsPerDigit=1) const |
Calculates the number of equal bits (digits) from the left with another Key (shared prefix length) | |
bool | isBetween (const OverlayKey &keyA, const OverlayKey &keyB) const |
Returns true, if this key is element of the interval (keyA, keyB) on the ring. | |
bool | isBetweenR (const OverlayKey &keyA, const OverlayKey &keyB) const |
Returns true, if this key is element of the interval (keyA, keyB] on the ring. | |
bool | isBetweenL (const OverlayKey &keyA, const OverlayKey &keyB) const |
Returns true, if this key is element of the interval [keyA, keyB) on the ring. | |
bool | isBetweenLR (const OverlayKey &keyA, const OverlayKey &keyB) const |
Returns true, if this key is element of the interval [keyA, keyB] on the ring. | |
void | netPack (cCommBuffer *b) |
serializes the object into a buffer | |
void | netUnpack (cCommBuffer *b) |
deserializes the object from a buffer |
Static Public Member Functions | |
static void | setKeyLength (uint32_t length) |
Set the length of an OverlayKey. | |
static uint32_t | getLength () |
Returns the length in number of bits. | |
static OverlayKey | random () |
Returns a random key. | |
static OverlayKey | getMax () |
Returns the maximum key, i.e. | |
static OverlayKey | sha1 (const BinaryValue &value) |
Returns a key with the SHA1 cryptographic hash of a BinaryValue. | |
static OverlayKey | pow2 (uint32_t exponent) |
Returns a key 2^exponent. | |
static void | test () |
A pseudo regression test method. |
Static Public Attributes | |
static const OverlayKey | UNSPECIFIED_KEY |
OverlayKey without defined key. | |
static const OverlayKey | ZERO |
OverlayKey with key initialized as 0. | |
static const OverlayKey | ONE |
OverlayKey with key initialized as 1. |
Private Member Functions | |
void | trim () |
trims key after key operations | |
void | clear () |
set this->key to 0 and isUnspec to false |
Private Attributes | |
bool | isUnspec |
is this->key unspecified? | |
mp_limb_t | key [MAX_KEYLENGTH/(8 *sizeof(mp_limb_t))+(MAX_KEYLENGTH%(8 *sizeof(mp_limb_t))!=0?1:0)] |
the overlay key this object represents |
Static Private Attributes | |
static const uint32_t | MAX_KEYLENGTH = 160 |
maximum length of the key | |
static uint32_t | keyLength = MAX_KEYLENGTH |
actual length of the key | |
static uint32_t | aSize |
number of needed machine words to hold the key | |
static mp_limb_t | GMP_MSB_MASK |
bits to fill up if key does not exactly fit in one or more machine words |
Friends | |
std::ostream & | operator<< (std::ostream &os, const OverlayKey &c) |
Common stdc++ console output method. |
A common overlay key class.
Wraps common functions from Gnu MP library.
Definition at line 46 of file OverlayKey.h.
OverlayKey::OverlayKey | ( | ) |
Default constructor.
Contructs an unspecified overlay key
Definition at line 67 of file OverlayKey.cc.
OverlayKey::OverlayKey | ( | uint32_t | num | ) |
Constructs an overlay key initialized with a common integer.
num | The integer to initialize this key with |
Definition at line 73 of file OverlayKey.cc.
OverlayKey::OverlayKey | ( | const unsigned char * | buffer, |
uint32_t | size | ||
) |
Constructs a key out of a buffer.
buffer | Source buffer |
size | Buffer size (in bytes) |
Definition at line 81 of file OverlayKey.cc.
OverlayKey::OverlayKey | ( | const std::string & | str, |
uint32_t | base = 16 |
||
) |
Constructs a key out of a string number.
Definition at line 92 of file OverlayKey.cc.
OverlayKey::OverlayKey | ( | const OverlayKey & | rhs | ) |
Copy constructor.
rhs | The key to copy. |
Definition at line 120 of file OverlayKey.cc.
OverlayKey::~OverlayKey | ( | ) |
|
inlineprivate |
set this->key to 0 and isUnspec to false
Definition at line 814 of file OverlayKey.cc.
int OverlayKey::compareTo | ( | const OverlayKey & | compKey | ) | const |
Unifies all compare operations in one method.
compKey | key to compare with |
Definition at line 806 of file OverlayKey.cc.
Referenced by IterativeLookup::compare(), KademliaPRComparator::compare(), AccordionPRComparator::compare(), NodeHandle::operator<(), and NodeHandle::operator>().
|
inline |
Definition at line 335 of file OverlayKey.h.
Referenced by Bamboo::doGlobalTuning(), oversim::Koorde::findDeBruijnHop(), and Broose::findNode().
uint32_t OverlayKey::getBitRange | ( | uint32_t | p, |
uint32_t | n | ||
) | const |
Returns a sub integer at position p with n-bits.
p is counted starting from the least significant bit of the key as bit 0. Bit p of the key becomes bit 0 of the returned integer.
p | the position of the sub-integer |
n | the number of bits to be returned (max.32) |
Definition at line 424 of file OverlayKey.cc.
Referenced by PastryRoutingTable::digitAt(), Bamboo::doGlobalTuning(), getBit(), XmlRpcInterface::handleReadyMessage(), Kademlia::routingBucketIndex(), and test().
|
static |
Returns the length in number of bits.
Definition at line 153 of file OverlayKey.cc.
Referenced by PastryRoutingTable::digitAt(), KeyPrefixMetric::distance(), Bamboo::doGlobalTuning(), oversim::Koorde::findDeBruijnHop(), Broose::findNode(), oversim::Koorde::findStartKey(), XmlRpcInterface::handleAppTunPacket(), Kademlia::handleBucketRefreshTimerExpired(), P2pns::handleReadyMessage(), XmlRpcInterface::handleReadyMessage(), P2pns::handleTunnelLookupResponse(), BrooseBucket::initializeBucket(), oversim::Chord::initializeOverlay(), Broose::initializeOverlay(), Kademlia::initializeOverlay(), Kademlia::refillSiblingTable(), Kademlia::routingBucketIndex(), NeighborCache::setCbrNodeId(), test(), and P2pns::updateIdCacheWithNewTransport().
|
static |
Returns the maximum key, i.e.
a key filled with bit 1
Definition at line 625 of file OverlayKey.cc.
Referenced by TreeManagement::checkParentValid(), TreeManagement::getResponsibleDomainKey(), PastryStateObject::keyDist(), and test().
size_t OverlayKey::hash | ( | ) | const |
Returns a hash value for the key.
Definition at line 547 of file OverlayKey.cc.
bool OverlayKey::isBetween | ( | const OverlayKey & | keyA, |
const OverlayKey & | keyB | ||
) | const |
Returns true, if this key is element of the interval (keyA, keyB) on the ring.
keyA | The left border of the interval |
keyB | The right border of the interval |
Definition at line 553 of file OverlayKey.cc.
Referenced by TreeManagement::getResponsibleDomainKey(), oversim::Chord::handleRpcStabilizeResponse(), PastryLeafSet::mergeNode(), oversim::Chord::rpcNotify(), and test().
bool OverlayKey::isBetweenL | ( | const OverlayKey & | keyA, |
const OverlayKey & | keyB | ||
) | const |
Returns true, if this key is element of the interval [keyA, keyB) on the ring.
keyA | The left border of the interval |
keyB | The right border of the interval |
Definition at line 583 of file OverlayKey.cc.
bool OverlayKey::isBetweenLR | ( | const OverlayKey & | keyA, |
const OverlayKey & | keyB | ||
) | const |
Returns true, if this key is element of the interval [keyA, keyB] on the ring.
keyA | The left border of the interval |
keyB | The right border of the interval |
Definition at line 598 of file OverlayKey.cc.
Referenced by PastryLeafSet::getDestinationNode(), oversim::ChordFingerTable::getFinger(), and oversim::ChordSuccessorList::updateList().
bool OverlayKey::isBetweenR | ( | const OverlayKey & | keyA, |
const OverlayKey & | keyB | ||
) | const |
Returns true, if this key is element of the interval (keyA, keyB] on the ring.
keyA | The left border of the interval |
keyB | The right border of the interval |
Definition at line 568 of file OverlayKey.cc.
Referenced by oversim::Koorde::findDeBruijnHop(), oversim::Koorde::findNode(), oversim::Chord::findNode(), oversim::Koorde::handleDeBruijnTimerExpired(), oversim::Koorde::handleRpcDeBruijnRequest(), oversim::Chord::isSiblingFor(), test(), oversim::Koorde::walkDeBruijnList(), and oversim::Koorde::walkSuccessorList().
bool OverlayKey::isUnspecified | ( | ) | const |
Returns true, if the key is unspecified.
Definition at line 158 of file OverlayKey.cc.
Referenced by GiaMessageBookkeeping::addMessage(), BasePastry::baseChangeState(), GiaNeighborCandidateList::contains(), KBRTestApp::deliver(), DHTDataStorage::dumpDht(), oversim::Koorde::findDeBruijnHop(), BasePastry::findNode(), oversim::Koorde::findNode(), oversim::Chord::findNode(), BasePastry::finishOverlay(), PastryLeafSet::getDestinationNode(), CoordBasedRouting::getEuclidianDistanceByKeyAndCoords(), BaseOverlay::handleBaseOverlayMessage(), BaseApp::handleCommonAPIMessage(), CBRDHT::handleGetCAPIRequest(), DHT::handleGetRequest(), BaseOverlay::handleMessage(), BasePastry::handleRpcTimeout(), GIASearchApp::handleTimerEvent(), DHTTestApp::handleTimerEvent(), Vast::handleUDPMessage(), BaseRpc::internalHandleRpcMessage(), BaseOverlay::internalHandleRpcTimeout(), Broose::isSiblingFor(), BasePastry::isSiblingFor(), Kademlia::isSiblingFor(), oversim::Chord::isSiblingFor(), TreeManagement::isTreeDomainKeyValid(), NodeHandle::isUnspecified(), BaseOverlay::join(), Kademlia::joinOverlay(), operator<<(), Kademlia::recursiveRoutingHook(), BaseOverlay::route(), Kademlia::routingTimeout(), TreeManagement::sendMessageToParent(), BaseRpc::sendRouteRpcCall(), BaseRpc::sendRpcCall(), BaseRpc::sendRpcResponse(), and BaseOverlay::sendToKey().
int OverlayKey::log_2 | ( | ) | const |
Returns the position of the msb in this key, which represents just the logarithm to base 2.
Definition at line 524 of file OverlayKey.cc.
Referenced by oversim::Koorde::findStartKey().
void OverlayKey::netPack | ( | cCommBuffer * | b | ) |
serializes the object into a buffer
b | the buffer |
Definition at line 841 of file OverlayKey.cc.
Referenced by doPacking().
void OverlayKey::netUnpack | ( | cCommBuffer * | b | ) |
deserializes the object from a buffer
b | the buffer |
Definition at line 852 of file OverlayKey.cc.
Referenced by doUnpacking().
bool OverlayKey::operator!= | ( | const OverlayKey & | compKey | ) | const |
compares this to a given OverlayKey
compKey | the the OverlayKey to compare this to |
Definition at line 301 of file OverlayKey.cc.
OverlayKey OverlayKey::operator& | ( | const OverlayKey & | rhs | ) | const |
bitwise AND of rhs->key and this->key
rhs | the OverlayKey AND is calculated with |
Definition at line 329 of file OverlayKey.cc.
OverlayKey OverlayKey::operator+ | ( | const OverlayKey & | rhs | ) | const |
adds rhs->key to this->key
rhs | the OverlayKey with the defined key |
Definition at line 265 of file OverlayKey.cc.
OverlayKey & OverlayKey::operator++ | ( | ) |
OverlayKey OverlayKey::operator++ | ( | int | ) |
OverlayKey & OverlayKey::operator+= | ( | const OverlayKey & | rhs | ) |
adds rhs->key to this->key
rhs | the OverlayKey with the defined key |
Definition at line 247 of file OverlayKey.cc.
OverlayKey OverlayKey::operator- | ( | const OverlayKey & | rhs | ) | const |
substracts rhs->key from this->key
rhs | the OverlayKey with the defined key |
Definition at line 273 of file OverlayKey.cc.
OverlayKey & OverlayKey::operator-- | ( | ) |
substracts 1 from this->key
Definition at line 219 of file OverlayKey.cc.
OverlayKey OverlayKey::operator-- | ( | int | ) |
substracts 1 from this->key
Definition at line 225 of file OverlayKey.cc.
OverlayKey & OverlayKey::operator-= | ( | const OverlayKey & | rhs | ) |
substracts rhs->key from this->key
rhs | the OverlayKey with the defined key |
Definition at line 256 of file OverlayKey.cc.
bool OverlayKey::operator< | ( | const OverlayKey & | compKey | ) | const |
compares this to a given OverlayKey
compKey | the the OverlayKey to compare this to |
Definition at line 281 of file OverlayKey.cc.
OverlayKey OverlayKey::operator<< | ( | uint32_t | num | ) | const |
bitwise shift left
num | number of bits to shift |
Definition at line 373 of file OverlayKey.cc.
bool OverlayKey::operator<= | ( | const OverlayKey & | compKey | ) | const |
compares this to a given OverlayKey
compKey | the the OverlayKey to compare this to |
Definition at line 289 of file OverlayKey.cc.
OverlayKey & OverlayKey::operator= | ( | const OverlayKey & | rhs | ) |
assigns OverlayKey of rhs to this->key
rhs | the OverlayKey with the defined key |
Definition at line 211 of file OverlayKey.cc.
bool OverlayKey::operator== | ( | const OverlayKey & | compKey | ) | const |
compares this to a given OverlayKey
compKey | the the OverlayKey to compare this to |
Definition at line 297 of file OverlayKey.cc.
bool OverlayKey::operator> | ( | const OverlayKey & | compKey | ) | const |
compares this to a given OverlayKey
compKey | the the OverlayKey to compare this to |
Definition at line 285 of file OverlayKey.cc.
bool OverlayKey::operator>= | ( | const OverlayKey & | compKey | ) | const |
compares this to a given OverlayKey
compKey | the the OverlayKey to compare this to |
Definition at line 293 of file OverlayKey.cc.
OverlayKey OverlayKey::operator>> | ( | uint32_t | num | ) | const |
bitwise shift right
num | number of bits to shift |
Definition at line 352 of file OverlayKey.cc.
OverlayKeyBit OverlayKey::operator[] | ( | uint32_t | n | ) |
returns the n-th bit of this->key
n | the position of the returned bit |
Definition at line 394 of file OverlayKey.cc.
OverlayKey OverlayKey::operator^ | ( | const OverlayKey & | rhs | ) | const |
bitwise XOR of rhs->key and this->key
rhs | the OverlayKey XOR is calculated with |
Definition at line 307 of file OverlayKey.cc.
OverlayKey OverlayKey::operator| | ( | const OverlayKey & | rhs | ) | const |
bitwise OR of rhs->key and this->key
rhs | the OverlayKey OR is calculated with |
Definition at line 318 of file OverlayKey.cc.
OverlayKey OverlayKey::operator~ | ( | ) | const |
bitwise NOT of this->key
Definition at line 340 of file OverlayKey.cc.
|
static |
Returns a key 2^exponent.
exponent | The exponent. |
Definition at line 670 of file OverlayKey.cc.
Referenced by oversim::Koorde::findStartKey(), oversim::Chord::handleFixFingersTimerExpired(), and oversim::Chord::handleStabilizeTimerExpired().
|
static |
Returns a random key.
Definition at line 639 of file OverlayKey.cc.
Referenced by KBRTestApp::createDestKey(), GlobalNodeList::createKeyList(), Bamboo::doGlobalTuning(), CoordBasedRouting::getNodeId(), GlobalDhtTestMap::getRandomKey(), Gia::getRoute(), Gia::handleAppMessage(), DHTTestApp::handleTimerEvent(), PubSubMMOG::initializeOverlay(), PubSubLobby::initializeOverlay(), Vast::initializeOverlay(), Quon::initializeOverlay(), NTree::initializeOverlay(), Gia::sendSearchResponseMessage(), BaseOverlay::setOwnNodeID(), and test().
OverlayKey OverlayKey::randomPrefix | ( | uint32_t | pos | ) | const |
Fills the prefix starting at pos with random bits to msb.
pos |
Definition at line 474 of file OverlayKey.cc.
Referenced by CoordBasedRouting::getNodeId(), and test().
OverlayKey OverlayKey::randomSuffix | ( | uint32_t | pos | ) | const |
Fills the suffix starting at pos with random bits to lsb.
pos |
Definition at line 455 of file OverlayKey.cc.
Referenced by CoordBasedRouting::getNodeId(), and test().
OverlayKey & OverlayKey::setBit | ( | uint32_t | pos, |
bool | value | ||
) |
sets a bit of this->key
pos | the position of the bit to set |
value | new value for bit at position pos |
Definition at line 399 of file OverlayKey.cc.
Referenced by OverlayKeyBit::operator=(), and OverlayKeyBit::operator^=().
|
static |
Set the length of an OverlayKey.
length | keylength in bits |
Definition at line 133 of file OverlayKey.cc.
Referenced by BaseOverlay::initialize().
|
static |
Returns a key with the SHA1 cryptographic hash of a BinaryValue.
value | A BinaryValue object. |
Definition at line 651 of file OverlayKey.cc.
Referenced by XmlRpcInterface::get(), CBRDHT::handleGetCAPIRequest(), SimMud::handleMove(), CBRDHT::handlePutCAPIRequest(), DHTTestApp::handleTraceMessage(), RealWorldTestApp::handleUpperMessage(), XmlRpcInterface::joinOverlay(), XmlRpcInterface::localLookup(), XmlRpcInterface::lookup(), P2pns::p2pnsRegisterRpc(), P2pns::p2pnsResolveRpc(), XmlRpcInterface::put(), P2pns::registerId(), and test().
uint32_t OverlayKey::sharedPrefixLength | ( | const OverlayKey & | compKey, |
uint32_t | bitsPerDigit = 1 |
||
) | const |
Calculates the number of equal bits (digits) from the left with another Key (shared prefix length)
compKey | the Key to compare with |
bitsPerDigit | optional number of bits per digit, default is 1 |
Definition at line 496 of file OverlayKey.cc.
Referenced by KeyPrefixMetric::distance(), PastryRoutingTable::findCloserNode(), oversim::Koorde::findStartKey(), Broose::getRoutingDistance(), P2pns::handleTunnelLookupResponse(), PastryRoutingTable::lookupNextHop(), PastryRoutingTable::mergeNode(), PastryStateObject::specialCloserCondition(), and test().
|
static |
A pseudo regression test method.
Outputs report to standard output.
Definition at line 686 of file OverlayKey.cc.
double OverlayKey::toDouble | ( | ) | const |
Definition at line 442 of file OverlayKey.cc.
std::string OverlayKey::toString | ( | uint32_t | base = 16 | ) | const |
Returns a string representation of this key.
Definition at line 163 of file OverlayKey.cc.
Referenced by IterativeLookup::addSibling(), Quon::addSite(), BasePastry::baseInit(), Quon::changeState(), Vast::changeState(), TreeManagement::checkParentValid(), Pastry::checkProxCache(), Nps::coordsReqRpcResponse(), BasePastry::createStateMessage(), Quon::deleteSite(), KBRTestApp::deliver(), Bamboo::doLocalTuning(), Pastry::doRoutingTableMaintenance(), Pastry::doSecondStage(), oversim::Koorde::findStartKey(), Gia::forwardMessage(), CoordBasedRouting::getEuclidianDistanceByKeyAndCoords(), NTree::handleAddMessage(), Vast::handleAppMessage(), Quon::handleAppMessage(), oversim::Nice::handleAppMessage(), Pastry::handleFailedNode(), CBRDHT::handleGetCAPIRequest(), CBRDHT::handleGetRequest(), DHT::handleGetRequest(), Scribe::handleJoinMessage(), KBRTestApp::handleLookupResponse(), Vast::handleNodeLeaveNotification(), Pastry::handlePastryJoinCall(), Pastry::handlePastryJoinResponse(), CBRDHT::handlePutCAPIRequest(), CBRDHT::handlePutRequest(), DHT::handlePutRequest(), BasePastry::handleRequestLeafSetCall(), Bamboo::handleRequestLeafSetResponse(), Pastry::handleRequestLeafSetResponse(), BasePastry::handleRequestLeafSetResponse(), Pastry::handleRequestRepairCall(), Pastry::handleRequestRepairResponse(), BasePastry::handleRequestRoutingRowCall(), Pastry::handleRequestRoutingRowResponse(), BasePastry::handleRequestRoutingRowResponse(), Pastry::handleRequestStateCall(), Pastry::handleRequestStateResponse(), Pastry::handleRpcCall(), BasePastry::handleRpcCall(), DiscoveryMode::handleRpcResponse(), Bamboo::handleRpcResponse(), Pastry::handleRpcResponse(), KBRTestApp::handleRpcResponse(), BasePastry::handleRpcResponse(), TreeManagement::handleRpcTimeout(), Pastry::handleRpcTimeout(), KBRTestApp::handleRpcTimeout(), Kademlia::handleRpcTimeout(), BasePastry::handleRpcTimeout(), Pastry::handleStateMessage(), Bamboo::handleStateMessage(), Pastry::handleTimerEvent(), Bamboo::handleTimerEvent(), CBRDHT::handleTimerEvent(), DHT::handleTimerEvent(), Scribe::handleTimerEvent(), DHTTestApp::handleTimerEvent(), Vast::handleUDPMessage(), Quon::handleUDPMessage(), Pastry::handleUDPMessage(), SimpleGameClient::initializeApp(), PastryLeafSet::insertLeaf(), BaseRpc::internalHandleRpcMessage(), Kademlia::isSiblingFor(), MessageObserver::leftGroup(), IterativeLookup::lookup(), Bamboo::lookupFinished(), Pastry::mergeState(), BasePastry::newLeafs(), operator<<(), BrooseBucket::output(), BasePastry::pingNodes(), Pastry::pingResponse(), Pastry::processState(), BasePastry::proxCallback(), Quon::purgeSites(), MessageObserver::receivedMessage(), BaseOverlay::route(), Kademlia::routingAdd(), Vast::sendDiscardNode(), Quon::sendMessage(), Vast::sendMessage(), DiscoveryMode::sendNewRequest(), IterativePathLookup::sendRpc(), Quon::sendToApp(), Vast::sendToApp(), MessageObserver::sentMessage(), NeighborCache::setCbrNodeId(), GlobalViewBuilder::spreadGlobalView(), DiscoveryMode::start(), DiscoveryMode::stop(), IterativeLookup::stop(), test(), NeighborCache::updateNcsInfo(), NeighborCache::updateNode(), and Quon::updateThisSite().
|
inlineprivate |
trims key after key operations
Definition at line 799 of file OverlayKey.cc.
Referenced by getMax(), operator<<(), operator>>(), operator~(), random(), randomPrefix(), randomSuffix(), and sha1().
|
friend |
Common stdc++ console output method.
Definition at line 618 of file OverlayKey.cc.
|
staticprivate |
number of needed machine words to hold the key
Definition at line 482 of file OverlayKey.h.
|
staticprivate |
bits to fill up if key does not exactly fit in one or more machine words
Definition at line 483 of file OverlayKey.h.
|
private |
is this->key unspecified?
Definition at line 487 of file OverlayKey.h.
Referenced by compareTo(), getMax(), isBetween(), isBetweenL(), isBetweenLR(), isBetweenR(), operator<<(), operator=(), operator>>(), and sha1().
|
private |
the overlay key this object represents
Definition at line 491 of file OverlayKey.h.
Referenced by compareTo(), getMax(), operator&(), operator+=(), operator-=(), operator<<(), operator=(), operator>>(), operator^(), operator|(), operator~(), pow2(), random(), randomPrefix(), randomSuffix(), sha1(), and sharedPrefixLength().
|
staticprivate |
actual length of the key
Definition at line 481 of file OverlayKey.h.
Referenced by getBitRange(), getLength(), and setKeyLength().
|
staticprivate |
maximum length of the key
Definition at line 480 of file OverlayKey.h.
|
static |
OverlayKey with key initialized as 1.
Definition at line 55 of file OverlayKey.h.
Referenced by oversim::ChordSuccessorList::addSuccessor(), Kademlia::handleBucketRefreshTimerExpired(), SingleHostUnderlayConfigurator::initializeUnderlay(), and test().
|
static |
OverlayKey without defined key.
Definition at line 53 of file OverlayKey.h.
Referenced by BrooseHandle::BrooseHandle(), Scribe::checkGroupEmpty(), TreeManagement::cleanup(), Scribe::deliverALMDataToGroup(), BaseOverlay::distance(), oversim::Koorde::findNode(), oversim::Koorde::findStartKey(), BrooseBucket::getDist(), GlobalDhtTestMap::getRandomKey(), TreeManagement::handleRpcTimeout(), Scribe::handleTimerEvent(), BaseOverlay::initialize(), BaseApp::internalSendRpcResponse(), BaseOverlay::internalSendRpcResponse(), KeyExtractor< T >::key(), NodeHandle::NodeHandle(), Kademlia::recursiveRoutingHook(), BaseRpc::sendInternalRpcCall(), BaseRpc::sendRouteRpcCall(), P2pns::sendTunnelMessage(), BaseRpc::sendUdpRpcCall(), SimMud::SimMud(), and TreeManagement::TreeManagement().
|
static |
OverlayKey with key initialized as 0.
Definition at line 54 of file OverlayKey.h.
Referenced by PastryLeafSet::estimateMeanDistance(), TreeManagement::getResponsibleDomainKey(), and test().