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_
21 #include <simgear/xml/easyxml.hxx>
23 #include "groundnetwork.hxx"
24 #include <Airports/parking.hxx>
26 class FGGroundNetXMLLoader : public XMLVisitor {
28 FGGroundNetXMLLoader(FGGroundNetwork* gn);
31 virtual void startXML ();
32 virtual void endXML ();
33 virtual void startElement (const char * name, const XMLAttributes &atts);
34 virtual void endElement (const char * name);
35 virtual void data (const char * s, int len);
36 virtual void pi (const char * target, const char * data);
37 virtual void warning (const char * message, int line, int column);
38 virtual void error (const char * message, int line, int column);
41 void startParking(const XMLAttributes &atts);
42 void startNode(const XMLAttributes &atts);
43 void startArc(const XMLAttributes &atts);
45 FGGroundNetwork* _groundNetwork;
49 // map from local (groundnet.xml) ids to parking instances
50 typedef std::map<int, FGTaxiNodeRef> NodeIndexMap;
51 NodeIndexMap _indexMap;
53 // data integrity - watch for unreferenced nodes and duplicated edges
54 typedef std::pair<int, int> IntPair;
55 std::set<IntPair> _arcSet;
57 std::set<FGTaxiNodeRef> _unreferencedNodes;
59 // map from allocated parking position to its local push-back node
60 // used to defer binding the push-back node until we've processed
62 typedef std::map<FGParkingRef, int> ParkingPushbackIndex;
63 ParkingPushbackIndex _parkingPushbacks;