Changeset 3370 for code/trunk/src/core/Core.h
- Timestamp:
- Jul 30, 2009, 2:10:44 PM (16 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
/code/branches/resource (added) merged: 3328,3336-3340,3342-3350,3352-3366
- Property svn:mergeinfo changed
-
code/trunk/src/core/Core.h
r3323 r3370 43 43 44 44 #include <cassert> 45 #include <boost/scoped_ptr.hpp> 45 46 #include "util/OutputHandler.h" 47 #include "util/ScopeGuard.h" 48 #include "util/Singleton.h" 46 49 47 50 namespace orxonox 48 51 { 49 52 class CoreConfiguration; 53 using boost::scoped_ptr; 50 54 51 55 /** … … 55 59 The class provides information about the media, config and log path. 56 60 It determines those by the use of platform specific functions. 61 @remark 62 You should only create this singleton once because it destroys the identifiers! 57 63 */ 58 class _CoreExport Core 64 class _CoreExport Core : public Singleton<Core> 59 65 { 66 typedef Loki::ScopeGuardImpl0<void (*)()> SimpleScopeGuard; 67 friend class Singleton<Core>; 68 60 69 public: 61 70 /** … … 71 80 void setConfigValues(); 72 81 73 void update(const Clock& time); 82 bool preUpdate(const Clock& time) throw(); 83 bool postUpdate(const Clock& time) throw(); 74 84 75 static Core& getInstance() { assert(Core::singletonRef_s); return *Core::singletonRef_s; } 85 void loadGraphics(); 86 void unloadGraphics(); 76 87 77 88 static int getSoftDebugLevel(OutputHandler::OutputDevice device = OutputHandler::LD_All); … … 87 98 //! Returns the path to the log files as boost::filesystem::path 88 99 static const boost::filesystem::path& getLogPath(); 100 //! Returns the path to the root folder as boost::filesystem::path 101 static const boost::filesystem::path& getRootPath(); 89 102 //! Returns the path to the data files as std::string 90 103 static std::string getMediaPathString(); … … 93 106 //! Returns the path to the log files as std::string 94 107 static std::string getLogPathString(); 108 //! Returns the path to the root folder as std::string 109 static std::string getRootPathString(); 110 111 static bool isDevelopmentRun() { return getInstance().bDevRun_; } 95 112 96 113 private: … … 102 119 void setThreadAffinity(int limitToCPU); 103 120 104 // Singletons 105 ConfigFileManager* configFileManager_; 106 Language* languageInstance_; 107 LuaBind* luaBind_; 108 Shell* shell_; 109 SignalHandler* signalHandler_; 110 TclBind* tclBind_; 111 TclThreadManager* tclThreadManager_; 121 // Mind the order for the destruction! 122 scoped_ptr<SignalHandler> signalHandler_; 123 SimpleScopeGuard identifierDestroyer_; 124 SimpleScopeGuard consoleCommandDestroyer_; 125 scoped_ptr<ConfigFileManager> configFileManager_; 126 scoped_ptr<Language> languageInstance_; 127 scoped_ptr<CoreConfiguration> configuration_; 128 scoped_ptr<LuaBind> luaBind_; 129 scoped_ptr<TclBind> tclBind_; 130 scoped_ptr<TclThreadManager> tclThreadManager_; 131 scoped_ptr<Shell> shell_; 132 // graphical 133 scoped_ptr<GraphicsManager> graphicsManager_; //!< Interface to OGRE 134 scoped_ptr<InputManager> inputManager_; //!< Interface to OIS 135 scoped_ptr<GUIManager> guiManager_; //!< Interface to GUI 112 136 113 bool isDevBuild_; //!< True for builds in the build directory (not installed)114 CoreConfiguration* configuration_;137 bool bDevRun_; //!< True for runs in the build directory (not installed) 138 bool bGraphicsLoaded_; 115 139 116 static Core* singleton Ref_s;140 static Core* singletonPtr_s; 117 141 }; 118 142 }
Note: See TracChangeset
for help on using the changeset viewer.