Lumiera
0.pre.03
»edit your freedom«
|
Go to the source code of this file.
Special binding implementation for TreeMutator, allowing to map tree diff operations onto an »External Tree Description«.
This term denotes a DOM like representation of tree like structures, comprised of GenNode elements. TreeMutator is a customisable intermediary, which enables otherwise opaque implementation data structures to receive and respond to generic structural change messages ("tree diff").
Each concrete TreeMutator instance will be configured differently, and this adaptation is done by implementing binding templates, in the way of building blocks, layered on top of each other. This header defines a special setup, based on two layered bindings for STL collections. The reason is that our »External Tree Description« of object-like structures is comprised of recursively nested Record<GenNode> to represent "objects", and this representation is actually implemented internally based on two collections – one to hold the attributes and one to hold the children. So this special setup relies on implementation inside knowledge to apply structural changes to such a representation. There is an implicit convention that "objects" are to be spelled out by first giving the metadata, then enumerating the attributes (key-value properties) and finally the child elements located within the scope of this "object" node. This implicit convention is in accordance with the structure of our diff language – thus it is sufficient just to layer two collection bindings, together with suitable closures (lambdas) for layer selection, matching, most of which is already defined for collections of GenNode elements in general
Definition in file tree-mutator-gen-node-binding.hpp.
#include "lib/diff/gen-node.hpp"
#include "lib/diff/tree-mutator.hpp"
#include "lib/diff/tree-mutator-collection-binding.hpp"
#include <tuple>
Classes | |
class | ObjectTypeHandler< PAR > |
Helper to deal with the magic "object type" attribute. More... | |
Typedefs | |
using | Storage = RecordSetup< GenNode >::Storage |
Namespaces | |
lib | |
Implementation namespace for support and library code. | |