95#ifndef LIB_DIFF_TREE_MUTATOR_ATTRIBUTE_BINDING_H
96#define LIB_DIFF_TREE_MUTATOR_ATTRIBUTE_BINDING_H
134 : PAR(
std::forward<PAR>(chain))
135 , attribID_(attribID)
149 and attribID_ == spec.
idi;
155 if (this->isApplicable(spec))
157 "but this binding for '%s' is linked to a data field and "
158 "thus does not support any notion of 'order' or 'position', "
159 "inserting or deletion."}
160 % oper % spec.
idi % this->attribID_);
174 return isApplicable (spec)
175 or PAR::matchSrc (spec);
186 return isApplicable (spec)
187 or PAR::acceptSrc (spec);
199 __ifApplicable_refuse_to (
"skip or drop", refSpec);
200 PAR::skipSrc (refSpec);
206 __ifApplicable_refuse_to (
"re-order", refSpec);
207 return PAR::findSrc (refSpec);
222 if (Ref::END == spec or Ref::ATTRIBS == spec)
223 return PAR::accept_until(spec);
226 __ifApplicable_refuse_to (
"navigate to a position behind", spec);
227 return PAR::accept_until(spec);
235 template<
class PAR,
class CLO>
265 if (not this->isApplicable(spec))
266 return PAR::injectNew(spec);
276 if (not this->isApplicable(spec))
277 return PAR::assignElm(spec);
286 template<
class PAR,
class MUT>
299 , mutatorBuilder_(clo)
309 if (not this->isApplicable(spec))
310 return PAR::mutateChild(spec, targetBuff);
312 mutatorBuilder_(targetBuff);
335 return this->isApplicable(spec)
336 or PAR::injectNew(spec);
344 template<
typename CLO>
348 return chainedBuilder<ChangeOperation<PAR,CLO>> (attributeID, setterClosure);
354 template<
typename CLO>
359 return chainedBuilder<MutationOperation<PAR,CLO>> (key, mutatorBuilderClosure);
364 template<
typename CLO>
368 return chainedBuilder<MutationOperation<PAR,CLO>> (rawID, mutatorBuilderClosure);
A handle to allow for safe »remote implantation« of an unknown subclass into a given opaque InPlaceBu...
Token or Atom with distinct identity.
Generic behaviour of any binding to object fields (attributes).
virtual bool accept_until(GenNode const &spec) override
there is no real support for navigating to a 'position', since attribute / data field binding has no ...
virtual bool matchSrc(GenNode const &spec) override
ensure the given spec is deemed appropriate at that point.
virtual bool findSrc(GenNode const &refSpec) override
virtual bool acceptSrc(GenNode const &spec) override
accept status quo, after verifying the spec from the diff verb
void __ifApplicable_refuse_to(Literal oper, GenNode const &spec)
virtual void skipSrc(GenNode const &refSpec) override
any reordering or deletion of object fields is prohibited
bool isApplicable(GenNode const &spec)
hard wired "selector predicate" for this binding layer.
AttributeBindingBase(BareEntryID attribID, PAR &&chain)
virtual bool assignElm(GenNode const &spec) override
invoke the setter lambda, when this binding layer is in charge
virtual bool injectNew(GenNode const &spec) override
while, strictly speaking, one can not "insert" fields into a given class definition,...
lib::meta::_Fun< CLO >::Args CloArgs
ChangeOperation(Symbol attribKey, CLO clo, PAR &&chain)
virtual bool mutateChild(GenNode const &spec, TreeMutator::Handle targetBuff) override
if this binding layer is in charge, then invoke the closure, which is assumed to construct a nested T...
ASSERT_VALID_SIGNATURE(MUT, void(TreeMutator::Handle))
virtual bool injectNew(GenNode const &spec) override
default setup: silently absorb insert.
MutationOperation(BareEntryID const &attribID, MUT clo, PAR &&chain)
type erased baseclass for building a combined hash and symbolic ID.
A front-end for using printf-style formatting.
Bare symbolic and hash ID used for accounting of asset like entries.
Lumiera error handling (C++ interface).
Generic building block for tree shaped (meta)data structures.
Implementation namespace for support and library code.
LumieraError< LERR_(LOGIC)> Logic
generic data element node within a tree
Builder-DSL to create and configure a concrete TreeMutator.
typed symbolic and hash ID for asset-like position accounting.
Marker types to indicate a literal string and a Symbol.
Customisable intermediary to abstract generic tree mutation operations.
Some basic facilities for manipulating type sequences.