X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FAIModel%2Fperformancedb.hxx;h=ad3066cb8dc6f4df7a65bc276e0af4a17ef779b1;hb=afcdbd3158503773644aa07dd86cd92d67946bd4;hp=61d040da0ec2d969599e84d7912c6528aa0ca888;hpb=a6db6d89ff41a619569e6433409e8bf62ff98499;p=flightgear.git diff --git a/src/AIModel/performancedb.hxx b/src/AIModel/performancedb.hxx index 61d040da0..ad3066cb8 100644 --- a/src/AIModel/performancedb.hxx +++ b/src/AIModel/performancedb.hxx @@ -2,10 +2,11 @@ #define PERFORMANCEDB_HXX #include -#include #include +#include -#include "performancedata.hxx" +class PerformanceData; +class SGPath; /** * Registry for performance data. @@ -25,11 +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); - void load(SGPath path); + /** + * 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 _db; + + std::string findAlias(const std::string& acType) const; + + typedef std::pair 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 _aliases; }; #endif