Tree-traversal using HybridTreePath
The HybridTreePath
as kind of a combination of a fully static TreePath
and dynamic DynamicTreePath
, can not be generated during tree traversal using ApplyToTree
. The implementation seems to be straightforward, by combining dynmic and fully static traveral.
I have done a simple implementation of the tree traversal based on existing traversal code, but extracted in a separate class to not touch the current implementation of ApplyToTree
, see Traversal.hpp
Is the TreePathType::mostlyStatic
reserved for HybridTreePath
? Then, the TreePathFactory
just needs to be extended, and the implementation of ApplyToGenericCompositeNode
needs to be adopted, to use push_back(treePath)
instead of treePath.push_back()
or TreePathPushBack
.
Maybe it is possible to generalize the implementation so that all types of tree-path use the push_back(treePath)
syntax, where for dynamic tree-paths it simply redirect to treePath.push_back()
and returns a reference to the passed tree-path object and in case of a static TreePath
type it returns a new type, i.e.
template <std::size_t K, std::size_t... I>
TreePath<I..., K> push_back(TreePath<I...>, std::index_constant<K>) { return {}; }
MutableDynamicTreePath& push_back(MutableDynamicTreePath& tp, std::size_t k) { tp.push_back(k); return tp; }
By the way, the class HybridTreePath
does not have a method view()
and mutablePath()
.