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
48 FG_USING_STD(istream);
53 fgAIRPORT( const string& name = "",
57 : id(name), longitude(lon), latitude(lat), elevation(ele) {}
59 bool operator < ( const fgAIRPORT& a ) const {
71 operator >> ( istream& in, fgAIRPORT& a )
73 return in >> a.id >> a.longitude >> a.latitude >> a.elevation;
78 #ifdef FG_NO_DEFAULT_TEMPLATE_ARGS
79 typedef set< fgAIRPORT, less< fgAIRPORT > > container;
81 typedef set< fgAIRPORT > container;
83 typedef container::iterator iterator;
84 typedef container::const_iterator const_iterator;
98 int load( const string& file );
100 // search for the specified id.
101 // Returns true if successful, otherwise returns false.
102 // On success, airport data is returned thru "airport" pointer.
103 // "airport" is not changed if "id" is not found.
104 bool search( const string& id, fgAIRPORT* airport ) const;
105 fgAIRPORT search( const string& id ) const;
109 #endif /* _AIRPORTS_HXX */