]> git.mxchange.org Git - flightgear.git/blobdiff - src/Traffic/SchedFlight.hxx
Remove unnecessary includes/using
[flightgear.git] / src / Traffic / SchedFlight.hxx
index b6541bd46469dae1ce9b8b49a5d674fce25ba959..751d95895c4e6af3df88c666fc84d8a9e2770747 100644 (file)
@@ -14,7 +14,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
  *
  *
  **************************************************************************/
 #ifndef _FGSCHEDFLIGHT_HXX_
 #define _FGSCHEDFLIGHT_HXX_
 
-
-using namespace std;
-
-SG_USING_STD(vector);
-
+class FGAirport;
 
 class FGScheduledFlight
 {
 private:
-  string callsign;
-  string fltRules;
+  std::string callsign;
+  std::string fltRules;
   FGAirport *departurePort;
   FGAirport *arrivalPort;
-  string depId;
-  string arrId;
+  std::string depId;
+  std::string arrId;
+  std::string requiredAircraft;
   time_t departureTime;
   time_t arrivalTime;
   time_t repeatPeriod;
   int cruiseAltitude;
+  
   bool initialized;
+  bool available;
 
  
  
 public:
   FGScheduledFlight();
   FGScheduledFlight(const FGScheduledFlight &other);
-  //  FGScheduledFlight(const string);
-  FGScheduledFlight::FGScheduledFlight(const string& cs,
-                    const string& fr,
-                    const string& depPrt,
-                    const string& arrPrt,
-                    int cruiseAlt,
-                    const string& deptime,
-                    const string& arrtime,
-                    const string& rep
-                    );
+  //  FGScheduledFlight(const std::string);
+  FGScheduledFlight(const std::string& cs,
+                    const std::string& fr,
+                    const std::string& depPrt,
+                    const std::string& arrPrt,
+                    int cruiseAlt,
+                    const std::string& deptime,
+                    const std::string& arrtime,
+                    const std::string& rep,
+                    const std::string& reqAC
+  );
   ~FGScheduledFlight();
 
   void update();
-   bool initializeAirports();
+  bool initializeAirports();
   
   void adjustTime(time_t now);
 
   time_t getDepartureTime() { return departureTime; };
   time_t getArrivalTime  () { return arrivalTime;   };
   
+  void setDepartureAirport(const std::string& port) { depId = port; };
+  void setArrivalAirport  (const std::string& port) { arrId = port; };
   FGAirport *getDepartureAirport();
   FGAirport *getArrivalAirport  ();
 
@@ -95,13 +97,27 @@ public:
   { 
     return (departureTime < other.departureTime); 
   };
+  const std::string& getFlightRules() { return fltRules; };
+
+  time_t processTimeString(const std::string& time);
+  const std::string& getCallSign() {return callsign; };
+  const std::string& getRequirement() { return requiredAircraft; }
 
-  time_t processTimeString(const string& time);
-  const string& getCallSign() {return callsign; };
+  void lock()    { available = false; };
+  void release() { available = true;  };
+
+  bool isAvailable() { return available; };
+
+  void setCallSign(const std::string& val)    { callsign = val; };
+  void setFlightRules(const std::string& val) { fltRules = val; };
 };
 
-typedef vector<FGScheduledFlight>           FGScheduledFlightVec;
-typedef vector<FGScheduledFlight>::iterator FGScheduledFlightVecIterator;
+typedef std::vector<FGScheduledFlight*>           FGScheduledFlightVec;
+typedef std::vector<FGScheduledFlight*>::iterator FGScheduledFlightVecIterator;
+
+typedef std::map < std::string, FGScheduledFlightVec > FGScheduledFlightMap;
+
+bool compareScheduledFlights(FGScheduledFlight *a, FGScheduledFlight *b);
 
 
 #endif