GlobalCoordinator Class Reference

#include <GlobalCoordinator.h>

List of all members.

Public Member Functions

virtual void initialize ()
virtual void handleMessage (cMessage *msg)
virtual ~GlobalCoordinator ()
void increasePositionSize ()
void increasePeerCount ()
int getPeerCount ()
Vector2DgetPosition (int k)
void setPosition (int k, const Vector2D &Position)
unsigned int getSeed ()

Protected Attributes

Vector2DPosition
int PositionSize
int PeerCount
unsigned int Seed

Detailed Description

Definition at line 32 of file GlobalCoordinator.h.


Constructor & Destructor Documentation

GlobalCoordinator::~GlobalCoordinator (  )  [virtual]

Definition at line 38 of file GlobalCoordinator.cc.

00039 {
00040     delete[] this->Position;
00041 }


Member Function Documentation

int GlobalCoordinator::getPeerCount (  ) 

Definition at line 66 of file GlobalCoordinator.cc.

Referenced by greatGathering::greatGathering(), and groupRoaming::groupRoaming().

00067 {
00068     Enter_Method_Silent();
00069     return PeerCount;
00070 }

Vector2D & GlobalCoordinator::getPosition ( int  k  ) 

Definition at line 72 of file GlobalCoordinator.cc.

Referenced by greatGathering::greatGathering(), groupRoaming::groupRoaming(), and groupRoaming::move().

00073 {
00074     Enter_Method_Silent();
00075     if(k >= PositionSize || k < 0) {
00076         throw cRuntimeError("Array out of bounds exception! getPosition(%d)", k);
00077     }
00078     return Position[k];
00079 }

unsigned int GlobalCoordinator::getSeed (  ) 

Definition at line 90 of file GlobalCoordinator.cc.

Referenced by SimpleGameClient::handleRealworldPacket(), and MovementGenerator::MovementGenerator().

00091 {
00092     return Seed;
00093 }

void GlobalCoordinator::handleMessage ( cMessage *  msg  )  [virtual]

Definition at line 43 of file GlobalCoordinator.cc.

00044 {
00045     error("this module doesn't handle messages, it runs only in initialize()");
00046 }

void GlobalCoordinator::increasePeerCount (  ) 

Definition at line 60 of file GlobalCoordinator.cc.

Referenced by greatGathering::greatGathering(), and groupRoaming::groupRoaming().

00061 {
00062     Enter_Method_Silent();
00063     PeerCount++;
00064 }

void GlobalCoordinator::increasePositionSize (  ) 

Definition at line 48 of file GlobalCoordinator.cc.

Referenced by greatGathering::greatGathering(), and groupRoaming::groupRoaming().

00049 {
00050     Enter_Method_Silent();
00051     PositionSize++;
00052     Vector2D *Temp = new Vector2D[PositionSize];
00053     for(int i=0; i<PositionSize-1; i++)
00054         Temp[i] = this->Position[i];
00055 
00056     delete[] this->Position;
00057     this->Position = Temp;
00058 }

void GlobalCoordinator::initialize (  )  [virtual]

Definition at line 28 of file GlobalCoordinator.cc.

00029 {
00030     PositionSize = 0;
00031     PeerCount = 0;
00032     Position = NULL;
00033     Seed = par("seed");
00034 
00035     WATCH(PositionSize);
00036 }

void GlobalCoordinator::setPosition ( int  k,
const Vector2D Position 
)

Definition at line 81 of file GlobalCoordinator.cc.

Referenced by greatGathering::greatGathering(), groupRoaming::groupRoaming(), and groupRoaming::move().

00082 {
00083     Enter_Method_Silent();
00084     if(k >= PositionSize || k < 0) {
00085         throw cRuntimeError("Array out of bounds exception! setPosition(%d, ...)", k);
00086     }
00087     this->Position[k] = Position;
00088 }


Member Data Documentation

Definition at line 49 of file GlobalCoordinator.h.

Referenced by getPeerCount(), increasePeerCount(), and initialize().

Definition at line 49 of file GlobalCoordinator.h.

Referenced by getPosition(), increasePositionSize(), initialize(), and setPosition().

unsigned int GlobalCoordinator::Seed [protected]

Definition at line 50 of file GlobalCoordinator.h.

Referenced by getSeed(), and initialize().


The documentation for this class was generated from the following files:
Generated on Wed May 26 16:21:17 2010 for OverSim by  doxygen 1.6.3