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)

Protected Attributes

Vector2DPosition
int PositionSize
int PeerCount


Constructor & Destructor Documentation

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

00036 {};


Member Function Documentation

void GlobalCoordinator::initialize (  )  [virtual]

00029 {
00030     PositionSize = 0;
00031     PeerCount = 0;
00032     Position = NULL;
00033 
00034     WATCH(PositionSize);
00035 }

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

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

void GlobalCoordinator::increasePositionSize (  ) 

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

void GlobalCoordinator::increasePeerCount (  ) 

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

int GlobalCoordinator::getPeerCount (  ) 

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

Vector2D & GlobalCoordinator::getPosition ( int  k  ) 

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

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

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


Member Data Documentation

Vector2D* GlobalCoordinator::Position [protected]

int GlobalCoordinator::PositionSize [protected]

int GlobalCoordinator::PeerCount [protected]


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