PeerInfo Class Reference

#include <PeerInfo.h>

List of all members.


Detailed Description

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


Public Member Functions

 PeerInfo (int moduleId)
bool isBootstrapped ()
void setBootstrapped (bool bootstrap=true)
int getModuleID ()
bool isMalicious ()

Protected Attributes

bool bootstrapped
int moduleId

Friends

std::ostream & operator<< (std::ostream &Stream, const PeerInfo info)


Constructor & Destructor Documentation

PeerInfo::PeerInfo ( int  moduleId  ) 

00026 {
00027     bootstrapped = false;
00028     this->moduleId = moduleId;
00029 }


Member Function Documentation

int PeerInfo::getModuleID (  )  [inline]

00041 { return moduleId; };

bool PeerInfo::isBootstrapped (  )  [inline]

00039 { return bootstrapped; };

bool PeerInfo::isMalicious (  ) 

00033 {
00034     BaseOverlay* overlay = dynamic_cast<BaseOverlay*>(simulation.module(moduleId));
00035     if(overlay==NULL)
00036         opp_error("Peer not associated with a BaseOverlay Module");
00037     return overlay->isMalicious();
00038 }

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

00040 { bootstrapped = bootstrap; };


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  Stream,
const PeerInfo  info 
) [friend]

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


Member Data Documentation

bool PeerInfo::bootstrapped [protected]

int PeerInfo::moduleId [protected]


The documentation for this class was generated from the following files:
Generated on Fri May 11 14:52:40 2007 for ITM OverSim by  doxygen 1.4.7