Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
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
tree-diff-application.hpp
tree-diff.hpp

Definition at line 78 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 DiffVerb = VerbToken< TreeDiffInterpreter, void(GenNode const &)>
 
using DiffToken = std::tuple< DiffVerb, GenNode >
 
using Interpreter = TreeDiffInterpreter
 

Private Member Functions

DiffSeq populationDiff ()
 
DiffSeq reorderingDiff ()
 
DiffSeq mutationDiff ()
 
virtual void run (Arg)
 
void fail_or_ignore ()
 
void fish_for_content ()
 
- 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 82 of file diff-ignore-changes-test.cpp.

Member Function Documentation

◆ populationDiff()

DiffSeq populationDiff ( )
inlineprivate

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

Referenced by DiffIgnoreChanges_test::fail_or_ignore(), and DiffIgnoreChanges_test::fish_for_content().

+ Here is the caller graph for this function:

◆ reorderingDiff()

DiffSeq reorderingDiff ( )
inlineprivate

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

References Ref::ATTRIBS.

Referenced by DiffIgnoreChanges_test::fail_or_ignore(), and DiffIgnoreChanges_test::fish_for_content().

+ Here is the caller graph for this function:

◆ mutationDiff()

DiffSeq mutationDiff ( )
inlineprivate

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

References Ref::END.

Referenced by DiffIgnoreChanges_test::fail_or_ignore(), and DiffIgnoreChanges_test::fish_for_content().

+ Here is the caller graph for this function:

◆ run()

virtual void run ( Arg  )
inlineprivatevirtual

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

References DiffIgnoreChanges_test::fail_or_ignore(), and DiffIgnoreChanges_test::fish_for_content().

+ Here is the call graph for this function:

◆ 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 158 of file diff-ignore-changes-test.cpp.

References DiffApplicator< TAR >::consume(), PlantingHandle< BA, DEFAULT >::emplace(), DiffIgnoreChanges_test::mutationDiff(), DiffIgnoreChanges_test::populationDiff(), DiffIgnoreChanges_test::reorderingDiff(), and VERIFY_ERROR.

Referenced by DiffIgnoreChanges_test::run().

+ Here is the call graph for this function:
+ Here is the caller 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 201 of file diff-ignore-changes-test.cpp.

References DiffApplicator< TAR >::consume(), GenNode::data, PlantingHandle< BA, DEFAULT >::emplace(), DataCap::get(), DiffIgnoreChanges_test::mutationDiff(), DiffIgnoreChanges_test::populationDiff(), and DiffIgnoreChanges_test::reorderingDiff().

Referenced by DiffIgnoreChanges_test::run().

+ Here is the call graph for this function:
+ Here is the caller 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: