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 <Include/compiler.h>
37 #ifdef FG_HAVE_STD_INCLUDES
39 #elif defined( FG_HAVE_NATIVE_SGI_COMPILERS )
40 # include <iostream.h>
41 #elif defined( __BORLANDC__ )
53 #if ! defined( FG_HAVE_NATIVE_SGI_COMPILERS )
54 FG_USING_STD(istream);
60 fgAIRPORT( const string& name = "",
64 : id(name), longitude(lon), latitude(lat), elevation(ele) {}
66 bool operator < ( const fgAIRPORT& a ) const {
78 operator >> ( istream& in, fgAIRPORT& a )
80 return in >> a.id >> a.longitude >> a.latitude >> a.elevation;
85 #ifdef FG_NO_DEFAULT_TEMPLATE_ARGS
86 typedef set< fgAIRPORT, less< fgAIRPORT > > container;
88 typedef set< fgAIRPORT > container;
90 typedef container::iterator iterator;
91 typedef container::const_iterator const_iterator;
105 int load( const string& file );
107 // search for the specified id.
108 // Returns true if successful, otherwise returns false.
109 // On success, airport data is returned thru "airport" pointer.
110 // "airport" is not changed if "id" is not found.
111 bool search( const string& id, fgAIRPORT* airport ) const;
112 fgAIRPORT search( const string& id ) const;
116 #endif /* _AIRPORTS_HXX */