]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATC/trafficcontrol.hxx
Cleanup, no functional change
[flightgear.git] / src / ATC / trafficcontrol.hxx
index 26d40001584a387deb96fdfceac1a307dc46ba99..bdedf0e1e902b57d6c45f95ac5794835512ba07c 100644 (file)
@@ -21,9 +21,7 @@
 #ifndef _TRAFFIC_CONTROL_HXX_
 #define _TRAFFIC_CONTROL_HXX_
 
-#include <string>
-#include <vector>
-#include <list>
+#include <Airports/airports_fwd.hxx>
 
 #include <osg/Geode>
 #include <osg/Geometry>
 #include <simgear/structure/SGReferenced.hxx>
 #include <simgear/structure/SGSharedPtr.hxx>
 
-typedef std::vector<int> intVec;
-typedef std::vector<int>::iterator intVecIterator;
+class FGAIAircraft;
+typedef std::vector<FGAIAircraft*> AircraftVec;
+typedef std::vector<FGAIAircraft*>::iterator AircraftVecIterator;
 
+class FGAIFlightPlan;
+typedef std::vector<FGAIFlightPlan*>           FlightPlanVec;
+typedef std::vector<FGAIFlightPlan*>::iterator FlightPlanVecIterator;
+typedef std::map<std::string, FlightPlanVec>   FlightPlanVecMap;
 
