- Timestamp:
- May 25, 2015, 9:40:11 PM (9 years ago)
- Location:
- code/branches/core7
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core7/src/libraries/core/CoreIncludes.h
r10404 r10481 167 167 inline Identifier* registerClass(const std::string& name, Factory* factory, bool bLoadable = true) 168 168 { 169 Identifier* identifier = new ClassIdentifier<T>(name, factory, bLoadable); 170 IdentifierManager::getInstance().addIdentifier(identifier); 171 return identifier; 169 return new ClassIdentifier<T>(name, factory, bLoadable); 172 170 } 173 171 … … 242 240 virtual void load() 243 241 { 242 IdentifierManager::getInstance().addIdentifier(this->identifier_); 244 243 for (size_t i = 0; i < this->parents_.size(); ++i) 245 244 this->identifier_->inheritsFrom(this->parents_[i]->getParent()); … … 248 247 virtual void unload() 249 248 { 249 IdentifierManager::getInstance().removeIdentifier(this->identifier_); 250 250 } 251 251 -
code/branches/core7/src/libraries/core/class/IdentifierManager.cc
r10479 r10481 68 68 this->identifierByLowercaseString_[getLowercase(identifier->getName())] = identifier; 69 69 this->identifierByNetworkId_[identifier->getNetworkID()] = identifier; 70 } 71 72 /** 73 * Unregisters the identifier from all maps of the IdentifierManager. 74 */ 75 void IdentifierManager::removeIdentifier(Identifier* identifier) 76 { 77 this->identifiers_.erase(identifier); 78 this->identifierByString_.erase(identifier->getName()); 79 this->identifierByLowercaseString_.erase(getLowercase(identifier->getName())); 80 this->identifierByNetworkId_.erase(identifier->getNetworkID()); 70 81 } 71 82 -
code/branches/core7/src/libraries/core/class/IdentifierManager.h
r10403 r10481 50 50 51 51 void addIdentifier(Identifier* identifier); 52 void removeIdentifier(Identifier* identifier); 52 53 53 54 unsigned int getUniqueClassId() -
code/branches/core7/src/libraries/core/singleton/ScopedSingletonIncludes.h
r10460 r10481 77 77 namespace orxonox 78 78 { 79 80 79 class _CoreExport StaticallyInitializedScopedSingletonWrapper : public StaticallyInitializedInstance 81 80 { -
code/branches/core7/test/core/object/ClassFactoryTest.cc
r9649 r10481 3 3 #include "core/BaseObject.h" 4 4 #include "core/object/Context.h" 5 #include "core/module/ModuleInstance.h" 5 6 6 7 namespace orxonox … … 15 16 { 16 17 Context::setRootContext(new Context(NULL)); 18 ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(); 17 19 } 18 20 19 21 virtual void TearDown() 20 22 { 23 ModuleInstance::getCurrentModuleInstance()->unloadAllStaticallyInitializedInstances(); 21 24 Context::setRootContext(NULL); 22 25 } -
code/branches/core7/test/core/object/ContextTest.cc
r10395 r10481 3 3 #include "core/class/OrxonoxClass.h" 4 4 #include "core/CoreIncludes.h" 5 #include "core/module/ModuleInstance.h" 5 6 6 7 namespace orxonox … … 23 24 { 24 25 Context::setRootContext(new Context(NULL)); 26 ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(); 25 27 } 26 28 27 29 virtual void TearDown() 28 30 { 31 ModuleInstance::getCurrentModuleInstance()->unloadAllStaticallyInitializedInstances(); 29 32 Context::setRootContext(NULL); 30 33 } -
code/branches/core7/test/core/object/IteratorTest.cc
r10395 r10481 6 6 #include "core/class/OrxonoxInterface.h" 7 7 #include "core/CoreIncludes.h" 8 #include "core/module/ModuleInstance.h" 8 9 9 10 namespace orxonox … … 34 35 { 35 36 Context::setRootContext(new Context(NULL)); 37 ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(); 36 38 } 37 39 38 40 virtual void TearDown() 39 41 { 42 ModuleInstance::getCurrentModuleInstance()->unloadAllStaticallyInitializedInstances(); 40 43 Context::setRootContext(NULL); 41 44 } -
code/branches/core7/test/core/object/ListableTest.cc
r10395 r10481 2 2 #include "core/object/Listable.h" 3 3 #include "core/CoreIncludes.h" 4 #include "core/module/ModuleInstance.h" 4 5 5 6 namespace orxonox … … 39 40 { 40 41 Context::setRootContext(new Context(NULL)); 42 ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(); 41 43 } 42 44 43 45 virtual void TearDown() 44 46 { 47 ModuleInstance::getCurrentModuleInstance()->unloadAllStaticallyInitializedInstances(); 45 48 Context::setRootContext(NULL); 46 49 } -
code/branches/core7/test/core/object/ObjectListIteratorTest.cc
r10395 r10481 5 5 #include "core/object/Listable.h" 6 6 #include "core/CoreIncludes.h" 7 #include "core/module/ModuleInstance.h" 7 8 8 9 namespace orxonox … … 26 27 { 27 28 Context::setRootContext(new Context(NULL)); 29 ModuleInstance::getCurrentModuleInstance()->loadAllStaticallyInitializedInstances(); 28 30 } 29 31 30 32 virtual void TearDown() 31 33 { 34 ModuleInstance::getCurrentModuleInstance()->unloadAllStaticallyInitializedInstances(); 32 35 Context::setRootContext(NULL); 33 36 }
Note: See TracChangeset
for help on using the changeset viewer.