| 474 | //----------------------------------------------------------------------------- |
| 475 | |
| 476 | SimObject* SimSet::findObjectByInternalName(StringTableEntry internalName, bool searchChildren) |
| 477 | { |
| 478 | iterator i; |
| 479 | for (i = begin(); i != end(); i++) |
| 480 | { |
| 481 | SimObject *childObj = static_cast<SimObject*>(*i); |
| 482 | if(childObj->getInternalName() == internalName) |
| 483 | return childObj; |
| 484 | else if (searchChildren) |
| 485 | { |
| 486 | SimSet* childSet = dynamic_cast<SimSet*>(*i); |
| 487 | if (childSet) |
| 488 | { |
| 489 | SimObject* found = childSet->findObjectByInternalName(internalName, searchChildren); |
| 490 | if (found) return found; |
| 491 | } |
| 492 | } |
| 493 | } |
| 494 | |
| 495 | return NULL; |
| 496 | } |
| 497 | |
| 498 | //----------------------------------------------------------------------------- |
| 499 |
no test coverage detected