Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
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
tree-diff-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 DiffVerb = VerbToken< TreeDiffInterpreter, void(GenNode const &)>
 
using DiffToken = std::tuple< DiffVerb, GenNode >
 
using Interpreter = TreeDiffInterpreter
 

Private Member Functions

DiffSeq populationDiff ()
 
DiffSeq mutationDiff ()
 
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
 

Member Typedef Documentation

◆ DiffSeq

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

Member Function Documentation

◆ populationDiff()

DiffSeq populationDiff ( )
inlineprivate

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

Referenced by DiffTreeApplication_test::run().

+ Here is the caller graph for this function:

◆ mutationDiff()

DiffSeq mutationDiff ( )
inlineprivate

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

References Ref::ATTRIBS, Ref::END, BareEntryID::getSym(), and GenNode::idi.

Referenced by DiffTreeApplication_test::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ run()

virtual void run ( Arg  )
inlineprivatevirtual

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

References DiffApplicator< TAR >::consume(), Record< VAL >::get(), BareEntryID::getSym(), Record< VAL >::getType(), GenNode::idi, Record< VAL >::keys(), DiffTreeApplication_test::mutationDiff(), DiffTreeApplication_test::populationDiff(), and Record< VAL >::scope().

+ Here is the call graph for this function:
+ Inheritance diagram for DiffTreeApplication_test:
+ Collaboration diagram for DiffTreeApplication_test:

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