Lumiera  0.pre.03
»edit your freedom«
MutationOperation< PAR, MUT > Class Template Reference

Description

template<class PAR, class MUT>
class lib::diff::anonymous_namespace{tree-mutator-attribute-binding.hpp}::MutationOperation< PAR, MUT >

Definition at line 295 of file tree-mutator-attribute-binding.hpp.

Public Member Functions

 MutationOperation (BareEntryID const &attribID, MUT clo, PAR &&chain)
 
virtual bool injectNew (GenNode const &spec) override
 default setup: silently absorb insert. More...
 
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 TreeMutator into the provided Buffer, able to deal with the nested attribute object referred by this binding
 
- Public Member Functions inherited from AttributeBindingBase< PAR >
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 notion of ordering. More...
 
virtual bool acceptSrc (GenNode const &spec) override
 accept status quo, after verifying the spec from the diff verb
 
virtual bool findSrc (GenNode const &refSpec) override
 
virtual bool matchSrc (GenNode const &spec) override
 ensure the given spec is deemed appropriate at that point. More...
 
virtual void skipSrc (GenNode const &refSpec) override
 any reordering or deletion of object fields is prohibited More...
 

Private Member Functions

 ASSERT_VALID_SIGNATURE (MUT, void(TreeMutator::Handle))
 

Private Attributes

MUT mutatorBuilder_
 

Additional Inherited Members

- Protected Member Functions inherited from AttributeBindingBase< PAR >
 AttributeBindingBase (BareEntryID attribID, PAR &&chain)
 
void __ifApplicable_refuse_to (Literal oper, GenNode const &spec)
 
bool isApplicable (GenNode const &spec)
 hard wired "selector predicate" for this binding layer. More...
 

Member Function Documentation

◆ injectNew()

virtual bool injectNew ( GenNode const &  spec)
inlineoverridevirtual

default setup: silently absorb insert.

Remarks
this whole binding flavour (MutateOperation) deals with an odd corner case, namely an object valued attribute, which is deliberately treated as nested scope; a sub-scope accessed by name. Since attributes do not support any notion of "inserting" or "reordering" anyway, it is typical in such a situation for the implementation data structure to manage the underlying object automatically or default construct it anyway; moreover it would be pointless to define a setter, since the whole point is not to assign, but rather to enter and populate the nested target object. Yet, the diff language requires us to send an empty initial value at least once prior to mutation.
Note
if you really need a dedicated custom setter, just define it after the mutateAttribute spec; it's implementation will then be layered on top and shadow this default case.

Definition at line 341 of file tree-mutator-attribute-binding.hpp.

+ Inheritance diagram for MutationOperation< PAR, MUT >:
+ Collaboration diagram for MutationOperation< PAR, MUT >:

The documentation for this class was generated from the following file: