Lumiera  0.pre.03
»edit your freedom«
tree-mutator-gen-node-binding.hpp File Reference

Go to the source code of this file.

Description

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

Note
the header tree-mutator-collection-binding.hpp was split off for sake of readability and is included automatically from bottom of tree-mutator.hpp
See also
_DefaultBinding<GenNode>
tree-mutator-collection-binding.hpp
tree-mutator-test.cpp
TreeMutator::build()

Definition in file tree-mutator-gen-node-binding.hpp.

Classes

class  ObjectTypeHandler< PAR >
 Helper to deal with the magic "object type" attribute. More...
 

Typedefs

using Storage = RecordSetup< GenNode >::Storage
 

Functions

Storage & accessAttribs (Rec::Mutator &targetTree)
 
Storage & accessChildren (Rec::Mutator &targetTree)
 
template<class MUT >
Builder< ObjectTypeHandler< MUT > > filterObjectTypeAttribute (Rec::Mutator &targetTree, Builder< MUT > &&chain)
 

Namespaces

 lib
 Implementation namespace for support and library code.