]> git.mxchange.org Git - flightgear.git/blob - src/ATC/towerlist.hxx
- fixed ANSI C++ namespace problems
[flightgear.git] / src / ATC / towerlist.hxx
1 // towerlist.hxx -- ATC Tower data management class
2 //
3 // Written by David Luff, 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 #ifndef _FG_TOWERLIST_HXX
24 #define _FG_TOWERLIST_HXX
25
26
27 #include <simgear/compiler.h>
28 #include <simgear/misc/sg_path.hxx>
29
30 #include <map>
31 #include <vector>
32 #include <string>
33
34 #include "tower.hxx"
35
36 SG_USING_STD(map);
37 SG_USING_STD(vector);
38 SG_USING_STD(string);
39
40
41 class FGTowerList {
42
43     // convenience types
44     typedef vector < FGTower > tower_list_type;
45     typedef tower_list_type::iterator tower_list_iterator;
46     typedef tower_list_type::const_iterator tower_list_const_iterator;
47
48     // Map containing FGTower keyed by frequency.
49     // A vector of FGTower is kept at each node since some may share frequency
50     typedef map < int, tower_list_type > tower_map_type;
51     typedef tower_map_type::iterator tower_map_iterator;
52     typedef tower_map_type::const_iterator tower_map_const_iterator;
53
54     tower_map_type towerlist;
55
56 public:
57
58     FGTowerList();
59     ~FGTowerList();
60
61     // load all atis and build the map
62     bool init( SGPath path );
63
64     // query the database for the specified frequency, lon and lat are
65     // in degrees, elev is in meters
66     bool query( double lon, double lat, double elev, double freq, FGTower *t );
67
68 };
69
70
71 extern FGTowerList *current_towerlist;
72
73
74 #endif // _FG_TOWERLIST_HXX