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

Description

Test:
properties of a container to transport a diff from an abstracted source generator to an abstracted consumer.
  • this covers a standard usage scenario within Lumiera, where some producer in the Session core detects changes in session structure and sends a message to make the UI conform to the new structure
  • diff messages are hard to debug and test, since they are designed as opaque sequences to be consumed only once. Thus for we provide a snapshot decorator to offer diagnostic facilities
  • moreover we provide a simplified builder function to create hard wired diff messages in a concise way
  • and finally this test repeats the scenario of DiffTreeApplication_test, but this time the diff sequences are encapsulated as MutationMessage.
    Remarks
    like all the other diff related tests, this code might be hard to follow, unless you're familiar with the underlying concepts. Basically, a Diff is represented as a linearised sequence of verb tokens. Together these tokens form a diff language. The semantics of that language are oriented towards application of this diff onto a target structure. The goal is to represent structure changes without being bound to a specific data structure implementation. Yet there is one meta data representation used within the diff itself, as well as for various test and demonstration examples: the generic data record together with its variant node element. The key point to note is the (recursive) usage of Record elements as payload within GenNode, which allows to represent tree shaped object like data structures.
    See also
    AbstractTangible_test::mutate() concrete usage scenario for UI-elements
    DiffTreeApplication_test change a tree-like data structure by diff
    DiffComplexApplication_test handling arbitrary data structures
    DiffListApplication_test
    MutationMessage
    ui-bus.hpp

Definition at line 109 of file mutation-message-test.cpp.

Private Member Functions

void demonstrate_standardUsage ()
 
void demonstrate_treeApplication ()
 
MutationMessage mutationDiff ()
 
MutationMessage populationDiff ()
 
virtual void run (Arg)
 
void verify_builder ()
 
void verify_diagnostics ()
 
- 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

- 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
 
- Static Private Attributes inherited from DiffLanguage< TreeDiffInterpreter, GenNode >
static const DiffStep NIL
 fixed "invalid" marker token More...
 

Member Function Documentation

◆ demonstrate_standardUsage()

void demonstrate_standardUsage ( )
inlineprivate
Test:
demonstrate the intended usage pattern
  • a diff generation context is allocated
  • the MutationMessage takes ownership
  • and exposes the generated diff sequence
  • which is pulled during iteration

Definition at line 131 of file mutation-message-test.cpp.

◆ demonstrate_treeApplication()

void demonstrate_treeApplication ( )
inlineprivate
Test:
use MutationMessage to transport and apply changes to target data
Remarks
this almost literally repeats the DiffTreeApplication_test

Definition at line 379 of file mutation-message-test.cpp.

+ Inheritance diagram for MutationMessage_test:
+ Collaboration diagram for MutationMessage_test:

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