#include <PeerInfo.h>
Public Member Functions | |
PeerInfo (uint32_t type, int moduleId) | |
constructor | |
virtual | ~PeerInfo () |
bool | isBootstrapped () |
has the peer bootstrapped yet? | |
void | setBootstrapped (bool bootstrap=true) |
sets or deletes the bootstrapped parameter | |
int | getModuleID () |
returns the moduleId of the peer | |
uint32_t | getTypeID () |
returns the type of the node | |
bool | isPreKilled () |
is the peer marked for deletion? | |
void | setPreKilled (bool killed=true) |
mark that the peer gets deleted soon | |
bool | isMalicious () |
is the peer malicious? | |
void | setMalicious (bool malic=true) |
set the maliciousness of the peer | |
Protected Member Functions | |
virtual void | dummy () |
dummy-function to make PeerInfo polymorphic | |
Protected Attributes | |
bool | bootstrapped |
true if node has bootstrapped | |
bool | malicious |
true if the node is malicious | |
bool | preKilled |
true, if the node is marked for deletion | |
int | moduleId |
the moduleId of the peer | |
uint32_t | type |
ID of the node type. | |
Friends | |
std::ostream & | operator<< (std::ostream &Stream, const PeerInfo info) |
standard output stream for PeerInfo, gives moduleID and true if peer has bootstrapped, false otherwise |
PeerInfo::PeerInfo | ( | uint32_t | type, | |
int | moduleId | |||
) |
bool PeerInfo::isBootstrapped | ( | ) | [inline] |
has the peer bootstrapped yet?
Referenced by operator<<(), BootstrapOracle::registerPeer(), and BootstrapOracle::setMalicious().
00053 { return bootstrapped; };
void PeerInfo::setBootstrapped | ( | bool | bootstrap = true |
) | [inline] |
sets or deletes the bootstrapped parameter
bootstrap | true or () if peer has bootstrapped, false otherwise |
Referenced by BootstrapOracle::registerPeer().
00060 { bootstrapped = bootstrap; };
int PeerInfo::getModuleID | ( | ) | [inline] |
returns the moduleId of the peer
Referenced by TraceChurn::createNode(), TopologyVis::deleteOverlayNeighborArrow(), operator<<(), and BootstrapOracle::setOverlayReadyIcon().
00067 { return moduleId; };
uint32_t PeerInfo::getTypeID | ( | ) | [inline] |
returns the type of the node
Referenced by operator<<(), SimpleNetConfigurator::preKillNode(), IPv4UnderlayConfigurator::preKillNode(), SimpleUDP::processMsgFromApp(), and BootstrapOracle::registerPeer().
00074 { return type; };
bool PeerInfo::isPreKilled | ( | ) | [inline] |
is the peer marked for deletion?
Referenced by BootstrapOracle::setPreKilled().
00081 { return preKilled; };
void PeerInfo::setPreKilled | ( | bool | killed = true |
) | [inline] |
mark that the peer gets deleted soon
killed | true, if the peer gets deleted soon |
Referenced by BootstrapOracle::addPeer(), and BootstrapOracle::setPreKilled().
00088 { preKilled = killed; };
bool PeerInfo::isMalicious | ( | ) | [inline] |
is the peer malicious?
Referenced by BootstrapOracle::isMalicious(), BootstrapOracle::registerPeer(), and BootstrapOracle::setMalicious().
00095 { return malicious; };
void PeerInfo::setMalicious | ( | bool | malic = true |
) | [inline] |
set the maliciousness of the peer
malic | whether the peer is malicious or not |
Referenced by BootstrapOracle::setMalicious().
00102 { malicious = malic; };
void PeerInfo::dummy | ( | ) | [protected, virtual] |
std::ostream& operator<< | ( | std::ostream & | Stream, | |
const PeerInfo | info | |||
) | [friend] |
standard output stream for PeerInfo, gives moduleID and true if peer has bootstrapped, false otherwise
Stream | the ostream | |
info | the PeerInfo |
00039 { 00040 Stream << "ModuleId: " << info.moduleId << "Bootstrapped: "; 00041 if(info.bootstrapped) { 00042 return Stream << "true"; 00043 } 00044 else { 00045 return Stream << "false"; 00046 } 00047 }
bool PeerInfo::bootstrapped [protected] |
true if node has bootstrapped
Referenced by isBootstrapped(), operator<<(), PeerInfo(), and setBootstrapped().
bool PeerInfo::malicious [protected] |
bool PeerInfo::preKilled [protected] |
int PeerInfo::moduleId [protected] |
uint32_t PeerInfo::type [protected] |
ID of the node type.