- virtual bool compare(const std::string& aA, const std::string& aB) const
- { return aA < aB; }
-};
-
-typedef std::map < std::string, FGAirport* > airport_map;
-typedef airport_map::iterator airport_map_iterator;
-typedef airport_map::const_iterator const_airport_map_iterator;
-
-typedef std::vector < FGAirport * > airport_list;
-typedef airport_list::iterator airport_list_iterator;
-typedef airport_list::const_iterator const_airport_list_iterator;
-
-
-
-class FGAirportList {
-private:
-
- airport_map airports_by_id;
- airport_list airports_array;
-
-public:
- // Constructor (new)
- FGAirportList();
-
- // Destructor
- ~FGAirportList();
-
- // add an entry to the list
- FGAirport* add( const std::string& id, const SGGeod& location, const SGGeod& tower,
- const std::string& name, bool has_metar, bool is_airport,
- bool is_seaport, bool is_heliport );
-
- // search for the specified id.
- // Returns NULL if unsucessfull.
- FGAirport* search( const std::string& id );
-
- // Search for the next airport in ASCII sequence to the supplied id.
- // eg. id = "KDC" or "KDCA" would both return "KDCA".
- // NOTE: Numbers come prior to A-Z in ASCII sequence so id = "LD" would return "LD57", not "LDDP"
- // optional ordering can make letters come before numbers
- // Implementation assumes airport codes are unique.
- // Returns NULL if unsucessfull.
- const FGAirport* findFirstById(const std::string& aIdent, FGIdentOrdering* aOrder = NULL);
-
- // search for the airport closest to the specified position
- // (currently a linear inefficient search so it's probably not
- // best to use this at runtime.) An FGAirportSearchFilter class
- // can be used to restrict the possible choices to a subtype.
- // max_range limits search - specified as an arc distance, in degrees
- FGAirport* search( double lon_deg, double lat_deg, double max_range );
- FGAirport* search( double lon_deg, double lat_deg, double max_range, FGAirportSearchFilter& );
-
- /**
- * Return the number of airports in the list.
- */
- int size() const;
-
- /**
- * Return a specific airport, by position.
- */
- const FGAirport *getAirport( unsigned int index ) const;
-