X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FTraffic%2FSchedFlight.hxx;h=751d95895c4e6af3df88c666fc84d8a9e2770747;hb=cff6b2034de866df70a2b29feb3383ee8ccbbef6;hp=b6541bd46469dae1ce9b8b49a5d674fce25ba959;hpb=62a359cc4a338b2f8b720edf8183ab5b69710b14;p=flightgear.git diff --git a/src/Traffic/SchedFlight.hxx b/src/Traffic/SchedFlight.hxx index b6541bd46..751d95895 100644 --- a/src/Traffic/SchedFlight.hxx +++ b/src/Traffic/SchedFlight.hxx @@ -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. * * **************************************************************************/ @@ -40,52 +40,54 @@ #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 FGScheduledFlightVec; -typedef vector::iterator FGScheduledFlightVecIterator; +typedef std::vector FGScheduledFlightVec; +typedef std::vector::iterator FGScheduledFlightVecIterator; + +typedef std::map < std::string, FGScheduledFlightVec > FGScheduledFlightMap; + +bool compareScheduledFlights(FGScheduledFlight *a, FGScheduledFlight *b); #endif