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

Function GetPathToRoot

libs/indexer/complex/tree_node.hpp:174–183  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

172
173template <typename Data>
174decltype(auto) GetPathToRoot(types::Ptr<Data> node)
175{
176 types::Ptrs<Data> path;
177 while (node)
178 {
179 path.emplace_back(node);
180 node = node->GetParent();
181 }
182 return path;
183}
184
185template <typename Data, typename Fn>
186types::Ptr<typename std::invoke_result<Fn, Data const &>::type> TransformToTree(types::Ptr<Data> const & node, Fn && fn)

Callers 1

UNIT_TESTFunction · 0.50

Calls 2

emplace_backMethod · 0.45
GetParentMethod · 0.45

Tested by 1

UNIT_TESTFunction · 0.40