]> git.mxchange.org Git - flightgear.git/commitdiff
Add a method to return a const pointer to the raw airport data, plus a couple of...
authordaveluff <daveluff>
Tue, 29 Nov 2005 20:24:32 +0000 (20:24 +0000)
committerdaveluff <daveluff>
Tue, 29 Nov 2005 20:24:32 +0000 (20:24 +0000)
src/Airports/simple.hxx

index 7645f5972d93debe3659b7ed35e5d6a28e02691e..9e3161474950b72e5e1f5db13976a8668ff942ce 100644 (file)
@@ -444,6 +444,8 @@ typedef airport_map::iterator airport_map_iterator;
 typedef airport_map::const_iterator const_airport_map_iterator;
 
 typedef vector < FGAirport * > airport_list;
+typedef airport_list::iterator airport_list_iterator;
+typedef airport_list::const_iterator const_airport_list_iterator;
 
 
 class FGAirportList {
@@ -467,16 +469,16 @@ public:
               const double elevation, const string& name, const bool has_metar );
 
     // search for the specified id.
-      // Returns NULL if unsucessfull.
+    // Returns NULL if unsucessfull.
     FGAirport* search( const string& id );
        
-       // Search for the next airport in ASCII sequence to the supplied id.
-       // eg. id = "KDC" or "KDCA" would both return "KDCA".
-       // If exact = true then only exact matches are returned.
-       // NOTE: Numbers come prior to A-Z in ASCII sequence so id = "LD" would return "LD57", not "LDDP"
-       // Implementation assumes airport codes are unique.
-       // Returns NULL if unsucessfull.
-       const FGAirport* findFirstById( const string& id, bool exact = false );
+    // Search for the next airport in ASCII sequence to the supplied id.
+    // eg. id = "KDC" or "KDCA" would both return "KDCA".
+    // If exact = true then only exact matches are returned.
+    // NOTE: Numbers come prior to A-Z in ASCII sequence so id = "LD" would return "LD57", not "LDDP"
+    // Implementation assumes airport codes are unique.
+    // Returns NULL if unsucessfull.
+    const FGAirport* findFirstById( const string& id, bool exact = false );
 
     // search for the airport closest to the specified position
     // (currently a linear inefficient search so it's probably not
@@ -494,6 +496,11 @@ public:
      * Return a specific airport, by position.
      */
     const FGAirport *getAirport( unsigned int index ) const;
+       
+    /**
+     * Return a pointer to the raw airport list
+     */
+     inline const airport_list* getAirportList() { return(&airports_array); }
 
     /**
      * Mark the specified airport record as not having metar