]> git.mxchange.org Git - flightgear.git/commitdiff
Changes by Bernie Bright.
authorcurt <curt>
Tue, 8 Sep 1998 21:38:41 +0000 (21:38 +0000)
committercurt <curt>
Tue, 8 Sep 1998 21:38:41 +0000 (21:38 +0000)
Airports/simple.cxx
Airports/simple.hxx

index 91a9576aa5e9665d71c77ab917b4f8c41f76ce70..55578be67812f9f2452bb72110b86b5d52886307 100644 (file)
@@ -30,7 +30,6 @@
 #include <Debug/fg_debug.h>
 #include <Main/options.hxx>
 #include <Misc/fgstream.hxx>
-#include <Misc/stopwatch.hxx>
 
 #include "simple.hxx"
 
@@ -49,7 +48,6 @@ int fgAIRPORTS::load( const string& file ) {
 
     // build the path name to the airport file
     string path = current_options.get_fg_root() + "/Airports/" + file;
-    StopWatch t;
 
     airports.erase( airports.begin(), airports.end() );
 
@@ -58,8 +56,6 @@ int fgAIRPORTS::load( const string& file ) {
        fgPrintf( FG_GENERAL, FG_EXIT, "Cannot open file: %s\n", 
                  path.c_str());
 
-    t.start();
-
     /*
     // We can use the STL copy algorithm because the input
     // file doesn't contain and comments or blank lines.
@@ -72,44 +68,23 @@ int fgAIRPORTS::load( const string& file ) {
     in.eat_comments();
     while ( ! in.eof() )
     {
-       in.stream() >> a.id >> a.longitude >> a.latitude >> a.elevation;
+       in.stream() >> a;
        airports.insert(a);
        in.eat_comments();
     }
 
-    t.stop();
-
-    fgPrintf( FG_GENERAL, FG_INFO, "Loaded %d airports in %f seconds\n",
-             airports.size(), t.elapsedSeconds() );
-
     return 1;
 }
 
-// class fgAIRPORT_eq : public unary_function<fgAIRPORT,bool>
-// {
-// public:
-//     explicit fgAIRPORT_eq( const string& id ) : _id(id) {}
-//     bool operator () ( const fgAIRPORT& a ) const { return a.id == _id; }
-// private:
-//     string _id;
-// };
 
 // search for the specified id
 bool
 fgAIRPORTS::search( const string& id, fgAIRPORT* a ) const
 {
-    StopWatch t;
-    t.start();
-//     const_iterator it = find_if( airports.begin(),
-//                              airports.end(), fgAIRPORT_eq(id) );
-  
     const_iterator it = airports.find( fgAIRPORT(id) );
-    t.stop();
     if ( it != airports.end() )
     {
        *a = *it;
-       cout << "Found " << id << " in " << t.elapsedSeconds()
-            << " seconds" << endl;
        return true;
     }
     else
@@ -134,6 +109,9 @@ fgAIRPORTS::~fgAIRPORTS( void ) {
 
 
 // $Log$
+// Revision 1.7  1998/09/08 21:38:41  curt
+// Changes by Bernie Bright.
+//
 // Revision 1.6  1998/09/03 21:25:02  curt
 // tweaked in data file comment handling.
 //
index 49c1dd2b82126f7275898ac4f004b134b6ae6308..dd2399b0fa2ee703016afdeb91892bdce631d3df 100644 (file)
@@ -36,6 +36,7 @@
 
 #include <string>        // Standard C++ string library
 #include <set>
+#include "Include/fg_stl_config.h"
 
 #ifdef NEEDNAMESPACESTD
 using namespace std;
@@ -69,7 +70,11 @@ operator >> ( istream& in, fgAIRPORT& a )
 
 class fgAIRPORTS {
 public:
+#ifdef _FG_NO_DEFAULT_TEMPLATE_ARGS
+    typedef set< fgAIRPORT, less< fgAIRPORT > > container;
+#else
     typedef set< fgAIRPORT > container;
+#endif
     typedef container::iterator iterator;
     typedef container::const_iterator const_iterator;
 
@@ -100,6 +105,9 @@ public:
 
 
 // $Log$
+// Revision 1.4  1998/09/08 21:38:43  curt
+// Changes by Bernie Bright.
+//
 // Revision 1.3  1998/09/01 19:02:54  curt
 // Changes contributed by Bernie Bright <bbright@c031.aone.net.au>
 //  - The new classes in libmisc.tgz define a stream interface into zlib.