59 #ifndef LIB_DIFF_TREE_MUTATOR_GEN_NODE_BINDING_H 60 #define LIB_DIFF_TREE_MUTATOR_GEN_NODE_BINDING_H 98 : PAR(std::forward<PAR>(chain))
99 , targetObj_(targetObj)
103 injectNew (
GenNode const& spec)
override 105 if (spec.isNamed() and spec.isTypeID())
107 targetObj_.setType(spec.data.get<
string>());
111 return PAR::injectNew (spec);
115 assignElm (
GenNode const& spec)
override 117 if (spec.isNamed() and spec.isTypeID())
119 targetObj_.setType(spec.data.get<
string>());
123 return PAR::assignElm (spec);
128 inline Builder<ObjectTypeHandler<MUT>>
129 filterObjectTypeAttribute (
Rec::Mutator& targetTree, Builder<MUT>&& chain)
132 return Builder<ObTyHa>{ObTyHa {targetTree, move(chain)}};
142 return std::get<0> (targetTree.exposeToDiff());
148 return std::get<1> (targetTree.exposeToDiff());
157 auto rawBinding = this->attach (
collection (accessChildren(targetTree)))
158 .attach (
collection (accessAttribs(targetTree))
159 .isApplicableIf ([](
GenNode const& spec) ->
bool 161 return spec.isNamed();
164 return filterObjectTypeAttribute(targetTree, move(rawBinding));
Implementation namespace for support and library code.
Generic building block for tree shaped (meta)data structures.
Customisable intermediary to abstract generic tree mutation operations.
Special binding implementation for lib::diff::TreeMutator, allowing to map tree diff operations onto ...
Helper to deal with the magic "object type" attribute.
auto collection(COLL &coll)
Entry point to a nested DSL for setup and configuration of a collection binding.
generic data element node within a tree