]> git.mxchange.org Git - flightgear.git/blob - src/ATC/approachlist.hxx
Attached are a fairly extensive series of patches to the ATC
[flightgear.git] / src / ATC / approachlist.hxx
1 // approachlist.hxx -- approach management class
2 //
3 // Written by Alexander Kappes, started March 2002.
4 // Based on navlist.hxx by Curtis Olson, started April 2000.
5 //
6 // Copyright (C) 2000  Curtis L. Olson - curt@flightgear.org
7 //
8 // This program is free software; you can redistribute it and/or
9 // modify it under the terms of the GNU General Public License as
10 // published by the Free Software Foundation; either version 2 of the
11 // License, or (at your option) any later version.
12 //
13 // This program is distributed in the hope that it will be useful, but
14 // WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 // General Public License for more details.
17 //
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the Free Software
20 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 //
22
23
24 #ifndef _FG_APPROACHLIST_HXX
25 #define _FG_APPROACHLIST_HXX
26
27
28 #include <simgear/compiler.h>
29 #include <simgear/misc/sg_path.hxx>
30
31 #include <map>
32 #include <vector>
33
34 #include "approach.hxx"
35
36 SG_USING_STD(map);
37 SG_USING_STD(vector);
38
39
40 class FGApproachList {
41
42   // convenience types
43   typedef vector < FGApproach > approach_list_type;
44   typedef approach_list_type::iterator approach_list_iterator;
45   typedef approach_list_type::const_iterator approach_list_const_iterator;
46   
47   // typedef map < int, approach_list_type, less<int> > approach_map_type;
48   typedef map < int, approach_list_type > approach_map_type;
49   typedef approach_map_type::iterator approach_map_iterator;
50   typedef approach_map_type::const_iterator approach_map_const_iterator;
51   
52   approach_map_type approachlist_freq;
53   approach_map_type approachlist_bck;
54   
55 public:
56   
57   FGApproachList();
58   ~FGApproachList();
59   
60   // load the approach data and build the map
61   bool init( SGPath path );
62   
63   // query the database for the specified frequency, lon and lat are
64   // in degrees, elev is in meters
65   bool query_freq( double lon, double lat, double elev, double freq, FGApproach *a );
66
67   // query the database for the specified bucket number, lon and lat are
68   // in degrees
69   bool query_bck( double lon, double lat, double elev, FGApproach *a, int max_app, int &num_app );
70
71   bool get_name( string apt_id  );
72
73 };
74
75
76 extern FGApproachList *current_approachlist;
77
78
79 #endif // _FG_APPROACHLIST_HXX