1 // This program is free software; you can redistribute it and/or
2 // modify it under the terms of the GNU General Public License as
3 // published by the Free Software Foundation; either version 2 of the
4 // License, or (at your option) any later version.
6 // This program is distributed in the hope that it will be useful, but
7 // WITHOUT ANY WARRANTY; without even the implied warranty of
8 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
9 // General Public License for more details.
11 // You should have received a copy of the GNU General Public License
12 // along with this program; if not, write to the Free Software
13 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
16 #ifndef _DYNAMIC_LOADER_HXX_
17 #define _DYNAMIC_LOADER_HXX_
19 #include <simgear/xml/easyxml.hxx>
21 #include "dynamics.hxx"
22 #include <Airports/parking.hxx>
24 class FGAirportDynamicsXMLLoader : public XMLVisitor {
26 FGAirportDynamicsXMLLoader(FGAirportDynamics* dyn);
29 virtual void startXML ();
30 virtual void endXML ();
31 virtual void startElement (const char * name, const XMLAttributes &atts);
32 virtual void endElement (const char * name);
33 virtual void data (const char * s, int len);
34 virtual void pi (const char * target, const char * data);
35 virtual void warning (const char * message, int line, int column);
36 virtual void error (const char * message, int line, int column);
39 void startParking(const XMLAttributes &atts);
40 void startNode(const XMLAttributes &atts);
41 void startArc(const XMLAttributes &atts);
43 FGAirportDynamics* _dynamics;
46 // map from local (groundnet.xml) ids to parking instances
47 typedef std::map<int, FGTaxiNodeRef> NodeIndexMap;
48 NodeIndexMap _indexMap;
50 // data integrity - watch for unreferenced nodes and duplicated edges
51 typedef std::pair<int, int> IntPair;
52 std::set<IntPair> _arcSet;
54 std::set<FGTaxiNodeRef> _unreferencedNodes;
56 // map from allocated parking position to its local push-back node
57 // used to defer binding the push-back node until we've processed
59 typedef std::map<FGParkingRef, int> ParkingPushbackIndex;
60 ParkingPushbackIndex _parkingPushbacks;