Changeset 10519 for code/branches/core7/src/libraries
- Timestamp:
- May 31, 2015, 11:26:33 AM (9 years ago)
- Location:
- code/branches/core7/src/libraries/core/class
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core7/src/libraries/core/class/IdentifierManager.cc
r10518 r10519 131 131 132 132 // finish the initialization of all identifiers 133 for (std::set<Identifier*>::const_iterator it = this->identifiers_.begin(); it != this->identifiers_.end(); ++it) 134 { 135 Identifier* identifier = (*it); 136 137 if (initializedIdentifiers.find(identifier) != initializedIdentifiers.end()) 138 identifier->finishInitialization(); 139 else if (!identifier->isInitialized()) 140 orxout(internal_error) << "Identifier was registered late and is not initialized: " << identifier->getName() << " / " << identifier->getTypeInfo().name() << endl; 141 } 133 for (std::set<Identifier*>::const_iterator it = initializedIdentifiers.begin(); it != initializedIdentifiers.end(); ++it) 134 (*it)->finishInitialization(); 142 135 143 136 // only check class hierarchy in dev mode because it's an expensive operation and it requires a developer to fix detected problems anyway. 144 137 if (!Core::exists() || Core::getInstance().getConfig()->inDevMode()) 145 this->verifyClassHierarchy( );138 this->verifyClassHierarchy(initializedIdentifiers); 146 139 147 140 this->stopCreatingHierarchy(); … … 152 145 * Verifies if the class hierarchy is consistent with the RTTI. 153 146 */ 154 void IdentifierManager::verifyClassHierarchy() 155 { 147 void IdentifierManager::verifyClassHierarchy(const std::set<Identifier*>& initializedIdentifiers) 148 { 149 // check if there are any uninitialized identifiers remaining 150 for (std::set<Identifier*>::const_iterator it = this->identifiers_.begin(); it != this->identifiers_.end(); ++it) 151 if (!(*it)->isInitialized()) 152 orxout(internal_error) << "Identifier was registered late and is not initialized: " << (*it)->getName() << " / " << (*it)->getTypeInfo().name() << endl; 153 154 // for all initialized identifiers, check if a sample instance behaves as expected according to the class hierarchy 156 155 Context temporaryContext(NULL); 157 for (std::set<Identifier*>::const_iterator it1 = this->identifiers_.begin(); it1 != this->identifiers_.end(); ++it1)156 for (std::set<Identifier*>::const_iterator it1 = initializedIdentifiers.begin(); it1 != initializedIdentifiers.end(); ++it1) 158 157 { 159 158 if (!(*it1)->hasFactory()) -
code/branches/core7/src/libraries/core/class/IdentifierManager.h
r10483 r10519 57 57 ///////////////////////////// 58 58 void createClassHierarchy(); 59 void verifyClassHierarchy( );59 void verifyClassHierarchy(const std::set<Identifier*>& initializedIdentifiers); 60 60 void destroyClassHierarchy(); 61 61
Note: See TracChangeset
for help on using the changeset viewer.