96 lines
2.6 KiB
C++
96 lines
2.6 KiB
C++
/*
|
|
* File: Node.h
|
|
* Author: jgaebler
|
|
*
|
|
* Created on December 13, 2012, 3:43 PM
|
|
*/
|
|
#pragma once
|
|
|
|
#ifndef NODE_H
|
|
#define NODE_H
|
|
|
|
#include "Distance.h"
|
|
|
|
#include "simtime.h"
|
|
|
|
#include "base/Coord.h"
|
|
#include "linklayer/contract/MACAddress.h"
|
|
|
|
#include <vector>
|
|
|
|
namespace ubeeme {
|
|
namespace moversight {
|
|
|
|
class Node {
|
|
public:
|
|
|
|
typedef std::vector<Distance> DistanceList;
|
|
|
|
Node(std::string & nodeName);
|
|
virtual ~Node();
|
|
|
|
void setMacAdress(MACAddress macAdress);
|
|
MACAddress getMacAdress() const;
|
|
|
|
void setIsAccessPoint(bool flag);
|
|
bool isAccessPoint() const;
|
|
|
|
void setHasMobility(bool hasMobility);
|
|
bool hasMobility() const;
|
|
|
|
void setConnectedTime(SimTime connectedTime);
|
|
SimTime getConnectedTime() const;
|
|
|
|
void setTimeLeft(SimTime timeLeft);
|
|
SimTime getTimeLeft() const;
|
|
|
|
void setNodeDistanceList(DistanceList & nodeDistanceList);
|
|
DistanceList & getNodeDistanceList();
|
|
|
|
void setConnectedWith(std::string connectedWith);
|
|
std::string getConnectedWith() const;
|
|
|
|
void setNumEqualModules(int numEqualModules);
|
|
int getNumEqualModules() const;
|
|
|
|
void setCurrentSpeed(Coord currSpeed);
|
|
Coord getCurrentSpeed() const;
|
|
|
|
void setCurrentPosition(Coord currPosition);
|
|
Coord getCurrentPosition() const;
|
|
|
|
void setTransmissionRange(double transmissRange);
|
|
double getTransmissionRange() const;
|
|
|
|
void setRadioModule(cModule* radioModule);
|
|
cModule * getRadioModule() const;
|
|
|
|
void setNodeName(std::string name);
|
|
std::string getNodeName() const;
|
|
|
|
private:
|
|
|
|
std::string nodeName; // Name of wireless Node
|
|
cModule *radioModule; // Pointer to radioModule
|
|
double transmissionRange; // Transmission range of Node
|
|
|
|
bool isMobil; // false means no mobility available ( stationaryMobility)
|
|
bool isAP; // true = Wireless Node ; false = AccessPoint
|
|
Coord currPosition; // current Position
|
|
Coord currSpeed; // current Speed ( if hasMobility == false -> currSpeed = COORD::ZERO)
|
|
|
|
std::string connectedWith; // connected Node
|
|
DistanceList nodeDistanceList; // list of equal Module
|
|
|
|
SimTime timeLeft; // time left in Range to connected Module
|
|
SimTime connectedTime; // time already connected with
|
|
|
|
MACAddress macAdress;
|
|
|
|
};
|
|
|
|
}
|
|
}
|
|
#endif /* NODE_H */
|
|
|