]> git.mxchange.org Git - flightgear.git/blob - src/Traffic/TrafficMgr.hxx
Fix some property names.
[flightgear.git] / src / Traffic / TrafficMgr.hxx
1 /* -*- Mode: C++ -*- *****************************************************
2  * TrafficMgr.hxx
3  * Written by Durk Talsma. Started May 5, 2004
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU General Public License as
7  * published by the Free Software Foundation; either version 2 of the
8  * License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  *
19  *
20  **************************************************************************/
21
22 /**************************************************************************
23  * This file contains the class definitions for a (Top Level) traffic
24  * manager for FlightGear. 
25  **************************************************************************/
26
27 #ifndef _TRAFFICMGR_HXX_
28 #define _TRAFFICMGR_HXX_
29
30 #include <simgear/structure/subsystem_mgr.hxx>
31 #include <simgear/xml/easyxml.hxx>
32
33 #include "SchedFlight.hxx"
34 #include "Schedule.hxx"
35
36
37 typedef vector<void *> IdList;
38 typedef vector<void *>::iterator IdListIterator;
39
40
41 class FGTrafficManager : public SGSubsystem, public XMLVisitor
42 {
43 private:
44   ScheduleVector scheduledAircraft;
45   ScheduleVectorIterator currAircraft;
46   string value;
47
48   string mdl, livery, registration, callsign, fltrules, 
49     port, timeString, departurePort, departureTime, arrivalPort, arrivalTime,
50     repeat;
51   int cruiseAlt;
52   bool heavy;
53
54   IdList releaseList;
55     
56   FGScheduledFlightVec flights;
57
58 public:
59   FGTrafficManager();
60   
61   void init();
62   void update(double time);
63   void release(void *ref);
64   bool isReleased(void *id);
65
66   // Some overloaded virtual XMLVisitor members
67   virtual void startXML (); 
68   virtual void endXML   ();
69   virtual void startElement (const char * name, const XMLAttributes &atts);
70   virtual void endElement (const char * name);
71   virtual void data (const char * s, int len);
72   virtual void pi (const char * target, const char * data);
73   virtual void warning (const char * message, int line, int column);
74   virtual void error (const char * message, int line, int column);
75 };
76
77 #endif