- Timestamp:
- Dec 2, 2015, 11:22:03 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/libraries/core/ClassTreeMask.cc
r10821 r10916 293 293 { 294 294 // No it's not: Search for classes inheriting from the given class and add the rules for them 295 for (const auto & elem: subclass->getDirectChildren())296 if ( (elem)->isA(this->root_->getClass()))297 if (overwrite || (!this->nodeExists( elem))) // If we don't want to overwrite, only add nodes that don't already exist298 this->add(this->root_, elem, bInclude, overwrite);295 for (const Identifier* directChild : subclass->getDirectChildren()) 296 if (directChild->isA(this->root_->getClass())) 297 if (overwrite || (!this->nodeExists(directChild))) // If we don't want to overwrite, only add nodes that don't already exist 298 this->add(this->root_, directChild, bInclude, overwrite); 299 299 } 300 300 … … 325 325 { 326 326 // Search for an already existing node, containing the subclass we want to add 327 for ( auto & elem: node->subnodes_)327 for (ClassTreeMaskNode* subnode : node->subnodes_) 328 328 { 329 if (subclass->isA( (elem)->getClass()))329 if (subclass->isA(subnode->getClass())) 330 330 { 331 331 // We've found an existing node -> delegate the work with a recursive function-call and return 332 this->add( elem, subclass, bInclude, overwrite);332 this->add(subnode, subclass, bInclude, overwrite); 333 333 return; 334 334 } … … 392 392 if (!subclass) 393 393 return; 394 for (const auto & elem: subclass->getDirectChildren())395 this->add( elem, this->isIncluded(elem), false, false);394 for (const Identifier* directChild : subclass->getDirectChildren()) 395 this->add(directChild, this->isIncluded(directChild), false, false); 396 396 397 397 this->add(subclass, bInclude, false, clean); … … 435 435 436 436 // Go through the list of subnodes and look for a node containing the searched subclass and delegate the request by a recursive function-call. 437 for ( auto & elem: node->subnodes_)438 if (subclass->isA( (elem)->getClass()))439 return isIncluded( elem, subclass);437 for (ClassTreeMaskNode* subnode : node->subnodes_) 438 if (subclass->isA(subnode->getClass())) 439 return isIncluded(subnode, subclass); 440 440 441 441 // There is no subnode containing our class -> the rule of the current node takes in effect … … 957 957 // The bool is "false", meaning they have no subnodes and therefore need no further checks 958 958 if (node->isIncluded()) 959 for (const auto & elem: directChildren)960 this->subclasses_.insert(this->subclasses_.end(), std::pair<const Identifier*, bool>( elem, false));959 for (const Identifier* directChild : directChildren) 960 this->subclasses_.insert(this->subclasses_.end(), std::pair<const Identifier*, bool>(directChild, false)); 961 961 } 962 962 }
Note: See TracChangeset
for help on using the changeset viewer.