Landmark Class Reference

#include <Landmark.h>

Inheritance diagram for Landmark:

BaseApp BaseRpc RpcListener

List of all members.

Public Member Functions

const std::vector< double > & getOwnNpsCoords () const

Private Member Functions

virtual ~Landmark ()
virtual void initializeApp (int stage)
 initializes derived class-attributes
virtual void finishApp ()
 collects statistical data of derived app

Private Attributes

std::vector< double > ownCoords


Detailed Description

Definition at line 31 of file Landmark.h.


Constructor & Destructor Documentation

Landmark::~Landmark (  )  [private, virtual]

Definition at line 38 of file Landmark.cc.

00038                     {
00039 }


Member Function Documentation

void Landmark::finishApp (  )  [private, virtual]

collects statistical data of derived app

Reimplemented from BaseApp.

Definition at line 100 of file Landmark.cc.

00101 {
00102     if (neighborCache->getNpsAccess().getReceivedCalls() != 0) {
00103         globalStatistics->recordOutVector("Calls to Landmarks",
00104             neighborCache->getNpsAccess().getReceivedCalls());
00105     }
00106 }

const std::vector<double>& Landmark::getOwnNpsCoords (  )  const [inline]

Definition at line 42 of file Landmark.h.

Referenced by Nps::coordsReqRpc().

00042 { return ownCoords; };

void Landmark::initializeApp ( int  stage  )  [private, virtual]

initializes derived class-attributes

Parameters:
stage the init stage

Reimplemented from BaseApp.

Definition at line 41 of file Landmark.cc.

00042 {
00043     if (stage != MIN_STAGE_APP)
00044         return;
00045 
00046     SimpleNodeEntry* entry =
00047         dynamic_cast<SimpleInfo*>(globalNodeList->
00048                                   getPeerInfo(thisNode.getAddress()))->getEntry();
00049 
00050     //globalNodeList->setOverlayReadyIcon(getThisNode(), false);
00051 
00052     // Get the responsible Landmark churn generator
00053     ChurnGenerator* lmChurnGen = NULL;
00054     for (uint8_t i = 0; i < underlayConfigurator->getChurnGeneratorNum(); i++) {
00055         ChurnGenerator* searchedGen;
00056         searchedGen = underlayConfigurator->getChurnGenerator(i);
00057         if (searchedGen->getNodeType().overlayType == "oversim.common.cbr.LandmarkModules") {
00058             lmChurnGen = searchedGen;
00059         }
00060     }
00061 
00062     // If number of landmarks < dim+1: Place magic landmark
00063     // Else: BaseOverlay will take care of the coordinate calculation
00064     //if (!neighborCache->coordBasedRouting) return;
00065 
00066     //uint8_t dim = neighborCache->/*coordBasedRouting->*/getXmlDimensions();
00067     //if (lmChurnGen && lmChurnGen->terminalCount < dim + 1) {
00068         //PeerInfo* thisInfo = globalNodeList->getPeerInfo(getThisNode());
00069 
00070     if (true) { //TODO
00071         // magic placement using underlays coords
00072         //std::vector<double> coords;
00073         for (uint8_t i = 0; i < entry->getDim(); i++) {
00074             ownCoords.push_back(entry->getCoords(i));
00075         }
00076 
00077         //neighborCache->nps->setOwnCoordinates(coords);
00078         neighborCache->getNpsAccess().setOwnLayer(0);
00079 
00080         thisNode = overlay->getThisNode();
00081         globalNodeList->setOverlayReadyIcon(getThisNode(), true);
00082         globalNodeList->refreshEntry(getThisNode());
00083     } else {
00084         //TODO
00085     }
00086 
00087     WATCH_VECTOR(ownCoords);
00088 }


Member Data Documentation

std::vector<double> Landmark::ownCoords [private]

Definition at line 39 of file Landmark.h.

Referenced by getOwnNpsCoords(), and initializeApp().


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

Generated on Tue Sep 8 17:26:59 2009 for OverSim by  doxygen 1.5.8