Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 10370


Ignore:
Timestamp:
Apr 16, 2015, 9:59:58 PM (10 years ago)
Author:
landauf
Message:

more checks.

Location:
code/branches/core7/src/libraries/core/class
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core7/src/libraries/core/class/IdentifierManager.cc

    r10366 r10370  
    5454        this->hierarchyCreatingCounter_s = 0;
    5555        this->classIDCounter_s = 0;
     56        this->recordTraceForIdentifier_ = NULL;
    5657    }
    5758
     
    119120                {
    120121                    this->identifierTraceOfNewObject_.clear();
     122                    this->recordTraceForIdentifier_ = it->second;
     123
    121124                    Identifiable* temp = it->second->fabricate(&temporaryContext);
     125
     126                    this->recordTraceForIdentifier_ = NULL;
     127
    122128                    if (temp->getIdentifier() != it->second)
    123129                        orxout(internal_error) << "Newly created object of type " << it->second->getName() << " has unexpected identifier. Did you forget to use RegisterObject(classname)?" << endl;
     
    209215    {
    210216        if (this->isCreatingHierarchy())
    211             this->identifierTraceOfNewObject_[identifiable].insert(identifiable->getIdentifier());
     217        {
     218            if (this->recordTraceForIdentifier_)
     219            {
     220                if (this->identifierTraceOfNewObject_[identifiable].insert(identifiable->getIdentifier()).second == false)
     221                {
     222                    orxout(internal_warning) << this->recordTraceForIdentifier_->getName() << " inherits two times from " <<
     223                        identifiable->getIdentifier()->getName() << ". Did you forget to use virtual inheritance?" << endl;
     224                }
     225            }
     226        }
    212227        else
    213228            orxout(internal_warning) << "createdObject() called outside of class hierarchy creation" << endl;
  • code/branches/core7/src/libraries/core/class/IdentifierManager.h

    r10366 r10370  
    112112            /// a consequence of this, e.g. nested member objects).
    113113            std::map<Identifiable*, std::set<const Identifier*> > identifierTraceOfNewObject_;
     114            Identifier* recordTraceForIdentifier_; //!< The identifier for which we want to record the trace of identifiers during object creation. If null, no trace is recorded.
    114115    };
    115116}
Note: See TracChangeset for help on using the changeset viewer.