Changeset 10532
- Timestamp:
- Jun 6, 2015, 4:38:45 PM (9 years ago)
- Location:
- code/branches/core7/src/libraries/core
- Files:
-
- 1 deleted
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core7/src/libraries/core/Core.cc
r10531 r10532 78 78 #include "object/ObjectList.h" 79 79 #include "module/ModuleInstance.h" 80 #include "module/StaticInitializationManager.h" 81 #include "CoreStaticInitializationHandler.h" 80 82 #include "UpdateListener.h" 81 83 … … 111 113 , graphicsScope_(NULL) 112 114 , bGraphicsLoaded_(false) 115 , staticInitHandler_(NULL) 113 116 , rootModule_(NULL) 114 117 , config_(NULL) … … 124 127 125 128 // TODO: initialize StaticInitializationManager 129 this->staticInitHandler_ = new CoreStaticInitializationHandler(); 130 StaticInitializationManager::getInstance().addHandler(this->staticInitHandler_); 131 126 132 // TODO: initialize Root-Context 127 133 // TODO: initialize IdentifierManager here … … 250 256 this->rootModule_->deleteAllStaticallyInitializedInstances(); 251 257 } 258 if (this->staticInitHandler_) 259 StaticInitializationManager::getInstance().removeHandler(this->staticInitHandler_); 252 260 Context::setRootContext(NULL); 253 261 safeObjectDelete(&rootModule_); 262 safeObjectDelete(&staticInitHandler_); 254 263 safeObjectDelete(&dynLibManager_); 255 264 safeObjectDelete(&configurablePaths_); … … 288 297 DynLib* dynLib = this->dynLibManager_->load(module->getName()); 289 298 module->setDynLib(dynLib); 290 module->loadAllStaticallyInitializedInstances(0); 291 IdentifierManager::getInstance().createClassHierarchy(); 292 ScopeManager::getInstance().updateListeners(); 299 300 StaticInitializationManager::getInstance().loadModule(module); 293 301 } 294 302 … … 308 316 orxout(internal_info) << "Unloading module " << module->getName() << "..." << endl; 309 317 310 module->unloadAllStaticallyInitializedInstances(0); 318 StaticInitializationManager::getInstance().unloadModule(module); 319 311 320 module->deleteAllStaticallyInitializedInstances(); 312 321 this->dynLibManager_->unload(module->getDynLib()); -
code/branches/core7/src/libraries/core/Core.h
r10524 r10532 95 95 void setThreadAffinity(int limitToCPU); 96 96 97 ApplicationPaths* applicationPaths_;98 ConfigurablePaths* configurablePaths_;99 DynLibManager* dynLibManager_;100 SignalHandler* signalHandler_;101 ConfigFileManager* configFileManager_;102 Language* languageInstance_;103 Loader* loaderInstance_;104 IOConsole* ioConsole_;105 TclBind* tclBind_;106 TclThreadManager* tclThreadManager_;107 Scope<ScopeID::ROOT>* rootScope_;97 ApplicationPaths* applicationPaths_; 98 ConfigurablePaths* configurablePaths_; 99 DynLibManager* dynLibManager_; 100 SignalHandler* signalHandler_; 101 ConfigFileManager* configFileManager_; 102 Language* languageInstance_; 103 Loader* loaderInstance_; 104 IOConsole* ioConsole_; 105 TclBind* tclBind_; 106 TclThreadManager* tclThreadManager_; 107 Scope<ScopeID::ROOT>* rootScope_; 108 108 // graphical 109 GraphicsManager* graphicsManager_; //!< Interface to OGRE 110 InputManager* inputManager_; //!< Interface to OIS 111 GUIManager* guiManager_; //!< Interface to GUI 112 Scope<ScopeID::GRAPHICS>* graphicsScope_; 113 bool bGraphicsLoaded_; 114 ModuleInstance* rootModule_; 115 std::list<ModuleInstance*>modules_; 109 GraphicsManager* graphicsManager_; //!< Interface to OGRE 110 InputManager* inputManager_; //!< Interface to OIS 111 GUIManager* guiManager_; //!< Interface to GUI 112 Scope<ScopeID::GRAPHICS>* graphicsScope_; 113 bool bGraphicsLoaded_; 114 115 CoreStaticInitializationHandler* staticInitHandler_; 116 ModuleInstance* rootModule_; 117 std::list<ModuleInstance*> modules_; 116 118 117 119 /// Helper object that stores the config values 118 CoreConfig* config_;120 CoreConfig* config_; 119 121 120 122 /// Helper object that executes the surrogate destructor destroy() 121 DestructionHelper<Core> destructionHelper_;123 DestructionHelper<Core> destructionHelper_; 122 124 123 static Core* singletonPtr_s;125 static Core* singletonPtr_s; 124 126 }; 125 127 } -
code/branches/core7/src/libraries/core/CorePrereqs.h
r10531 r10532 158 158 class Core; 159 159 class CoreConfig; 160 class CoreStaticInitializationHandler; 160 161 class Destroyable; 161 162 class DestroyLaterManager; -
code/branches/core7/src/libraries/core/CoreStaticInitializationHandler.cc
r10531 r10532 29 29 #include "CoreStaticInitializationHandler.h" 30 30 31 #include "module/ModuleInstance.h" 32 #include "class/IdentifierManager.h" 33 #include "singleton/ScopeManager.h" 34 31 35 namespace orxonox 32 36 { 37 void CoreStaticInitializationHandler::setupHandler() 38 { 39 // TODO 40 } 41 42 void CoreStaticInitializationHandler::shutdownHandler() 43 { 44 // TODO 45 } 46 47 void CoreStaticInitializationHandler::loadModule(ModuleInstance* module) 48 { 49 module->loadAllStaticallyInitializedInstances(0); 50 IdentifierManager::getInstance().createClassHierarchy(); 51 ScopeManager::getInstance().updateListeners(); 52 } 53 54 void CoreStaticInitializationHandler::unloadModule(ModuleInstance* module) 55 { 56 module->unloadAllStaticallyInitializedInstances(0); 57 } 33 58 } -
code/branches/core7/src/libraries/core/CoreStaticInitializationHandler.h
r10531 r10532 39 39 { 40 40 public: 41 CoreStaticInitializationHandler() {} 42 virtual ~CoreStaticInitializationHandler() {} 41 virtual void setupHandler(); 42 virtual void shutdownHandler(); 43 44 virtual void loadModule(ModuleInstance* module); 45 virtual void unloadModule(ModuleInstance* module); 43 46 }; 44 47 } -
code/branches/core7/src/libraries/core/module/CMakeLists.txt
r10531 r10532 2 2 ModuleInstance.cc 3 3 StaticallyInitializedInstance.cc 4 StaticInitializationHandler.cc5 4 StaticInitializationHandlerIncludes.cc 6 5 StaticInitializationManager.cc -
code/branches/core7/src/libraries/core/module/StaticInitializationHandler.h
r10531 r10532 39 39 StaticInitializationHandler() {} 40 40 virtual ~StaticInitializationHandler() {} 41 42 virtual void setupHandler() = 0; 43 virtual void shutdownHandler() = 0; 44 45 virtual void loadModule(ModuleInstance* module) = 0; 46 virtual void unloadModule(ModuleInstance* module) = 0; 41 47 }; 42 48 } -
code/branches/core7/src/libraries/core/module/StaticInitializationManager.cc
r10531 r10532 29 29 #include "StaticInitializationManager.h" 30 30 31 #include "StaticInitializationHandler.h" 32 31 33 namespace orxonox 32 34 { … … 47 49 } 48 50 49 void StaticInitializationManager:: addCoreHandler()51 void StaticInitializationManager::loadModule(ModuleInstance* module) 50 52 { 51 // TODO 53 for (std::list<StaticInitializationHandler*>::iterator it = this->handlers_.begin(); it != this->handlers_.end(); ++it) 54 (*it)->loadModule(module); 55 } 56 57 void StaticInitializationManager::unloadModule(ModuleInstance* module) 58 { 59 for (std::list<StaticInitializationHandler*>::iterator it = this->handlers_.begin(); it != this->handlers_.end(); ++it) 60 (*it)->unloadModule(module); 52 61 } 53 62 } -
code/branches/core7/src/libraries/core/module/StaticInitializationManager.h
r10531 r10532 49 49 void removeHandler(StaticInitializationHandler* handler); 50 50 51 void loadModule(ModuleInstance* module); 52 void unloadModule(ModuleInstance* module); 53 51 54 private: 52 void addCoreHandler();53 54 55 std::list<StaticInitializationHandler*> handlers_; 55 56 };
Note: See TracChangeset
for help on using the changeset viewer.