]> git.mxchange.org Git - flightgear.git/blobdiff - src/Input/FGDeviceConfigurationMap.hxx
replay system: protect from recording multiple records for identical time
[flightgear.git] / src / Input / FGDeviceConfigurationMap.hxx
index 27a3a8a143d6904a43d6140d15361d0808cc2e29..8266a466bbf902fcaca78da9ccca6804f5b9b3c5 100644 (file)
 #include <simgear/misc/sg_path.hxx>
 
 #include <map>
-using std::map;
 
-class FGDeviceConfigurationMap : public map<string,SGPropertyNode_ptr> {
+class FGDeviceConfigurationMap
+{
 public:
-  FGDeviceConfigurationMap ( const char * relative_path, SGPropertyNode_ptr base, const char * childname );
+  FGDeviceConfigurationMap ( const std::string& relative_path,
+                            SGPropertyNode* nodePath,
+                            const std::string& nodeName);
   virtual ~FGDeviceConfigurationMap();
+
+  SGPropertyNode_ptr configurationForDeviceName(const std::string& name);
+  
+  bool hasConfiguration(const std::string& name) const;
 private:
-  void scan_dir( SGPath & path, int *index);
-  SGPropertyNode_ptr base;
-  const char * childname;
+  void scan_dir(const SGPath & path);
+  
+  void readCachedData(const SGPath& path);
+  void refreshCacheForFile(const SGPath& path);
+  
+  typedef std::map<std::string, SGPropertyNode_ptr> NameNodeMap;
+// dictionary of over-ridden configurations, where the config data
+// was explicitly loaded and shoudl be picked over a file search
+  NameNodeMap overrideDict;
+  
+  typedef std::map<std::string, SGPath> NamePathMap;
+// mapping from joystick name to XML configuration file path
+  NamePathMap namePathMap;
 };
 
 #endif