|
OverSim
|
#include <PeerStorage.h>
Public Member Functions | |
| ~PeerStorage () | |
| size_t | size () |
| const PeerHashMap::iterator | find (const IPvXAddress &ip) |
| const PeerHashMap::iterator | begin () |
| const PeerHashMap::iterator | end () |
| std::pair< const PeerHashMap::iterator, bool > | insert (const std::pair< IPvXAddress, BootstrapEntry > &element) |
| void | erase (const PeerHashMap::iterator it) |
| void | registerOverlay (const PeerHashMap::iterator it, const NodeHandle &peer, int32_t overlayId) |
| const PeerHashMap::iterator | getRandomNode (int32_t overlayId, int32_t nodeType, bool bootstrappedNeeded, bool inoffensiveNeeded) |
| void | setMalicious (const PeerHashMap::iterator it, bool malicious) |
| void | setBootstrapped (const PeerHashMap::iterator it, int32_t overlayId, bool bootstrapped) |
| const PeerHashMap & | getPeerHashMap () |
Private Types | |
| typedef std::vector < std::vector < PeerHashMap::iterator > > | PeerVector |
Private Member Functions | |
| void | insertMapIteratorIntoVector (PeerVector &peerVector, PeerHashMap::iterator it) |
| void | removeMapIteratorFromVector (PeerVector &peerVector, PeerHashMap::iterator it) |
| size_t | offsetSize () |
| uint8_t | calcOffset (bool bootstrapped, bool malicious) |
Private Attributes | |
| PeerHashMap | peerHashMap |
| PeerVector | globalPeerVector |
| std::map< int32_t, PeerVector > | overlayPeerVectorMap |
| std::vector< std::vector < uint32_t > > | freeVector |
Definition at line 116 of file PeerStorage.h.
|
private |
Definition at line 143 of file PeerStorage.h.
| PeerStorage::~PeerStorage | ( | ) |
Definition at line 30 of file PeerStorage.cc.
| const PeerHashMap::iterator PeerStorage::begin | ( | ) |
Definition at line 48 of file PeerStorage.cc.
Referenced by GlobalNodeList::getAllIps(), and GlobalNodeList::sendNotificationToAllPeers().
|
inlineprivate |
Definition at line 63 of file PeerStorage.cc.
Referenced by insertMapIteratorIntoVector(), and removeMapIteratorFromVector().
| const PeerHashMap::iterator PeerStorage::end | ( | ) |
Definition at line 53 of file PeerStorage.cc.
Referenced by GlobalNodeList::getAllIps(), GlobalNodeList::getBootstrapNode(), GlobalNodeList::getNodeHandle(), GlobalNodeList::getPeerInfo(), GlobalNodeList::getRandomAliveNode(), GlobalNodeList::getRandomNode(), GlobalNodeList::getRandomPeerInfo(), GlobalNodeList::killPeer(), GlobalNodeList::refreshEntry(), GlobalNodeList::registerPeer(), GlobalNodeList::removePeer(), and GlobalNodeList::sendNotificationToAllPeers().
| void PeerStorage::erase | ( | const PeerHashMap::iterator | it | ) |
Definition at line 164 of file PeerStorage.cc.
Referenced by GlobalNodeList::killPeer().
| const PeerHashMap::iterator PeerStorage::find | ( | const IPvXAddress & | ip | ) |
Definition at line 43 of file PeerStorage.cc.
Referenced by GlobalNodeList::getBootstrapNode(), GlobalNodeList::getNodeHandle(), GlobalNodeList::getPeerInfo(), GlobalNodeList::killPeer(), GlobalNodeList::refreshEntry(), GlobalNodeList::registerPeer(), GlobalNodeList::removePeer(), and GlobalNodeList::setMalicious().
|
inline |
Definition at line 143 of file PeerStorage.h.
Referenced by GlobalNodeList::initialize().
| const PeerHashMap::iterator PeerStorage::getRandomNode | ( | int32_t | overlayId, |
| int32_t | nodeType, | ||
| bool | bootstrappedNeeded, | ||
| bool | inoffensiveNeeded | ||
| ) |
Definition at line 220 of file PeerStorage.cc.
Referenced by GlobalNodeList::getRandomAliveNode(), GlobalNodeList::getRandomNode(), and GlobalNodeList::getRandomPeerInfo().
| std::pair< const PeerHashMap::iterator, bool > PeerStorage::insert | ( | const std::pair< IPvXAddress, BootstrapEntry > & | element | ) |
Definition at line 151 of file PeerStorage.cc.
Referenced by GlobalNodeList::addPeer().
|
private |
Definition at line 71 of file PeerStorage.cc.
Referenced by insert(), setBootstrapped(), and setMalicious().
|
inlineprivate |
Definition at line 58 of file PeerStorage.cc.
Referenced by getRandomNode(), insertMapIteratorIntoVector(), and removeMapIteratorFromVector().
| void PeerStorage::registerOverlay | ( | const PeerHashMap::iterator | it, |
| const NodeHandle & | peer, | ||
| int32_t | overlayId | ||
| ) |
Definition at line 171 of file PeerStorage.cc.
Referenced by GlobalNodeList::registerPeer().
|
private |
Definition at line 123 of file PeerStorage.cc.
Referenced by erase(), setBootstrapped(), and setMalicious().
| void PeerStorage::setBootstrapped | ( | const PeerHashMap::iterator | it, |
| int32_t | overlayId, | ||
| bool | bootstrapped | ||
| ) |
Definition at line 197 of file PeerStorage.cc.
Referenced by GlobalNodeList::registerPeer(), and GlobalNodeList::removePeer().
| void PeerStorage::setMalicious | ( | const PeerHashMap::iterator | it, |
| bool | malicious | ||
| ) |
Definition at line 186 of file PeerStorage.cc.
Referenced by GlobalNodeList::setMalicious().
| size_t PeerStorage::size | ( | ) |
Definition at line 38 of file PeerStorage.cc.
Referenced by GlobalNodeList::addPeer(), GlobalNodeList::getNumNodes(), GlobalNodeList::getRandomAliveNode(), getRandomNode(), GlobalNodeList::handleMessage(), insertMapIteratorIntoVector(), and removeMapIteratorFromVector().
|
private |
Definition at line 160 of file PeerStorage.h.
Referenced by getRandomNode(), insertMapIteratorIntoVector(), and removeMapIteratorFromVector().
|
private |
Definition at line 158 of file PeerStorage.h.
Referenced by erase(), getRandomNode(), insert(), setBootstrapped(), and setMalicious().
|
private |
Definition at line 159 of file PeerStorage.h.
|
private |
Definition at line 157 of file PeerStorage.h.
Referenced by begin(), end(), erase(), find(), getRandomNode(), insert(), removeMapIteratorFromVector(), setBootstrapped(), setMalicious(), size(), and ~PeerStorage().