50 #ifndef LIB_DIFF_TREE_MUTATOR_GEN_NODE_BINDING_H 51 #define LIB_DIFF_TREE_MUTATOR_GEN_NODE_BINDING_H 89 : PAR(std::forward<PAR>(chain))
90 , targetObj_(targetObj)
94 injectNew (
GenNode const& spec)
override 96 if (spec.isNamed() and spec.isTypeID())
98 targetObj_.setType(spec.data.get<
string>());
102 return PAR::injectNew (spec);
106 assignElm (
GenNode const& spec)
override 108 if (spec.isNamed() and spec.isTypeID())
110 targetObj_.setType(spec.data.get<
string>());
114 return PAR::assignElm (spec);
119 inline Builder<ObjectTypeHandler<MUT>>
120 filterObjectTypeAttribute (
Rec::Mutator& targetTree, Builder<MUT>&& chain)
123 return Builder<ObTyHa>{ObTyHa {targetTree, move(chain)}};
133 return std::get<0> (targetTree.exposeToDiff());
139 return std::get<1> (targetTree.exposeToDiff());
148 auto rawBinding = this->attach (
collection (accessChildren(targetTree)))
149 .attach (
collection (accessAttribs(targetTree))
150 .isApplicableIf ([](
GenNode const& spec) ->
bool 152 return spec.isNamed();
155 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