-class FGAIFlightPlan;  // forward reference
-class FGGroundNetwork; // forward reference
-class FGAIAircraft;    // forward reference
-class FGAirportDynamics;
+class FGTrafficRecord;
+typedef std::list<FGTrafficRecord> TrafficVector;
+typedef std::list<FGTrafficRecord>::iterator TrafficVectorIterator;
+
+class ActiveRunway;
+typedef std::vector<ActiveRunway> ActiveRunwayVec;
+typedef std::vector<ActiveRunway>::iterator ActiveRunwayVecIterator;
+
+typedef std::vector<int> intVec;
+typedef std::vector<int>::iterator intVecIterator;
 
 /**************************************************************************************
  * class FGATCInstruction
@@ -67,34 +76,34 @@ private:
 public:
 
     FGATCInstruction();
-    bool hasInstruction   ();
-    bool getHoldPattern   () {
+    bool hasInstruction   () const;
+    bool getHoldPattern   () const {
         return holdPattern;
     };
-    bool getHoldPosition  () {
+    bool getHoldPosition  () const {
         return holdPosition;
     };
-    bool getChangeSpeed   () {
+    bool getChangeSpeed   () const {
         return changeSpeed;
     };
-    bool getChangeHeading () {
+    bool getChangeHeading () const {
         return changeHeading;
     };
-    bool getChangeAltitude() {
+    bool getChangeAltitude() const {
         return changeAltitude;
     };
 
-    double getSpeed       () {
+    double getSpeed       () const {
         return speed;
     };
-    double getHeading     () {
+    double getHeading     () const {
         return heading;
     };
-    double getAlt         () {
+    double getAlt         () const {
         return alt;
     };
 
-    bool getCheckForCircularWait() {
+    bool getCheckForCircularWait() const {
         return resolveCircularWait;
     };
 
@@ -192,34 +201,34 @@ public:
     int  crosses                   (FGGroundNetwork *, FGTrafficRecord &other);
     bool isOpposing                (FGGroundNetwork *, FGTrafficRecord &other, int node);
     
-    bool isActive(int margin);
+    bool isActive(int margin) const;
 
     bool onRoute(FGGroundNetwork *, FGTrafficRecord &other);
 
-    bool getSpeedAdjustment() {
+    bool getSpeedAdjustment() const {
         return instruction.getChangeSpeed();
     };
 
-    double getLatitude () {
+    double getLatitude () const {
         return latitude ;
     };
-    double getLongitude() {
+    double getLongitude() const {
         return longitude;
     };
-    double getHeading  () {
+    double getHeading  () const {
         return heading  ;
     };
-    double getSpeed    () {
+    double getSpeed    () const {
         return speed    ;
     };
-    double getAltitude () {
+    double getAltitude () const {
         return altitude ;
     };
-    double getRadius   () {
+    double getRadius   () const {
         return radius   ;
     };
 
-    int getWaitsForId  () {
+    int getWaitsForId  () const {
         return waitsForId;
     };
 
@@ -232,10 +241,10 @@ public:
         instruction.setChangeHeading(false);
     };
 
-    bool hasHeadingAdjustment() {
+    bool hasHeadingAdjustment() const {
         return instruction.getChangeHeading();
     };
-    bool hasHoldPosition() {
+    bool hasHoldPosition() const {
         return instruction.getHoldPosition();
     };
     void setHoldPosition (bool inst) {
@@ -253,7 +262,7 @@ public:
         instruction.setResolveCircularWait(false);
     };
 
-    const std::string& getRunway() {
+    const std::string& getRunway() const {
         return runway;
     };
     //void setCallSign(string clsgn) { callsign = clsgn; };
@@ -265,21 +274,21 @@ public:
         allowTransmission=true;
     };
     //string getCallSign() { return callsign; };
-    FGAIAircraft *getAircraft() {
+    FGAIAircraft *getAircraft() const {
         return aircraft;
     };
-    int getTime() {
+    int getTime() const {
         return timer;
     };
-    int getLeg() {
+    int getLeg() const {
         return leg;
     };
     void setTime(time_t time) {
         timer = time;
     };
 
-    bool pushBackAllowed();
-    bool allowTransmissions() {
+    bool pushBackAllowed() const;
+    bool allowTransmissions() const {
         return allowTransmission;
     };
     void allowPushBack() { allowPushback =true;};
@@ -293,28 +302,19 @@ public:
     void nextFrequency() {
         frequencyId++;
     };
-    int  getNextFrequency() {
+    int  getNextFrequency() const {
         return frequencyId;
     };
     intVec& getIntentions() {
         return intentions;
     };
-    int getCurrentPosition() {
+    int getCurrentPosition() const {
         return currentPos;
     };
     void setPriority(int p) { priority = p; };
-    int getPriority()       { return priority; };
+    int getPriority() const { return priority; };
 };
 
-typedef std::list<FGTrafficRecord> TrafficVector;
-typedef std::list<FGTrafficRecord>::iterator TrafficVectorIterator;
-
-typedef std::vector<time_t> TimeVector;
-typedef std::vector<time_t>::iterator TimeVectorIterator;
-
-typedef std::vector<FGAIAircraft*> AircraftVec;
-typedef std::vector<FGAIAircraft*>::iterator AircraftVecIterator;
-
 /***********************************************************************
  * Active runway, a utility class to keep track of which aircraft has
  * clearance for a given runway.
@@ -368,9 +368,6 @@ public:
     void printDepartureCue();
 };
 
-typedef std::vector<ActiveRunway> ActiveRunwayVec;
-typedef std::vector<ActiveRunway>::iterator ActiveRunwayVecIterator;
-
 /**
  * class FGATCController
  * NOTE: this class serves as an abstraction layer for all sorts of ATC controllers.
@@ -482,7 +479,7 @@ public:
     virtual std::string getName();
     virtual void update(double dt);
     bool hasActiveTraffic() {
-        return activeTraffic.size() != 0;
+        return ! activeTraffic.empty();
     };
     TrafficVector &getActiveTraffic() {
         return activeTraffic;
@@ -519,7 +516,7 @@ public:
     virtual void update(double dt);
 
     bool hasActiveTraffic() {
-        return activeTraffic.size() != 0;
+        return ! activeTraffic.empty();
     };
     TrafficVector &getActiveTraffic() {
         return activeTraffic;
@@ -561,7 +558,7 @@ public:
     ActiveRunway* getRunway(const std::string& name);
 
     bool hasActiveTraffic() {
-        return activeTraffic.size() != 0;
+        return ! activeTraffic.empty();
     };
     TrafficVector &getActiveTraffic() {
         return activeTraffic;