Lumiera
0.pre.03
»edit your freedom«
|
#include "lib/diff/tree-diff-application.hpp"
Interpreter for the tree-diff-language to work on arbitrary opaque target data structures.
A concrete strategy to apply a structural diff to otherwise undisclosed, recursive, tree-like target data. The only requirement is for this target structure to expose a hook for building a customised TreeMutator able to work on and transform the private target data.
This generic setup for diff application covers especially the case where the target data is a "GenNode tree", and the root is accessible as Rec::Mutator (We use the Mutator as entry point, since GenNode trees are by default immutable).
In the extended configuration for tree-diff-application to given opaque target data, the setup uses the metaprogramming adapter traits to pave a way for building the custom TreeMutator implementation, wired internally to the given opaque target. Moreover, based on the concrete target type, a suitable ScopeManager implementation can be provided. Together, these two dynamically created adapters allow the generic TreeDiffMutatorBinding to perform all of the actual diff application and mutation task.
lumiera::error::State | when diff application fails due to the target sequence being different than assumed by the given diff. |
Definition at line 350 of file tree-diff-application.hpp.
Public Member Functions | |
DiffApplicationStrategy (TAR &subject) | |
void | completeDiffApplication () |
void | initDiffApplication () |
Public Member Functions inherited from TreeDiffInterpreter | |
virtual | ~TreeDiffInterpreter () |
this is an interface | |
Private Types | |
using | Scopes = StackScopeManager< TreeMutatorSizeTraits< TAR >::siz > |
Private Member Functions | |
TreeMutator * | buildMutator (DiffMutable &targetBinding) |
Private Attributes | |
Scopes | scopes_ |
TAR & | subject_ |
Additional Inherited Members | |
Public Types inherited from TreeDiffInterpreter | |
using | Val = GenNode |
Protected Attributes inherited from TreeDiffMutatorBinding | |
ScopeManager * | scopeManger_ |
TreeMutator * | treeMutator_ |