[Orxonox-commit 5715] r10375 - code/branches/core7/src/libraries/core/class

landauf at orxonox.net landauf at orxonox.net
Sun Apr 19 22:07:27 CEST 2015


Author: landauf
Date: 2015-04-19 22:07:27 +0200 (Sun, 19 Apr 2015)
New Revision: 10375

Modified:
   code/branches/core7/src/libraries/core/class/Identifier.cc
Log:
trying to keep the correct order of parents

Modified: code/branches/core7/src/libraries/core/class/Identifier.cc
===================================================================
--- code/branches/core7/src/libraries/core/class/Identifier.cc	2015-04-19 20:04:35 UTC (rev 10374)
+++ code/branches/core7/src/libraries/core/class/Identifier.cc	2015-04-19 20:07:27 UTC (rev 10375)
@@ -201,11 +201,14 @@
                 const_cast<Identifier*>(*it)->finishInitialization(); // initialize parent
 
             // direct parents and their parents are also parents of this identifier (but only add them once)
-            this->parents_ = this->directParents_;
             for (std::list<const Identifier*>::const_iterator it_parent = this->directParents_.begin(); it_parent != this->directParents_.end(); ++it_parent)
+            {
                 for (std::list<const Identifier*>::const_iterator it_parent_parent = const_cast<Identifier*>(*it_parent)->parents_.begin(); it_parent_parent != const_cast<Identifier*>(*it_parent)->parents_.end(); ++it_parent_parent)
                     if (std::find(this->parents_.begin(), this->parents_.end(), *it_parent_parent) == this->parents_.end())
                         this->parents_.push_back(*it_parent_parent);
+                if (std::find(this->parents_.begin(), this->parents_.end(), *it_parent) == this->parents_.end())
+                    this->parents_.push_back(*it_parent);
+            }
         }
         else if (!this->isExactlyA(Class(Identifiable)))
         {




More information about the Orxonox-commit mailing list