| 506 | } |
| 507 | |
| 508 | std::vector<NodeInstance*> GraphFunction::setName(boost::string_view newName, |
| 509 | bool updateReferences) { |
| 510 | // invalidate the cache |
| 511 | module().updateLastEditTime(); |
| 512 | |
| 513 | auto oldName = mName; |
| 514 | mName = newName.to_string(); |
| 515 | |
| 516 | if (updateReferences) { |
| 517 | auto toUpdate = context().findInstancesOfType(module().fullName(), oldName); |
| 518 | |
| 519 | for (auto node : toUpdate) { |
| 520 | std::unique_ptr<NodeType> ty; |
| 521 | auto res = context().nodeTypeFromModule(module().fullName(), name(), {}, &ty); |
| 522 | if (!res) { return {}; } |
| 523 | |
| 524 | node->setType(std::move(ty)); |
| 525 | } |
| 526 | |
| 527 | return toUpdate; |
| 528 | } |
| 529 | return {}; |
| 530 | } |
| 531 | |
| 532 | std::string GraphFunction::qualifiedName() const { return module().fullName() + ":" + name(); } |
| 533 |
nothing calls this directly
no test coverage detected