#ifndef _TRAFFIC_CONTROL_HXX_
#define _TRAFFIC_CONTROL_HXX_
-
-#ifndef __cplusplus
-# error This library requires C++
-#endif
+#include <string>
+#include <vector>
+#include <list>
#include <osg/Geode>
#include <osg/Geometry>
#include <simgear/structure/SGReferenced.hxx>
#include <simgear/structure/SGSharedPtr.hxx>
-
-#include <string>
-#include <vector>
-#include <list>
-
-using std::string;
-using std::vector;
-using std::list;
-
-
-typedef vector<int> intVec;
-typedef vector<int>::iterator intVecIterator;
+typedef std::vector<int> intVec;
+typedef std::vector<int>::iterator intVecIterator;
class FGAIFlightPlan; // forward reference
intVec intentions;
FGATCInstruction instruction;
double latitude, longitude, heading, speed, altitude, radius;
- string runway;
+ std::string runway;
//FGAISchedule *trafficRef;
FGAIAircraft *aircraft;
radius = rad;
};
void setPositionAndIntentions(int pos, FGAIFlightPlan *route);
- void setRunway(string rwy) {
+ void setRunway(const std::string& rwy) {
runway = rwy;
};
void setLeg(int lg) {
instruction.setResolveCircularWait(false);
};
- string getRunway() {
+ const std::string& getRunway() {
return runway;
};
//void setCallSign(string clsgn) { callsign = clsgn; };
int getPriority() { return priority; };
};
-typedef list<FGTrafficRecord> TrafficVector;
-typedef list<FGTrafficRecord>::iterator TrafficVectorIterator;
+typedef std::list<FGTrafficRecord> TrafficVector;
+typedef std::list<FGTrafficRecord>::iterator TrafficVectorIterator;
-typedef vector<time_t> TimeVector;
-typedef vector<time_t>::iterator TimeVectorIterator;
+typedef std::vector<time_t> TimeVector;
+typedef std::vector<time_t>::iterator TimeVectorIterator;
-typedef vector<FGAIAircraft*> AircraftVec;
-typedef vector<FGAIAircraft*>::iterator AircraftVecIterator;
+typedef std::vector<FGAIAircraft*> AircraftVec;
+typedef std::vector<FGAIAircraft*>::iterator AircraftVecIterator;
/***********************************************************************
* Active runway, a utility class to keep track of which aircraft has
class ActiveRunway
{
private:
- string rwy;
+ std::string rwy;
int currentlyCleared;
double distanceToFinal;
TimeVector estimatedArrivalTimes;
AircraftVec departureCue;
public:
- ActiveRunway(string r, int cc) {
+ ActiveRunway(const std::string& r, int cc) {
rwy = r;
currentlyCleared = cc;
distanceToFinal = 6.0 * SG_NM_TO_METER;
};
- string getRunwayName() {
+ std::string getRunwayName() {
return rwy;
};
int getCleared () {
void printDepartureCue();
};
-typedef vector<ActiveRunway> ActiveRunwayVec;
-typedef vector<ActiveRunway>::iterator ActiveRunwayVecIterator;
+typedef std::vector<ActiveRunway> ActiveRunwayVec;
+typedef std::vector<ActiveRunway>::iterator ActiveRunwayVecIterator;
/**
* class FGATCController
double dt_count;
osg::Group* group;
- string formatATCFrequency3_2(int );
- string genTransponderCode(string fltRules);
+ std::string formatATCFrequency3_2(int );
+ std::string genTransponderCode(const std::string& fltRules);
bool isUserAircraft(FGAIAircraft*);
public:
dt_count = dt;
};
void transmit(FGTrafficRecord *rec, FGAirportDynamics *parent, AtcMsgId msgId, AtcMsgDir msgDir, bool audible);
- string getGateName(FGAIAircraft *aircraft);
+ std::string getGateName(FGAIAircraft *aircraft);
virtual void render(bool) = 0;
- virtual string getName() = 0;
+ virtual std::string getName() = 0;
virtual void update(double) = 0;
virtual FGATCInstruction getInstruction(int id);
virtual void render(bool);
- virtual string getName();
+ virtual std::string getName();
virtual void update(double dt);
bool hasActiveTraffic() {
return activeTraffic.size() != 0;
virtual FGATCInstruction getInstruction(int id);
virtual void render(bool);
- virtual string getName();
+ virtual std::string getName();
virtual void update(double dt);
bool hasActiveTraffic() {
virtual FGATCInstruction getInstruction(int id);
virtual void render(bool);
- virtual string getName();
+ virtual std::string getName();
virtual void update(double dt);
- ActiveRunway* getRunway(string name);
+ ActiveRunway* getRunway(const std::string& name);
bool hasActiveTraffic() {
return activeTraffic.size() != 0;
class FGAIFlightPlan; // forward reference
class FGAirport; // forward reference
-typedef vector<FGTaxiSegment*> FGTaxiSegmentVector;
-typedef vector<FGTaxiSegment*>::iterator FGTaxiSegmentVectorIterator;
+typedef std::vector<FGTaxiSegment*> FGTaxiSegmentVector;
+typedef std::vector<FGTaxiSegment*>::iterator FGTaxiSegmentVectorIterator;
//typedef vector<FGTaxiSegment*> FGTaxiSegmentPointerVector;
//typedef vector<FGTaxiSegment*>::iterator FGTaxiSegmentPointerVectorIterator;
bool operator< (const Block &other) const { return blocktime < other.blocktime; };
};
-typedef vector<Block> BlockList;
+typedef std::vector<Block> BlockList;
typedef BlockList::iterator BlockListIterator;
/***************************************************************************************
-typedef vector<int> intVec;
-typedef vector<int>::iterator intVecIterator;
+typedef std::vector<int> intVec;
+typedef std::vector<int>::iterator intVecIterator;
// int getDepth() { return depth; };
};
-typedef vector<FGTaxiRoute> TaxiRouteVector;
-typedef vector<FGTaxiRoute>::iterator TaxiRouteVectorIterator;
+typedef std::vector<FGTaxiRoute> TaxiRouteVector;
+typedef std::vector<FGTaxiRoute>::iterator TaxiRouteVectorIterator;
/**************************************************************************************
* class FGGroundNetWork
AtcMsgDir msgDir);
bool checkForCircularWaits(int id);
virtual void render(bool);
- virtual string getName();
+ virtual std::string getName();
virtual void update(double dt);
void saveElevationCache();