1 // approachlist.hxx -- approach management class
3 // Written by Alexander Kappes, started March 2002.
4 // Based on navlist.hxx by Curtis Olson, started April 2000.
6 // Copyright (C) 2000 Curtis L. Olson - curt@flightgear.org
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.
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.
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.
24 #ifndef _FG_APPROACHLIST_HXX
25 #define _FG_APPROACHLIST_HXX
28 #include <simgear/compiler.h>
29 #include <simgear/misc/sg_path.hxx>
34 #include "approach.hxx"
40 class FGApproachList {
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;
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;
52 approach_map_type approachlist_freq;
53 approach_map_type approachlist_bck;
60 // load the approach data and build the map
61 bool init( SGPath path );
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 );
67 // query the database for the specified bucket number, lon and lat are
69 bool query_bck( double lon, double lat, double elev, FGApproach *a, int max_app, int &num_app );
71 bool get_name( string apt_id );
76 extern FGApproachList *current_approachlist;
79 #endif // _FG_APPROACHLIST_HXX