PeerInfo Class Reference

#include <PeerInfo.h>

Inheritance diagram for PeerInfo:

InetInfo SimpleInfo

List of all members.


Detailed Description

Base class for providing additional underlay specific information associated with a certain transport address.

Definition at line 39 of file 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

Constructor & Destructor Documentation

PeerInfo::PeerInfo ( uint32_t  type,
int  moduleId 
)

constructor

Definition at line 26 of file PeerInfo.cc.

00027 {
00028     bootstrapped = false;
00029     malicious = false;
00030     this->moduleId = moduleId;
00031     this->type = type;
00032 }

virtual PeerInfo::~PeerInfo (  )  [inline, virtual]

Definition at line 48 of file PeerInfo.h.

00048 {};


Member Function Documentation

bool PeerInfo::isBootstrapped (  )  [inline]

has the peer bootstrapped yet?

Returns:
true if the peer has bootstrapped, false otherwise

Definition at line 55 of file PeerInfo.h.

Referenced by operator<<(), GlobalNodeList::registerPeer(), and GlobalNodeList::setMalicious().

00055 { return bootstrapped; };

void PeerInfo::setBootstrapped ( bool  bootstrap = true  )  [inline]

sets or deletes the bootstrapped parameter

Parameters:
bootstrap true or () if peer has bootstrapped, false otherwise

Definition at line 62 of file PeerInfo.h.

Referenced by GlobalNodeList::registerPeer().

00062 { bootstrapped = bootstrap; };

int PeerInfo::getModuleID (  )  [inline]

returns the moduleId of the peer

Returns:
the moduleId

Definition at line 69 of file PeerInfo.h.

Referenced by TraceChurn::createNode(), TopologyVis::deleteOverlayNeighborArrow(), operator<<(), and GlobalNodeList::setOverlayReadyIcon().

00069 { return moduleId; };

uint32_t PeerInfo::getTypeID (  )  [inline]

returns the type of the node

Returns:
the node's typeID

Definition at line 76 of file PeerInfo.h.

Referenced by operator<<(), SimpleUnderlayConfigurator::preKillNode(), InetUnderlayConfigurator::preKillNode(), SimpleUDP::processMsgFromApp(), and GlobalNodeList::registerPeer().

00076 { return type; };

bool PeerInfo::isPreKilled (  )  [inline]

is the peer marked for deletion?

Returns:
true if the peer is marked for deletion, false otherwise

Definition at line 83 of file PeerInfo.h.

Referenced by GlobalNodeList::setPreKilled().

00083 { return preKilled; };

void PeerInfo::setPreKilled ( bool  killed = true  )  [inline]

mark that the peer gets deleted soon

Parameters:
killed true, if the peer gets deleted soon

Definition at line 90 of file PeerInfo.h.

Referenced by GlobalNodeList::addPeer(), and GlobalNodeList::setPreKilled().

00090 { preKilled = killed; };

bool PeerInfo::isMalicious (  )  [inline]

is the peer malicious?

Returns:
true if the peer is malicious, false otherwise

Definition at line 97 of file PeerInfo.h.

Referenced by GlobalNodeList::isMalicious(), GlobalNodeList::registerPeer(), and GlobalNodeList::setMalicious().

00097 { return malicious; };

void PeerInfo::setMalicious ( bool  malic = true  )  [inline]

set the maliciousness of the peer

Parameters:
malic whether the peer is malicious or not

Definition at line 104 of file PeerInfo.h.

Referenced by GlobalNodeList::setMalicious().

00104 { malicious = malic; };

void PeerInfo::dummy (  )  [protected, virtual]

dummy-function to make PeerInfo polymorphic

Reimplemented in InetInfo, and SimpleInfo.

Definition at line 34 of file PeerInfo.cc.

00034 {}


Friends And Related Function Documentation

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

Parameters:
Stream the ostream
info the PeerInfo
Returns:
the output stream

Definition at line 38 of file PeerInfo.cc.

00039 {
00040     Stream  << "ModuleId: " << info.moduleId << "Bootstrapped: ";
00041     if(info.bootstrapped) {
00042         return Stream << "true";
00043     }
00044     else {
00045         return Stream << "false";
00046     }
00047 }


Member Data Documentation

bool PeerInfo::bootstrapped [protected]

true if node has bootstrapped

Definition at line 119 of file PeerInfo.h.

Referenced by isBootstrapped(), operator<<(), PeerInfo(), and setBootstrapped().

bool PeerInfo::malicious [protected]

true if the node is malicious

Definition at line 120 of file PeerInfo.h.

Referenced by isMalicious(), PeerInfo(), and setMalicious().

bool PeerInfo::preKilled [protected]

true, if the node is marked for deletion

Definition at line 121 of file PeerInfo.h.

Referenced by isPreKilled(), and setPreKilled().

int PeerInfo::moduleId [protected]

the moduleId of the peer

Definition at line 122 of file PeerInfo.h.

Referenced by operator<<().

uint32_t PeerInfo::type [protected]

ID of the node type.

Definition at line 123 of file PeerInfo.h.


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

Generated on Wed Mar 25 16:32:53 2009 for OverSim by  doxygen 1.5.5