PlayerNode Class Reference

#include <PlayerNode.h>

List of all members.

Public Member Functions

 PlayerNode ()
 PlayerNode (IPAddress ip)
 PlayerNode (int id, IPAddress ip, int Bandwith, int Cpu)
int getId () const
IPAddress getIp () const
int getBandwith () const
void modifyBandwith (int diff)
int getCpu () const
bool operator< (const PlayerNode player) const

Private Attributes

int id
IPAddress ip
int Bandwith
int Cpu

Friends

std::ostream & operator<< (std::ostream &Stream, const PlayerNode p)


Constructor & Destructor Documentation

PlayerNode::PlayerNode (  ) 

00018                        {
00019         //Dummy for .msg
00020 }

PlayerNode::PlayerNode ( IPAddress  ip  ) 

00021                                    {
00022         this->ip = ip;
00023 }

PlayerNode::PlayerNode ( int  id,
IPAddress  ip,
int  Bandwith,
int  Cpu 
)

00024                                                                   {
00025         this->id = id;
00026         this->ip = ip;
00027         this->Bandwith = Bandwith;
00028         this->Cpu = Cpu;
00029 }


Member Function Documentation

int PlayerNode::getId (  )  const

00031                             {
00032         return id;
00033 }

IPAddress PlayerNode::getIp (  )  const

00034                                   {
00035         return ip;
00036 }

int PlayerNode::getBandwith (  )  const

00037                                   {
00038         return Bandwith;
00039 }

void PlayerNode::modifyBandwith ( int  diff  ) 

00043                                         {
00044         Bandwith += diff;
00045         if( Bandwith < 0 ) {
00046                 Bandwith=0;
00047         }
00048 }

int PlayerNode::getCpu (  )  const

00040                              {
00041         return Cpu;
00042 }

bool PlayerNode::operator< ( const PlayerNode  player  )  const

00050                                                         {
00051         if ( Bandwith > player.getBandwith() ) return true;
00052         return false;
00053 }


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  Stream,
const PlayerNode  p 
) [friend]

00055 {
00056     return Stream << "PlayerId: " << p.getId() << " Bandwith: " << p.getBandwith() << " Cpu: " << p.getCpu() << " IP: " << p.getIp()<< "\n";
00057 }


Member Data Documentation

int PlayerNode::id [private]

IPAddress PlayerNode::ip [private]

int PlayerNode::Bandwith [private]

int PlayerNode::Cpu [private]


The documentation for this class was generated from the following files:
Generated on Thu Apr 17 13:19:30 2008 for ITM OverSim by  doxygen 1.5.3