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

Method updateNodeReferences

libchigraph/src/GraphStruct.cpp:182–204  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

180}
181
182void GraphStruct::updateNodeReferences() {
183 auto makeInstances = context().findInstancesOfType(module().fullNamePath(), "_make_" + name());
184
185 for (auto inst : makeInstances) {
186 // make a make type
187 std::unique_ptr<NodeType> ty;
188 auto res = module().nodeTypeFromName("_make_" + name(), {}, &ty);
189 if (!res) { return; }
190
191 inst->setType(std::move(ty));
192 }
193
194 auto breakInstances =
195 context().findInstancesOfType(module().fullNamePath(), "_break_" + name());
196 for (auto inst : breakInstances) {
197 // make a break type
198 std::unique_ptr<NodeType> ty;
199 auto res = module().nodeTypeFromName("_break_" + name(), {}, &ty);
200 if (!res) { return; }
201
202 inst->setType(std::move(ty));
203 }
204}
205
206} // namespace chi

Callers

nothing calls this directly

Calls 4

findInstancesOfTypeMethod · 0.80
fullNamePathMethod · 0.80
setTypeMethod · 0.80
nodeTypeFromNameMethod · 0.45

Tested by

no test coverage detected