Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10519


Ignore:
Timestamp:
May 31, 2015, 11:26:33 AM (9 years ago)
Author:
landauf
Message:

only verify freshly initialized identifiers

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  
    131131
    132132        // 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();
    142135
    143136        // only check class hierarchy in dev mode because it's an expensive operation and it requires a developer to fix detected problems anyway.
    144137        if (!Core::exists() || Core::getInstance().getConfig()->inDevMode())
    145             this->verifyClassHierarchy();
     138            this->verifyClassHierarchy(initializedIdentifiers);
    146139
    147140        this->stopCreatingHierarchy();
     
    152145     * Verifies if the class hierarchy is consistent with the RTTI.
    153146     */
    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
    156155        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)
    158157        {
    159158            if (!(*it1)->hasFactory())
  • code/branches/core7/src/libraries/core/class/IdentifierManager.h

    r10483 r10519  
    5757            /////////////////////////////
    5858            void createClassHierarchy();
    59             void verifyClassHierarchy();
     59            void verifyClassHierarchy(const std::set<Identifier*>& initializedIdentifiers);
    6060            void destroyClassHierarchy();
    6161
Note: See TracChangeset for help on using the changeset viewer.