]> git.mxchange.org Git - flightgear.git/blob - src/Airports/simple.hxx
Multiplayer client/server system -- MessageBuf class and test harness complete
[flightgear.git] / src / Airports / simple.hxx
1 // simple.hxx -- a really simplistic class to manage airport ID,
2 //                 lat, lon of the center of one of it's runways, and 
3 //                 elevation in feet.
4 //
5 // Written by Curtis Olson, started April 1998.
6 //
7 // Copyright (C) 1998  Curtis L. Olson  - curt@me.umn.edu
8 //
9 // This program is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU General Public License as
11 // published by the Free Software Foundation; either version 2 of the
12 // License, or (at your option) any later version.
13 //
14 // This program is distributed in the hope that it will be useful, but
15 // WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 // General Public License for more details.
18 //
19 // You should have received a copy of the GNU General Public License
20 // along with this program; if not, write to the Free Software
21 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 //
23 // $Id$
24
25
26 #ifndef _FG_SIMPLE_HXX
27 #define _FG_SIMPLE_HXX
28
29
30 #ifndef __cplusplus                                                          
31 # error This library requires C++
32 #endif                                   
33
34
35 #ifdef HAVE_CONFIG_H
36 #  include <config.h>
37 #endif
38
39 #include <simgear/compiler.h>
40
41 #include STL_STRING
42 #include <map>
43
44 SG_USING_STD(string);
45 SG_USING_STD(map);
46
47
48 struct FGAirport {
49
50     string id;
51     double longitude;
52     double latitude;
53     double elevation;
54     string code;
55     string name;
56
57 };
58
59 typedef map < string, FGAirport > airport_map;
60 typedef airport_map::iterator airport_map_iterator;
61 typedef airport_map::const_iterator const_airport_map_iterator;
62
63
64 class FGAirportList {
65
66 private:
67
68     airport_map airports;
69
70 public:
71
72     // Constructor
73     FGAirportList( const string& file );
74
75     // Destructor
76     ~FGAirportList();
77
78     // search for the specified id.
79     // Returns true if successful, otherwise returns false.
80     // On success, airport data is returned thru "airport" pointer.
81     // "airport" is not changed if "apt" is not found.
82     FGAirport search( const string& id );
83 };
84
85
86 #endif // _FG_SIMPLE_HXX
87
88