[Orxonox-commit 1464] r6182 - in code/branches/presentation2/src: libraries/core libraries/core/input modules/questsystem modules/questsystem/notifications orxonox orxonox/overlays orxonox/sound

rgrieder at orxonox.net rgrieder at orxonox.net
Mon Nov 30 10:44:07 CET 2009


Author: rgrieder
Date: 2009-11-30 10:44:06 +0100 (Mon, 30 Nov 2009)
New Revision: 6182

Modified:
   code/branches/presentation2/src/libraries/core/ScopedSingletonManager.h
   code/branches/presentation2/src/libraries/core/input/KeyBinderManager.cc
   code/branches/presentation2/src/libraries/core/input/KeyDetector.cc
   code/branches/presentation2/src/modules/questsystem/QuestManager.cc
   code/branches/presentation2/src/modules/questsystem/notifications/NotificationManager.cc
   code/branches/presentation2/src/orxonox/CameraManager.cc
   code/branches/presentation2/src/orxonox/LevelManager.cc
   code/branches/presentation2/src/orxonox/MoodManager.cc
   code/branches/presentation2/src/orxonox/PlayerManager.cc
   code/branches/presentation2/src/orxonox/overlays/InGameConsole.cc
   code/branches/presentation2/src/orxonox/sound/SoundManager.cc
Log:
Singleton pointer initialisation should be part of the ManageScopedSingleton macro to ensure the order.

Modified: code/branches/presentation2/src/libraries/core/ScopedSingletonManager.h
===================================================================
--- code/branches/presentation2/src/libraries/core/ScopedSingletonManager.h	2009-11-29 21:48:25 UTC (rev 6181)
+++ code/branches/presentation2/src/libraries/core/ScopedSingletonManager.h	2009-11-30 09:44:06 UTC (rev 6182)
@@ -38,6 +38,7 @@
 #include "util/Singleton.h"
 
 #define ManageScopedSingleton(className, scope, allowedToFail) \
+    className* className::singletonPtr_s = NULL; \
     static ClassScopedSingletonManager<className, scope, allowedToFail> className##ScopedSingletonManager(#className)
 
 namespace orxonox

