*
* 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.
*
*
**************************************************************************/
using namespace std;
-SG_USING_STD(vector);
+using std::vector;
class FGScheduledFlight
private:
string callsign;
string fltRules;
- FGAirport departurePort;
- FGAirport arrivalPort;
+ FGAirport *departurePort;
+ FGAirport *arrivalPort;
+ string depId;
+ string arrId;
+ string requiredAircraft;
time_t departureTime;
time_t arrivalTime;
time_t repeatPeriod;
int cruiseAltitude;
+
bool initialized;
+ bool available;
- void initializeAirports();
+
public:
FGScheduledFlight();
FGScheduledFlight(const FGScheduledFlight &other);
// FGScheduledFlight(const string);
- FGScheduledFlight::FGScheduledFlight(string cs,
- string fr,
- string depPrt,
- string arrPrt,
+ FGScheduledFlight(const string& cs,
+ const string& fr,
+ const string& depPrt,
+ const string& arrPrt,
int cruiseAlt,
- string deptime,
- string arrtime,
- string rep
+ const string& deptime,
+ const string& arrtime,
+ const string& rep,
+ const string& reqAC
);
~FGScheduledFlight();
void update();
+ bool initializeAirports();
void adjustTime(time_t now);
{
return (departureTime < other.departureTime);
};
+ string& getFlightRules() { return fltRules; };
- time_t processTimeString(string time);
-
+ time_t processTimeString(const string& time);
+ const string& getCallSign() {return callsign; };
+ const string& getRequirement() { return requiredAircraft; }
+
+ void lock() { available = false; };
+ void release() { available = true; };
+
+ bool isAvailable() { return available; };
};
-typedef vector<FGScheduledFlight> FGScheduledFlightVec;
-typedef vector<FGScheduledFlight>::iterator FGScheduledFlightVecIterator;
+typedef vector<FGScheduledFlight*> FGScheduledFlightVec;
+typedef vector<FGScheduledFlight*>::iterator FGScheduledFlightVecIterator;
+
+typedef std::map < std::string, FGScheduledFlightVec > FGScheduledFlightMap;
+
+bool compareScheduledFlights(FGScheduledFlight *a, FGScheduledFlight *b);
#endif