]> git.mxchange.org Git - flightgear.git/blobdiff - src/AIModel/performancedb.hxx
Overhaul the ground-net / parking code.
[flightgear.git] / src / AIModel / performancedb.hxx
index 4e397ac27d59dc7bdf16b9082a8b226450975fa5..ad3066cb8dc6f4df7a65bc276e0af4a17ef779b1 100644 (file)
@@ -3,8 +3,10 @@
 
 #include <string>
 #include <map>
+#include <vector>
 
-#include "performancedata.hxx"
+class PerformanceData;
+class SGPath;
 
 /**
  * Registry for performance data.
@@ -12,7 +14,7 @@
  * Allows to store performance data for later reuse/retrieval. Just
  * a simple map for now.
  * 
- * @author Thomas Förster <t.foerster@biologie.hu-berlin.de>
+ * @author Thomas Frster <t.foerster@biologie.hu-berlin.de>
 */
 //TODO provide std::map interface?
 class PerformanceDB
@@ -24,10 +26,23 @@ public:
     void registerPerformanceData(const std::string& id, PerformanceData* data);
     void registerPerformanceData(const std::string& id, const std::string& filename);
 
-    PerformanceData* getDataFor(const std::string& id);
+    /**
+     * get performance data for an aircraft type / class. Type is specific, eg
+     * '738' or 'A319'. Class is more generic, such as 'jet_transport'.
+     */
+    PerformanceData* getDataFor(const std::string& acType, const std::string& acClass);
+    void load(const SGPath& path);
 
 private:
     std::map<std::string, PerformanceData*> _db;
+    
+    std::string findAlias(const std::string& acType) const;
+  
+    typedef std::pair<std::string, std::string> StringPair;
+  /// alias list, to allow type/class names to share data. This is used to merge
+  /// related types together. Note it's ordered, and not a map since we permit
+  /// partial matches when merging - the first matching alias is used.
+    std::vector<StringPair> _aliases;
 };
 
 #endif