- Timestamp:
- Apr 13, 2015, 11:15:04 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core7/src/libraries/core/class/Identifier.cc
r9667 r10363 144 144 /** 145 145 * @brief Initializes the parents of this Identifier while creating the class hierarchy. 146 * @param identifiers All identifiers that were used to create an instance of this class (including this identifier itself) 146 * @param instance The instance that was used to determine the class hierarchy of this identifier. 147 * @param identifiers All identifiers that were used to create the instance of this class (including this identifier itself) 147 148 */ 148 void Identifier::initializeParents( const std::set<const Identifier*>& identifiers)149 void Identifier::initializeParents(Identifiable* instance, const std::set<const Identifier*>& identifiers) 149 150 { 150 151 if (!IdentifierManager::getInstance().isCreatingHierarchy()) … … 154 155 } 155 156 157 // Add all identifiers which are real parents (dynamic_cast is possible) and that are not equal to THIS identifier. 158 // Checking for dynamic_cast is necessary because some classes may have other classes as nested members. This means that the Identifiers of the nested 159 // classes are also added to the set of potential parents. The only way to distinguish them is to use RTTI (i.e. dynamic_cast). 156 160 for (std::set<const Identifier*>::const_iterator it = identifiers.begin(); it != identifiers.end(); ++it) 157 if (*it != this )161 if (*it != this && (*it)->canDynamicCastObjectToIdentifierClass(instance)) 158 162 this->parents_.insert(*it); 159 163 }
Note: See TracChangeset
for help on using the changeset viewer.