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


Constructor & Destructor Documentation

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

00037 {};


Member Function Documentation

void GlobalCoordinator::initialize (  )  [virtual]

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

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

00039 {
00040     error("this module doesn't handle messages, it runs only in initialize()");
00041 }

void GlobalCoordinator::increasePositionSize (  ) 

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

00044 {
00045     Enter_Method_Silent();
00046     PositionSize++;
00047     Vector2D *Temp = new Vector2D[PositionSize];
00048     for(int i=0; i<PositionSize-1; i++)
00049         Temp[i] = this->Position[i];
00050 
00051     delete[] this->Position;
00052     this->Position = Temp;
00053 }

void GlobalCoordinator::increasePeerCount (  ) 

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

00056 {
00057     Enter_Method_Silent();
00058     PeerCount++;
00059 }

int GlobalCoordinator::getPeerCount (  ) 

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

00062 {
00063     Enter_Method_Silent();
00064     return PeerCount;
00065 }

Vector2D & GlobalCoordinator::getPosition ( int  k  ) 

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

00068 {
00069     Enter_Method_Silent();
00070     if(k >= PositionSize || k < 0) {
00071         throw new cException("Array out of bounds exception! getPosition(%d)", k);
00072     }
00073     return Position[k];
00074 }

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

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

00077 {
00078     Enter_Method_Silent();
00079     if(k >= PositionSize || k < 0) {
00080         throw new cException("Array out of bounds exception! setPosition(%d, ...)", k);
00081     }
00082     this->Position[k] = Position;
00083 }

unsigned int GlobalCoordinator::getSeed (  ) 


Member Data Documentation

unsigned int GlobalCoordinator::Seed [protected]

Referenced by getSeed(), and initialize().


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

Generated on Fri Sep 19 13:05:07 2008 for ITM OverSim by  doxygen 1.5.5