Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
MutationOperation< PAR, MUT > Class Template Reference

#include "lib/diff/tree-mutator-attribute-binding.hpp"

Description

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

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

Public Member Functions

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

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)
 
bool isApplicable (GenNode const &spec)
 hard wired "selector predicate" for this binding layer.
 
void __ifApplicable_refuse_to (Literal oper, GenNode const &spec)
 

Constructor & Destructor Documentation

◆ MutationOperation()

template<class PAR , class MUT >
MutationOperation ( BareEntryID const &  attribID,
MUT  clo,
PAR &&  chain 
)
inline

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

Member Function Documentation

◆ ASSERT_VALID_SIGNATURE()

template<class PAR , class MUT >
ASSERT_VALID_SIGNATURE ( MUT  ,
void(TreeMutator::Handle  
)
private

◆ mutateChild()

template<class PAR , class MUT >
virtual bool mutateChild ( GenNode const &  spec,
TreeMutator::Handle  targetBuff 
)
inlineoverridevirtual

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

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

◆ injectNew()

template<class PAR , class MUT >
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 333 of file tree-mutator-attribute-binding.hpp.

Member Data Documentation

◆ mutatorBuilder_

template<class PAR , class MUT >
MUT mutatorBuilder_
private

Definition at line 293 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: