Lumiera  0.pre.03
»edit your freedom«
DiffApplicationStrategy< TAR, enable_if< TreeDiffTraits< TAR > > > Class Template Reference

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

Description

template<class TAR>
class lib::diff::DiffApplicationStrategy< TAR, enable_if< TreeDiffTraits< TAR > > >

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.

Exceptions
lumiera::error::Statewhen diff application fails due to the target sequence being different than assumed by the given diff.
See also
DiffComplexApplication_test usage example of this combined machinery
#TreeDiffInterpreter explanation of the verbs

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

TreeMutatorbuildMutator (DiffMutable &targetBinding)
 

Private Attributes

Scopes scopes_
 
TAR & subject_
 

Additional Inherited Members

- Public Types inherited from TreeDiffInterpreter
using Val = GenNode
 
- Protected Attributes inherited from TreeDiffMutatorBinding
ScopeManagerscopeManger_
 
TreeMutatortreeMutator_
 
+ Inheritance diagram for DiffApplicationStrategy< TAR, enable_if< TreeDiffTraits< TAR > > >:
+ Collaboration diagram for DiffApplicationStrategy< TAR, enable_if< TreeDiffTraits< TAR > > >:

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