]> git.mxchange.org Git - simgear.git/blobdiff - simgear/structure/commands.hxx
Merge branch 'topic/gcintersect' into next
[simgear.git] / simgear / structure / commands.hxx
index 4ab28a09960a7c320bdb90f4b31efcc3f9bd7c75..0825ffd9fc58c3c97b966d3d498dd11892acd1a6 100644 (file)
 
 #include <simgear/compiler.h>
 
-#include STL_STRING
+#include <string>
 #include <map>
 #include <vector>
 
+#include <OpenThreads/Mutex>
+
 #include <simgear/props/props.hxx>
 
-SG_USING_STD(string);
-SG_USING_STD(map);
-SG_USING_STD(vector);
+using std::string;
+using std::map;
+using std::vector;
 
 
 /**
@@ -44,17 +46,15 @@ public:
   typedef bool (*command_t) (const SGPropertyNode * arg);
 
 
-  /**
-   * Default constructor.
-   */
-  SGCommandMgr ();
-
-
   /**
    * Destructor.
    */
   virtual ~SGCommandMgr ();
 
+  /**
+   * Implement the classical singleton.
+   */
+  static SGCommandMgr* instance();
 
   /**
    * Register a new command with the manager.
@@ -99,11 +99,20 @@ public:
    */
   virtual bool execute (const string &name, const SGPropertyNode * arg) const;
 
+protected:
+  /**
+   * Default constructor.
+   */
+  SGCommandMgr ();
+
+
 private:
 
   typedef map<string,command_t> command_map;
   command_map _commands;
 
+  static OpenThreads::Mutex _instanceMutex;
+
 };
 
 #endif // __COMMANDS_HXX