Lumiera  0.pre.03
»edit your freedom«
Detector4StructuralChanges< PAR, LIS, assign > Class Template Reference

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

Description

template<class PAR, typename LIS, bool assign = false>
class lib::diff::anonymous_namespace{tree-mutator-listener-binding.hpp}::Detector4StructuralChanges< PAR, LIS, assign >

Decorator for TreeMutator bindings, to fire a listener function when the applied diff describes a relevant change.

Changes can be structural, they can be value mutations or child mutations. By convention, all changes pertaining the sequence of children are classified as structural changes. Thus, effectively a structural change incurs usage of the INS, DEL, SKIP or FIND verbs, which in turn will be translated into the three API operations intercepted here in the basic setup. When value assignments count as "relevant", then we'll also have to intercept the assignElm API operation. However, the relevance of mutations to child elements is difficult to assess on this level, since we can not see what a nested scope actually does to the mutated child elements.

Template Parameters
assignalso trigger on assignments in addition to structural changes (which will always trigger). Defaults to false
Note
TreeMutator is a disposable one-way object; the triggering mechanism directly relies on that. The listener is invoked, whenever a scope is complete, including processing of any nested scopes.

Definition at line 84 of file tree-mutator-listener-binding.hpp.

Public Types

using Elm = GenNode const &
 

Public Member Functions

 Detector4StructuralChanges (LIS functor, PAR &&chain)
 
 Detector4StructuralChanges (Detector4StructuralChanges &&)=default
 
 ~Detector4StructuralChanges ()
 once the diff for this level is completely applied, the TreeMutator will be discarded, and we can fire our change listener at that point. More...
 
bool assignElm (Elm elm) override
 
bool findSrc (Elm elm) override
 
bool injectNew (Elm elm) override
 
void skipSrc (Elm elm) override
 

Private Member Functions

void trigger (bool relevant=true)
 

Private Attributes

LIS changeListener_
 
bool triggered_ = false
 

Constructor & Destructor Documentation

◆ ~Detector4StructuralChanges()

once the diff for this level is completely applied, the TreeMutator will be discarded, and we can fire our change listener at that point.

Definition at line 109 of file tree-mutator-listener-binding.hpp.

References ASSERT_VALID_SIGNATURE.

+ Inheritance diagram for Detector4StructuralChanges< PAR, LIS, assign >:
+ Collaboration diagram for Detector4StructuralChanges< PAR, LIS, assign >:

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