Modified: code/branches/presentation2/src/libraries/core/input/KeyBinderManager.cc
===================================================================
--- code/branches/presentation2/src/libraries/core/input/KeyBinderManager.cc	2009-11-29 21:48:25 UTC (rev 6181)
+++ code/branches/presentation2/src/libraries/core/input/KeyBinderManager.cc	2009-11-30 09:44:06 UTC (rev 6182)
@@ -39,7 +39,6 @@
 
 namespace orxonox
 {
-    KeyBinderManager* KeyBinderManager::singletonPtr_s = 0;
     ManageScopedSingleton(KeyBinderManager, ScopeID::Graphics, false);
 
     KeyBinderManager::KeyBinderManager()

Modified: code/branches/presentation2/src/libraries/core/input/KeyDetector.cc
===================================================================
--- code/branches/presentation2/src/libraries/core/input/KeyDetector.cc	2009-11-29 21:48:25 UTC (rev 6181)
+++ code/branches/presentation2/src/libraries/core/input/KeyDetector.cc	2009-11-30 09:44:06 UTC (rev 6182)
@@ -38,7 +38,6 @@
 namespace orxonox
 {
     std::string KeyDetector::callbackCommand_s = "KeyDetectorKeyPressed";
-    KeyDetector* KeyDetector::singletonPtr_s = 0;
     ManageScopedSingleton(KeyDetector, ScopeID::Graphics, false);
 
     KeyDetector::KeyDetector()

Modified: code/branches/presentation2/src/modules/questsystem/QuestManager.cc
===================================================================
--- code/branches/presentation2/src/modules/questsystem/QuestManager.cc	2009-11-29 21:48:25 UTC (rev 6181)
+++ code/branches/presentation2/src/modules/questsystem/QuestManager.cc	2009-11-30 09:44:06 UTC (rev 6182)
@@ -54,8 +54,6 @@
     // Register tolua_open function when loading the library
     DeclareToluaInterface(Questsystem);
 
-    //! Pointer to the current (and single) instance of this class.
-    /*static*/ QuestManager* QuestManager::singletonPtr_s = NULL;
     ManageScopedSingleton(QuestManager, ScopeID::Root, false);
 
     /**

Modified: code/branches/presentation2/src/modules/questsystem/notifications/NotificationManager.cc
===================================================================
--- code/branches/presentation2/src/modules/questsystem/notifications/NotificationManager.cc	2009-11-29 21:48:25 UTC (rev 6181)
+++ code/branches/presentation2/src/modules/questsystem/notifications/NotificationManager.cc	2009-11-30 09:44:06 UTC (rev 6182)
@@ -46,7 +46,6 @@
     const std::string NotificationManager::ALL = "all";
     const std::string NotificationManager::NONE = "none";
 
-    NotificationManager* NotificationManager::singletonPtr_s = NULL;
     ManageScopedSingleton(NotificationManager, ScopeID::Root, false);
 
     /**

Modified: code/branches/presentation2/src/orxonox/CameraManager.cc
===================================================================
--- code/branches/presentation2/src/orxonox/CameraManager.cc	2009-11-29 21:48:25 UTC (rev 6181)
+++ code/branches/presentation2/src/orxonox/CameraManager.cc	2009-11-30 09:44:06 UTC (rev 6182)
@@ -44,7 +44,6 @@
 
 namespace orxonox
 {
-    CameraManager* CameraManager::singletonPtr_s = 0;
     ManageScopedSingleton(CameraManager, ScopeID::Graphics, false);
 
     CameraManager::CameraManager()

Modified: code/branches/presentation2/src/orxonox/LevelManager.cc
===================================================================
--- code/branches/presentation2/src/orxonox/LevelManager.cc	2009-11-29 21:48:25 UTC (rev 6181)
+++ code/branches/presentation2/src/orxonox/LevelManager.cc	2009-11-30 09:44:06 UTC (rev 6182)
@@ -43,7 +43,6 @@
 {
     SetCommandLineArgument(level, "").shortcut("l").information("Default level file (overrides LevelManager::defaultLevelName_ configValue)");
 
-    LevelManager* LevelManager::singletonPtr_s = 0;
     ManageScopedSingleton(LevelManager, ScopeID::Root, false);
 
     LevelManager::LevelManager()

Modified: code/branches/presentation2/src/orxonox/MoodManager.cc
===================================================================
--- code/branches/presentation2/src/orxonox/MoodManager.cc	2009-11-29 21:48:25 UTC (rev 6181)
+++ code/branches/presentation2/src/orxonox/MoodManager.cc	2009-11-30 09:44:06 UTC (rev 6182)
@@ -35,7 +35,6 @@
 
 namespace orxonox
 {
-    MoodManager* MoodManager::singletonPtr_s = 0;
     ManageScopedSingleton(MoodManager, ScopeID::Root, false);
 
     MoodManager::MoodManager()

Modified: code/branches/presentation2/src/orxonox/PlayerManager.cc
===================================================================
--- code/branches/presentation2/src/orxonox/PlayerManager.cc	2009-11-29 21:48:25 UTC (rev 6181)
+++ code/branches/presentation2/src/orxonox/PlayerManager.cc	2009-11-30 09:44:06 UTC (rev 6182)
@@ -37,7 +37,6 @@
 
 namespace orxonox
 {
-    PlayerManager* PlayerManager::singletonPtr_s = 0;
     ManageScopedSingleton(PlayerManager, ScopeID::Root, false);
 
     PlayerManager::PlayerManager()

Modified: code/branches/presentation2/src/orxonox/overlays/InGameConsole.cc
===================================================================
--- code/branches/presentation2/src/orxonox/overlays/InGameConsole.cc	2009-11-29 21:48:25 UTC (rev 6181)
+++ code/branches/presentation2/src/orxonox/overlays/InGameConsole.cc	2009-11-30 09:44:06 UTC (rev 6182)
@@ -60,7 +60,6 @@
     SetConsoleCommand(InGameConsole, openConsole, true);
     SetConsoleCommand(InGameConsole, closeConsole, true);
 
-    InGameConsole* InGameConsole::singletonPtr_s = 0;
     ManageScopedSingleton(InGameConsole, ScopeID::Graphics, false);
 
     /**

Modified: code/branches/presentation2/src/orxonox/sound/SoundManager.cc
===================================================================
--- code/branches/presentation2/src/orxonox/sound/SoundManager.cc	2009-11-29 21:48:25 UTC (rev 6181)
+++ code/branches/presentation2/src/orxonox/sound/SoundManager.cc	2009-11-30 09:44:06 UTC (rev 6182)
@@ -45,7 +45,6 @@
 
 namespace orxonox
 {
-    SoundManager* SoundManager::singletonPtr_s = NULL;
     ManageScopedSingleton(SoundManager, ScopeID::Graphics, true);
 
     SoundManager::SoundManager()




More information about the Orxonox-commit mailing list