Changeset 10376
- Timestamp:
- Apr 19, 2015, 10:13:42 PM (10 years ago)
- Location:
- code/branches/core7/src/libraries/core/class
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core7/src/libraries/core/class/Identifier.cc
r10375 r10376 205 205 { 206 206 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) 207 if (std::find(this->parents_.begin(), this->parents_.end(), *it_parent_parent) == this->parents_.end()) 208 this->parents_.push_back(*it_parent_parent); 209 if (std::find(this->parents_.begin(), this->parents_.end(), *it_parent) == this->parents_.end()) 210 this->parents_.push_back(*it_parent); 207 this->addIfNotExists(this->parents_, *it_parent_parent); 208 this->addIfNotExists(this->parents_, *it_parent); 211 209 } 212 210 } … … 236 234 237 235 /** 236 * Adds @param identifierToAdd to @param list if this identifier is not already contained in the list. 237 */ 238 void Identifier::addIfNotExists(std::list<const Identifier*>& list, const Identifier* identifierToAdd) const 239 { 240 if (std::find(list.begin(), list.end(), identifierToAdd) == list.end()) 241 list.push_back(identifierToAdd); 242 } 243 244 /** 238 245 @brief Returns true, if the Identifier is at least of the given type. 239 246 @param identifier The identifier to compare with -
code/branches/core7/src/libraries/core/class/Identifier.h
r10374 r10376 215 215 216 216 private: 217 void addIfNotExists(std::list<const Identifier*>& list, const Identifier* identifierToAdd) const; 218 217 219 std::list<const Identifier*> directParents_; //!< The direct parents of the class the Identifier belongs to (sorted by their order of initialization) 218 220 std::list<const Identifier*> parents_; //!< The parents of the class the Identifier belongs to (sorted by their order of initialization)
Note: See TracChangeset
for help on using the changeset viewer.