]> git.mxchange.org Git - flightgear.git/blob - src/Airports/dynamicloader.hxx
Fix a typo.
[flightgear.git] / src / Airports / dynamicloader.hxx
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.
5 //
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.
10 //
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.
14 //
15
16 #ifndef _DYNAMIC_LOADER_HXX_
17 #define _DYNAMIC_LOADER_HXX_
18
19 #include <simgear/xml/easyxml.hxx>
20
21 #include "dynamics.hxx"
22 #include <Navaids/positioned.hxx>
23
24 class FGAirportDynamicsXMLLoader : public XMLVisitor {
25 public:
26     FGAirportDynamicsXMLLoader(FGAirportDynamics* dyn);
27
28 protected:
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);
37
38 private:
39     void startParking(const XMLAttributes &atts);    
40     void startNode(const XMLAttributes &atts);
41     void startArc(const XMLAttributes &atts);
42   
43     FGAirportDynamics* _dynamics;
44     string value;
45   
46     // map from local (groundnet.xml) to global (nav-cache) IDs for nodes
47     std::map<int, PositionedID> _idMap;
48   
49   // data integrity - watch for unreferenced nodes and duplicated edges
50     typedef std::pair<int, int> IntPair;
51     std::set<IntPair> _arcSet;
52   
53     std::set<PositionedID> _unreferencedNodes;
54   
55     // map from allocated parking position to its local push-back node
56     // used to defer binding the push-back node until we've processed
57     // all nodes
58     std::map<PositionedID, int> _parkingPushbacks;
59 };
60
61 #endif