MCPcopy Create free account
hub / github.com/comaps/comaps / AddChildrenTo

Function AddChildrenTo

generator/hierarchy.cpp:275–293  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

273}
274
275void AddChildrenTo(HierarchyLinker::Node::Ptrs & trees,
276 std::function<std::vector<HierarchyPlace>(CompositeId const &)> const & fn)
277{
278 for (auto & tree : trees)
279 {
280 CHECK(!tree->HasParent(), ());
281
282 tree_node::PostOrderVisit(tree, [&](auto const & n)
283 {
284 auto const id = n->GetData().GetCompositeId();
285 auto const & places = fn(id);
286 for (auto place : places)
287 {
288 auto const newNode = tree_node::MakeTreeNode(std::move(place));
289 tree_node::Link(newNode, n);
290 }
291 });
292 }
293}
294
295void FlattenBuildingParts(HierarchyLinker::Node::Ptrs & trees)
296{

Callers 2

ProcessMethod · 0.85
UNIT_CLASS_TESTFunction · 0.85

Calls 5

PostOrderVisitFunction · 0.85
MakeTreeNodeFunction · 0.85
LinkFunction · 0.50
HasParentMethod · 0.45
GetDataMethod · 0.45

Tested by 1

UNIT_CLASS_TESTFunction · 0.68