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

Description

Test:
Special case: build a TreeMutator to accept any change and do nothing.
Note
for sake of symmetry, this test uses the same verb sequence used in all the other tree diff tests, assuming this sequence covers pretty much all features supported by the tree diff language.
See also
DiffComplexApplication_test test case which indeed does a lot...
TreeMutator_test base operations of the adapter
diff-tree-application.hpp
tree-diff.hpp

Definition at line 87 of file diff-ignore-changes-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

void fail_or_ignore ()
 
void fish_for_content ()
 
DiffSeq mutationDiff ()
 
DiffSeq populationDiff ()
 
DiffSeq reorderingDiff ()
 
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...
 

Member Function Documentation

◆ fail_or_ignore()

void fail_or_ignore ( )
inlineprivate
Test:
fail or ignore, depending on toggle.
  • the TreeMutator default implementation produces a failure, when it actually has to handle some diff verb
  • yet a custom TreeMutator can be configured to ignoreAllChanges(), in which case it will consume any diff without effect. This test also demonstrates that the actual TreeMutator is built anew for each diff application (TreeMutator is meant to be disposable). Thus we may alter the behaviour of the diff binding dynamically.
    Remarks
    the actual use case for this is the TimelineGui, which either forwards changes to a TimelineWidget, or silently ignores them when the corresponding timeline is not opened.

Definition at line 167 of file diff-ignore-changes-test.cpp.

References TreeMutator::build(), PlantingHandle< BA, DEFAULT >::emplace(), and VERIFY_ERROR.

+ Here is the call graph for this function:

◆ fish_for_content()

void fish_for_content ( )
inlineprivate
Test:
fish some content and ignore everything else.

While the BlackHoleMutation binding generated by ignoreAllChanges() must be used as bottom layer of a custom TreeMutator, it is possible to layer a partial diff binding on top. This test demonstrates this with a single attribute binding, which just "fishes" any value mentioned in the diff for that specific attribute. Any other changes are silently ignored non the less...

Definition at line 210 of file diff-ignore-changes-test.cpp.

References TreeMutator::build(), and PlantingHandle< BA, DEFAULT >::emplace().

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

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