Changeset 1052 for code/trunk/src/orxonox/core/ClassTreeMask.cc
- Timestamp:
- Apr 14, 2008, 3:42:49 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/orxonox/core/ClassTreeMask.cc
r1021 r1052 327 327 { 328 328 // No it's not: Search for classes inheriting from the given class and add the rules for them 329 for (std:: list<const Identifier*>::const_iterator it = subclass->getDirectChildrenBegin(); it != subclass->getDirectChildrenEnd(); ++it)329 for (std::set<const Identifier*>::const_iterator it = subclass->getDirectChildrenBegin(); it != subclass->getDirectChildrenEnd(); ++it) 330 330 if ((*it)->isA(this->root_->getClass())) 331 331 if (overwrite || (!this->nodeExists(*it))) // If we don't want to overwrite, only add nodes that don't already exist … … 422 422 void ClassTreeMask::addSingle(const Identifier* subclass, bool bInclude, bool clean) 423 423 { 424 for (std:: list<const Identifier*>::const_iterator it = subclass->getDirectChildrenBegin(); it != subclass->getDirectChildrenEnd(); ++it)424 for (std::set<const Identifier*>::const_iterator it = subclass->getDirectChildrenBegin(); it != subclass->getDirectChildrenEnd(); ++it) 425 425 this->add(*it, this->isIncluded(*it), false, false); 426 426 … … 561 561 562 562 /** 563 @brief Compares the mask with another mask and returns true if they represent the same logic. 564 @param other The other mask 565 @return True if both masks represent the same logic 566 */ 567 bool ClassTreeMask::operator==(const ClassTreeMask& other) const 568 { 569 ClassTreeMask temp1 = other; 570 ClassTreeMask temp2 = (*this); 571 572 temp1.clean(); 573 temp2.clean(); 574 575 ClassTreeMaskIterator it1 = temp1.root_; 576 ClassTreeMaskIterator it2 = temp2.root_; 577 578 for ( ; it1 && it2; ++it1, ++it2) 579 if (it1->getClass() != it2->getClass()) 580 return false; 581 582 return true; 583 } 584 585 /** 586 @brief Compares the mask with another mask and returns true if they represent different logics. 587 @param other The other mask 588 @return True if the masks represent different logics 589 */ 590 bool ClassTreeMask::operator!=(const ClassTreeMask& other) const 591 { 592 return (!((*this) == other)); 593 } 594 595 /** 563 596 @brief Prefix operator + does nothing. 564 597 @return A reference to the mask itself
Note: See TracChangeset
for help on using the changeset viewer.