Lumiera  0.pre.03
»edityourfreedom«
TreeDiffMutatorBinding Class Reference

#include "lib/diff/tree-diff-application.hpp"

Description

Implementation of the tree-diff-language to work on arbitrary tree-like data.

This is the core part of the implementation, which maps the diff verbs onto the corresponding primitive operations of the TreeMutator interface. The concrete implementation of TreeMutator then is responsible to translate those operations into the correct manipulation of target data.

Note
implementation of these functions is emitted in tree-diff.cpp and thus within the library module. For an actual diff-applicator, we also need to bind to a concrete TreeMutator, for which we need to instantiate the template DiffApplicationStrategy with the concrete target type as parameter (see below). This concrete instantiation happens inline from within the usage context, while inheriting the actual implementation logic from this baseclass here
Exceptions
lumiera::error::Statewhen diff application fails structurally.
<em>unspecifiederrors when delegated operations fail.
See also
TreeDiffInterpreter explanation of the verbs
DiffComplexApplication_test demonstration of usage

Definition at line 275 of file tree-diff-application.hpp.

Public Member Functions

 TreeDiffMutatorBinding ()
 
- Public Member Functions inherited from TreeDiffInterpreter
virtual ~TreeDiffInterpreter ()
 this is an interface More...
 

Protected Attributes

ScopeManagerscopeManger_
 
TreeMutatortreeMutator_
 

Private Member Functions

void __expect_end_of_scope (GenNode::ID const &idi)
 
void __expect_further_elements (GenNode const &elm)
 
void __expect_valid_parent_scope (GenNode::ID const &idi)
 
void __fail_not_found (GenNode const &elm)
 
void __failMismatch (Literal oper, GenNode const &spec)
 
virtual void after (GenNode const &n) override
 cue to a position behind the named node, thereby picking (accepting) all traversed elements into the reshaped new data structure as-is More...
 
virtual void del (GenNode const &n) override
 
virtual void emu (GenNode const &n) override
 finish and leave child object scope, return to parent More...
 
virtual void find (GenNode const &n) override
 
virtual void ins (GenNode const &n) override
 
virtual void mut (GenNode const &n) override
 open nested scope to apply diff to child object More...
 
virtual void pick (GenNode const &n) override
 
virtual void set (GenNode const &n) override
 assignment of changed value in one step More...
 
virtual void skip (GenNode const &n) override
 

Additional Inherited Members

- Public Types inherited from TreeDiffInterpreter
using Val = GenNode
 

Constructor & Destructor Documentation

◆ TreeDiffMutatorBinding()

Definition at line 313 of file tree-diff-application.hpp.

Member Function Documentation

◆ __failMismatch()

void __failMismatch ( Literal  oper,
GenNode const &  spec 
)
private

Definition at line 90 of file tree-diff.cpp.

◆ __expect_further_elements()

void __expect_further_elements ( GenNode const &  elm)
private

Definition at line 98 of file tree-diff.cpp.

◆ __fail_not_found()

void __fail_not_found ( GenNode const &  elm)
private

Definition at line 107 of file tree-diff.cpp.

◆ __expect_end_of_scope()

void __expect_end_of_scope ( GenNode::ID const &  idi)
private

Definition at line 115 of file tree-diff.cpp.

References BareEntryID::getSym().

+ Here is the call graph for this function:

◆ __expect_valid_parent_scope()

void __expect_valid_parent_scope ( GenNode::ID const &  idi)
private

Definition at line 125 of file tree-diff.cpp.

References BareEntryID::getSym().

+ Here is the call graph for this function:

◆ ins()

void ins ( GenNode const &  n)
overrideprivatevirtual

Implements TreeDiffInterpreter.

Definition at line 140 of file tree-diff.cpp.

◆ del()

void del ( GenNode const &  n)
overrideprivatevirtual

Implements TreeDiffInterpreter.

Definition at line 148 of file tree-diff.cpp.

◆ pick()

void pick ( GenNode const &  n)
overrideprivatevirtual

Implements TreeDiffInterpreter.

Definition at line 158 of file tree-diff.cpp.

◆ skip()

void skip ( GenNode const &  n)
overrideprivatevirtual

Implements TreeDiffInterpreter.

Definition at line 166 of file tree-diff.cpp.

◆ find()

void find ( GenNode const &  n)
overrideprivatevirtual

Implements TreeDiffInterpreter.

Definition at line 173 of file tree-diff.cpp.

◆ after()

void after ( GenNode const &  n)
overrideprivatevirtual

cue to a position behind the named node, thereby picking (accepting) all traversed elements into the reshaped new data structure as-is

Implements TreeDiffInterpreter.

Definition at line 190 of file tree-diff.cpp.

◆ set()

void set ( GenNode const &  n)
overrideprivatevirtual

assignment of changed value in one step

Implements TreeDiffInterpreter.

Definition at line 198 of file tree-diff.cpp.

◆ mut()

void mut ( GenNode const &  n)
overrideprivatevirtual

open nested scope to apply diff to child object

Implements TreeDiffInterpreter.

Definition at line 206 of file tree-diff.cpp.

References util::cStr(), PlantingHandle< BA >::get(), GenNode::idi, and TRACE().

+ Here is the call graph for this function:

◆ emu()

void emu ( GenNode const &  n)
overrideprivatevirtual

finish and leave child object scope, return to parent

Implements TreeDiffInterpreter.

Definition at line 218 of file tree-diff.cpp.

References util::cStr(), GenNode::idi, and TRACE().

+ Here is the call graph for this function:

Member Data Documentation

◆ treeMutator_

◆ scopeManger_

+ Inheritance diagram for TreeDiffMutatorBinding:
+ Collaboration diagram for TreeDiffMutatorBinding:

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