Lumiera  0.pre.03
»edit your freedom«
DiffTreeApplication_test Class Reference

Description

Test:
Demonstration/Concept: a description language for tree differences.

The representation is given as a linearised sequence of verb tokens. In addition to the verbs used for list diffing, here we additionally have to deal with nested scopes, which can be entered thorough a bracketing construct mut(ID)...emu(ID). This test demonstrates the application of such diff sequences

  • in the first step, an empty root #Record<GenNode> is populated with a type-ID, three named attribute values, three child values and a nested child-Record.
  • the second step demonstrates various diff language constructs to alter, reshape and mutate this data structure After applying those two diff sequences, we verify that the mutated data is indeed in the reordered shape.
    Remarks
    to follow this test, you should be familiar both with our generic data record, as well as with the variant data node. The key point to note is the usage of Record elements as payload within GenNode, which allows to represent tree shaped object-like data structures.
    Note
    literally the same test case is repeated in MutationMessage_test, just there the diff is transported in a MutationMessage capsule, as would be the case in the real application.
    See also
    DiffComplexApplication_test handling arbitrary data structures
    DiffTreeApplicationSimple_test introductory example demonstration
    GenericRecord_test
    GenNode_test
    DiffListApplication_test
    diff-tree-application.hpp
    tree-diff.hpp

Definition at line 104 of file diff-tree-application-test.cpp.

Private Types

using DiffSeq = iter_stl::IterSnapshot< DiffStep >
 
- Private Types inherited from TreeDiffLanguage
using Interpreter = TreeDiffInterpreter
 
- Private Types inherited from DiffLanguage< TreeDiffInterpreter, GenNode >
using DiffToken = std::tuple< DiffVerb, GenNode >
 
using DiffVerb = VerbToken< TreeDiffInterpreter, void(GenNode const &)>
 
using Interpreter = TreeDiffInterpreter
 

Private Member Functions

DiffSeq mutationDiff ()
 
DiffSeq populationDiff ()
 
virtual void run (Arg)
 
- Private Member Functions inherited from TreeDiffLanguage
 DiffStep_CTOR (ins)
 
 DiffStep_CTOR (del)
 
 DiffStep_CTOR (pick)
 
 DiffStep_CTOR (find)
 
 DiffStep_CTOR (skip)
 
 DiffStep_CTOR (after)
 
 DiffStep_CTOR (set)
 
 DiffStep_CTOR (mut)
 
 DiffStep_CTOR (emu)
 

Additional Inherited Members

- Static Private Attributes inherited from DiffLanguage< TreeDiffInterpreter, GenNode >
static const DiffStep NIL
 fixed "invalid" marker token More...
 
+ Inheritance diagram for DiffTreeApplication_test:
+ Collaboration diagram for DiffTreeApplication_test:

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