2 // simple.hxx -- a really simplistic class to manage airport ID,
3 // lat, lon of the center of one of it's runways, and
6 // Written by Curtis Olson, started April 1998.
8 // Copyright (C) 1998 Curtis L. Olson - curt@me.umn.edu
10 // This program is free software; you can redistribute it and/or
11 // modify it under the terms of the GNU General Public License as
12 // published by the Free Software Foundation; either version 2 of the
13 // License, or (at your option) any later version.
15 // This program is distributed in the hope that it will be useful, but
16 // WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 // General Public License for more details.
20 // You should have received a copy of the GNU General Public License
21 // along with this program; if not, write to the Free Software
22 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
32 # error This library requires C++
36 #include <simgear/compiler.h>
38 #ifdef FG_HAVE_STD_INCLUDES
40 #elif defined( FG_HAVE_NATIVE_SGI_COMPILERS )
41 # include <iostream.h>
42 #elif defined( __BORLANDC__ )
54 #if ! defined( FG_HAVE_NATIVE_SGI_COMPILERS )
55 FG_USING_STD(istream);
61 fgAIRPORT( const string& name = "",
65 : id(name), longitude(lon), latitude(lat), elevation(ele) {}
67 bool operator < ( const fgAIRPORT& a ) const {
79 operator >> ( istream& in, fgAIRPORT& a )
81 return in >> a.id >> a.longitude >> a.latitude >> a.elevation;
86 #ifdef FG_NO_DEFAULT_TEMPLATE_ARGS
87 typedef set< fgAIRPORT, less< fgAIRPORT > > container;
89 typedef set< fgAIRPORT > container;
91 typedef container::iterator iterator;
92 typedef container::const_iterator const_iterator;
106 int load( const string& file );
108 // search for the specified id.
109 // Returns true if successful, otherwise returns false.
110 // On success, airport data is returned thru "airport" pointer.
111 // "airport" is not changed if "id" is not found.
112 bool search( const string& id, fgAIRPORT* airport ) const;
113 fgAIRPORT search( const string& id ) const;
117 #endif /* _AIRPORTS_HXX */