Changeset 5867 for code/branches/core5
- Timestamp:
- Oct 4, 2009, 12:02:28 AM (15 years ago)
- Location:
- code/branches/core5/src
- Files:
-
- 2 added
- 1 deleted
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core5/src/libraries/core/CMakeLists.txt
r5855 r5867 37 37 PathConfig.cc 38 38 Resource.cc 39 ScopedSingletonManager.cc 39 40 WindowEventListener.cc 40 41 -
code/branches/core5/src/libraries/core/Core.cc
r5863 r5867 65 65 #include "Language.h" 66 66 #include "LuaState.h" 67 #include "ScopedSingletonManager.h" 67 68 #include "Shell.h" 68 69 #include "TclBind.h" … … 433 434 { 434 435 // singletons from other libraries 435 Scope <ScopeID::Root>::update(time);436 ScopedSingletonManager::update(time, ScopeID::Root); 436 437 if (this->bGraphicsLoaded_) 437 438 { … … 441 442 this->guiManager_->update(time); 442 443 // graphics singletons from other libraries 443 Scope <ScopeID::Graphics>::update(time);444 ScopedSingletonManager::update(time, ScopeID::Graphics); 444 445 } 445 446 // process thread commands -
code/branches/core5/src/libraries/util/Scope.h
r5858 r5867 73 73 //! Gets called if the scope is deactivated 74 74 virtual void deactivated() = 0; 75 //! Gets called if the scope is updated76 virtual void updated(const Clock& time) = 0;77 75 78 76 private: … … 124 122 return (ScopeManager::instanceCounts_s[scope] > 0); 125 123 } 126 127 //! Update method for the ScopeListeners (to implement singleton updates)128 static void update(const Clock& time)129 {130 if (isActive())131 {132 for (typename std::set<ScopeListener*>::iterator it = ScopeManager::listeners_s[scope].begin(); it != ScopeManager::listeners_s[scope].end(); )133 (*(it++))->updated(time);134 }135 }136 124 }; 137 125 } -
code/branches/core5/src/libraries/util/Singleton.h
r5738 r5867 55 55 } 56 56 57 //! Update method called by ClassSingletonManager (if used) 58 void updateSingleton(const Clock& time) { static_cast<T*>(T::singletonPtr_s)->update(time); } 59 //! Empty update method for the static polymorphism 60 void update(const Clock& time) { } 61 57 62 protected: 58 63 //! Constructor sets the singleton instance pointer -
code/branches/core5/src/modules/questsystem/QuestManager.cc
r5800 r5867 41 41 #include "core/ConsoleCommand.h" 42 42 #include "core/LuaState.h" 43 #include "core/ScopedSingletonManager.h" 43 44 #include "infos/PlayerInfo.h" 44 45 #include "overlays/GUIOverlay.h" … … 56 57 //! Pointer to the current (and single) instance of this class. 57 58 /*static*/ QuestManager* QuestManager::singletonPtr_s = NULL; 59 ManageScopedSingleton(QuestManager, ScopeID::Root); 58 60 59 61 /** -
code/branches/core5/src/modules/questsystem/QuestManager.h
r5850 r5867 42 42 #include <string> 43 43 44 #include "util/S copedSingleton.h"44 #include "util/Singleton.h" 45 45 #include "core/OrxonoxClass.h" 46 46 … … 59 59 class _QuestsystemExport QuestManager 60 60 // tolua_end 61 : public S copedSingleton<QuestManager, ScopeID::Root>, public orxonox::OrxonoxClass61 : public Singleton<QuestManager>, public orxonox::OrxonoxClass 62 62 { // tolua_export 63 63 64 friend class S copedSingleton<QuestManager, ScopeID::Root>;64 friend class Singleton<QuestManager>; 65 65 friend class QuestGUI; 66 66 … … 70 70 71 71 //! Returns a reference to the single instance of the Quest Manager. 72 static QuestManager& getInstance() { return S copedSingleton<QuestManager, ScopeID::Root>::getInstance(); } // tolua_export72 static QuestManager& getInstance() { return Singleton<QuestManager>::getInstance(); } // tolua_export 73 73 74 74 //! Retreive the main window for the GUI. -
code/branches/core5/src/modules/questsystem/QuestsystemPrecompiledHeaders.h
r5749 r5867 51 51 #include <OgreColourValue.h> // 16 52 52 53 #include <tinyxml/ticpp.h> 54 #include "util/S copedSingleton.h"// 1353 #include <tinyxml/ticpp.h> // 14 54 #include "util/Singleton.h" // 13 55 55 56 56 /////////////////////////////////////////// -
code/branches/core5/src/modules/questsystem/notifications/NotificationManager.cc
r5760 r5867 37 37 38 38 #include "core/CoreIncludes.h" 39 #include "core/ScopedSingletonManager.h" 39 40 #include "Notification.h" 40 41 #include "interfaces/NotificationListener.h" … … 47 48 48 49 NotificationManager* NotificationManager::singletonPtr_s = NULL; 50 ManageScopedSingleton(NotificationManager, ScopeID::Root); 49 51 50 52 /** -
code/branches/core5/src/modules/questsystem/notifications/NotificationManager.h
r5850 r5867 41 41 #include <string> 42 42 43 #include "util/S copedSingleton.h"43 #include "util/Singleton.h" 44 44 #include "core/OrxonoxClass.h" 45 45 … … 53 53 Damian 'Mozork' Frick 54 54 */ 55 class _QuestsystemExport NotificationManager : public S copedSingleton<NotificationManager, ScopeID::Root>, public OrxonoxClass55 class _QuestsystemExport NotificationManager : public Singleton<NotificationManager>, public OrxonoxClass 56 56 { 57 friend class S copedSingleton<NotificationManager, ScopeID::Root>;57 friend class Singleton<NotificationManager>; 58 58 public: 59 59 NotificationManager(); -
code/branches/core5/src/orxonox/CameraManager.cc
r5850 r5867 26 26 * 27 27 */ 28 28 29 #include "CameraManager.h" 29 30 … … 37 38 #include "core/GUIManager.h" 38 39 #include "core/ObjectList.h" 40 #include "core/ScopedSingletonManager.h" 39 41 #include "tools/Shader.h" 40 42 #include "graphics/Camera.h" … … 43 45 namespace orxonox 44 46 { 47 ManageScopedSingleton(CameraManager, ScopeID::Graphics); 45 48 CameraManager* CameraManager::singletonPtr_s = 0; 46 49 -
code/branches/core5/src/orxonox/CameraManager.h
r5850 r5867 41 41 #include <list> 42 42 #include "util/OgreForwardRefs.h" 43 #include "util/S copedSingleton.h"43 #include "util/Singleton.h" 44 44 #include "core/OrxonoxClass.h" 45 45 #include "core/SmartPtr.h" … … 47 47 namespace orxonox 48 48 { 49 class _OrxonoxExport CameraManager : public S copedSingleton<CameraManager, ScopeID::Graphics>, public OrxonoxClass49 class _OrxonoxExport CameraManager : public Singleton<CameraManager>, public OrxonoxClass 50 50 { 51 friend class S copedSingleton<CameraManager, ScopeID::Graphics>;51 friend class Singleton<CameraManager>; 52 52 public: 53 53 CameraManager(); -
code/branches/core5/src/orxonox/LevelManager.cc
r5836 r5867 36 36 #include "core/CoreIncludes.h" 37 37 #include "core/Loader.h" 38 #include "core/ScopedSingletonManager.h" 38 39 #include "PlayerManager.h" 39 40 #include "Level.h" … … 43 44 SetCommandLineArgument(level, "").shortcut("l").information("Default level file (overrides LevelManager::defaultLevelName_ configValue)"); 44 45 46 ManageScopedSingleton(LevelManager, ScopeID::Root); 45 47 LevelManager* LevelManager::singletonPtr_s = 0; 46 48 -
code/branches/core5/src/orxonox/LevelManager.h
r5850 r5867 36 36 #include <string> 37 37 38 #include "util/S copedSingleton.h"38 #include "util/Singleton.h" 39 39 #include "core/OrxonoxClass.h" 40 40 … … 44 44 class _OrxonoxExport LevelManager 45 45 // tolua_end 46 : public S copedSingleton<LevelManager, ScopeID::Root>, public OrxonoxClass46 : public Singleton<LevelManager>, public OrxonoxClass 47 47 { // tolua_export 48 friend class S copedSingleton<LevelManager, ScopeID::Root>;48 friend class Singleton<LevelManager>; 49 49 public: 50 50 LevelManager(); … … 63 63 64 64 static LevelManager* getInstancePtr() { return singletonPtr_s; } 65 static LevelManager& getInstance() { return S copedSingleton<LevelManager, ScopeID::Root>::getInstance(); } // tolua_export65 static LevelManager& getInstance() { return Singleton<LevelManager>::getInstance(); } // tolua_export 66 66 67 67 private: -
code/branches/core5/src/orxonox/PlayerManager.cc
r5820 r5867 31 31 #include "core/CoreIncludes.h" 32 32 #include "core/GameMode.h" 33 #include "core/ScopedSingletonManager.h" 33 34 #include "Level.h" 34 35 #include "infos/HumanPlayer.h" … … 38 39 { 39 40 PlayerManager* PlayerManager::singletonPtr_s = 0; 41 ManageScopedSingleton(PlayerManager, ScopeID::Root); 40 42 41 43 PlayerManager::PlayerManager() -
code/branches/core5/src/orxonox/PlayerManager.h
r5850 r5867 34 34 #include <cassert> 35 35 #include <map> 36 #include "util/S copedSingleton.h"36 #include "util/Singleton.h" 37 37 #include "network/ClientConnectionListener.h" 38 38 39 39 namespace orxonox 40 40 { 41 class _OrxonoxExport PlayerManager : public S copedSingleton<PlayerManager, ScopeID::Root>, public ClientConnectionListener41 class _OrxonoxExport PlayerManager : public Singleton<PlayerManager>, public ClientConnectionListener 42 42 { 43 friend class S copedSingleton<PlayerManager, ScopeID::Root>;43 friend class Singleton<PlayerManager>; 44 44 public: 45 45 PlayerManager(); -
code/branches/core5/src/orxonox/overlays/InGameConsole.cc
r5855 r5867 48 48 #include "core/ConfigValueIncludes.h" 49 49 #include "core/ConsoleCommand.h" 50 #include "core/ScopedSingletonManager.h" 50 51 #include "core/input/InputManager.h" 51 52 #include "core/input/InputState.h" … … 61 62 62 63 InGameConsole* InGameConsole::singletonPtr_s = 0; 64 ManageScopedSingleton(InGameConsole, ScopeID::Graphics); 63 65 64 66 /** -
code/branches/core5/src/orxonox/overlays/InGameConsole.h
r5850 r5867 36 36 37 37 #include "util/OgreForwardRefs.h" 38 #include "util/S copedSingleton.h"38 #include "util/Singleton.h" 39 39 #include "core/Shell.h" 40 40 #include "core/WindowEventListener.h" … … 42 42 namespace orxonox 43 43 { 44 class _OrxonoxExport InGameConsole : public S copedSingleton<InGameConsole, ScopeID::Graphics>, public ShellListener, public WindowEventListener44 class _OrxonoxExport InGameConsole : public Singleton<InGameConsole>, public ShellListener, public WindowEventListener 45 45 { 46 friend class S copedSingleton<InGameConsole, ScopeID::Graphics>;46 friend class Singleton<InGameConsole>; 47 47 public: // functions 48 48 InGameConsole(); -
code/branches/core5/src/orxonox/sound/SoundManager.cc
r5738 r5867 32 32 33 33 #include "util/Math.h" 34 #include "core/ScopedSingletonManager.h" 34 35 #include "CameraManager.h" 35 36 #include "graphics/Camera.h" … … 39 40 { 40 41 SoundManager* SoundManager::singletonPtr_s = NULL; 42 ManageScopedSingleton(SoundManager, ScopeID::Graphics); 41 43 42 44 /** -
code/branches/core5/src/orxonox/sound/SoundManager.h
r5850 r5867 32 32 #include <cassert> 33 33 #include <list> 34 #include "util/S copedSingleton.h"34 #include "util/Singleton.h" 35 35 #include "tools/interfaces/Tickable.h" 36 36 … … 43 43 * 44 44 */ 45 class _OrxonoxExport SoundManager : public S copedSingleton<SoundManager, ScopeID::Graphics>, public Tickable45 class _OrxonoxExport SoundManager : public Singleton<SoundManager>, public Tickable 46 46 { 47 friend class S copedSingleton<SoundManager, ScopeID::Graphics>;47 friend class Singleton<SoundManager>; 48 48 public: 49 49 SoundManager();
Note: See TracChangeset
for help on using the changeset viewer.