MCPcopy Create free account
hub / github.com/chigraph/chigraph / setName

Method setName

libchigraph/src/GraphFunction.cpp:508–530  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

506}
507
508std::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
532std::string GraphFunction::qualifiedName() const { return module().fullName() + ":" + name(); }
533

Callers

nothing calls this directly

Calls 6

updateLastEditTimeMethod · 0.80
to_stringMethod · 0.80
findInstancesOfTypeMethod · 0.80
fullNameMethod · 0.80
nodeTypeFromModuleMethod · 0.80
setTypeMethod · 0.80

Tested by

no test coverage detected