1 // simple.hxx -- a really simplistic class to manage airport ID,
2 // lat, lon of the center of one of it's runways, and
5 // Written by Curtis Olson, started April 1998.
7 // Copyright (C) 1998 Curtis L. Olson - http://www.flightgear.org/~curt
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.
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.
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.
26 #ifndef _FG_SIMPLE_HXX
27 #define _FG_SIMPLE_HXX
31 # error This library requires C++
39 #include <simgear/compiler.h>
60 typedef map < string, FGAirport > airport_map;
61 typedef airport_map::iterator airport_map_iterator;
62 typedef airport_map::const_iterator const_airport_map_iterator;
64 typedef vector < FGAirport * > airport_list;
71 airport_map airports_by_id;
72 airport_list airports_array;
77 FGAirportList( const string &airport_file, const string &metar_file );
82 // search for the specified id.
83 // Returns true if successful, otherwise returns false.
84 // On success, airport data is returned thru "airport" pointer.
85 // "airport" is not changed if "apt" is not found.
86 FGAirport search( const string& id );
88 // search for the airport closest to the specified position
89 // (currently a linear inefficient search so it's probably not
90 // best to use this at runtime.) If with_metar is true, then only
91 // return station id's marked as having metar data.
92 FGAirport search( double lon_deg, double lat_deg, bool with_metar );
96 * Return the number of airports in the list.
102 * Return a specific airport, by position.
104 const FGAirport *getAirport( int index ) const;
108 * Mark the specified airport record as not having metar
110 void no_metar( const string &id );
115 #endif // _FG_SIMPLE_HXX