Lumiera  0.pre.03
»edityourfreedom«
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
diff-mutable.hpp File Reference

Go to the source code of this file.

Description

Abstraction or descriptor interface for a data structure exposing the ability for mutation by receiving diff messages.

Differences and changes on such data structures can be specified in the form of a "linearised diff language". Such a diff can be represented as a sequence of tokens, describing the manipulations necessary to effect the desired change. While, conceptually, such a diff is drawn against a generic tree like data description (actually based on diff::Record<GenNode>), with the help of a customisable intermediary binding layer, it is possible to apply such diff messages onto data structures otherwise not further disclosed. For this to work, the target data structure itself must offer the ability to construct such a suitable intermediary binding layer. This interface declares and offers this ability.

A data structure exposing this interface in one way or the other (which might be through the help of an ADL bound free function) thus offers some kind of closure, which, when invoked, will build a concrete TreeMutator implementation into the given working buffer. Obviously, this TreeMutator is then somehow opaquely wired to the data structure so to be able to invoke transforming operations on this target data. Here, the TreeMutator interface defines the primitive operations necessary to apply a conforming diff message onto this otherwise private data structure. Based on such a setup, client code may create a DiffApplicator to embody this custom TreeMutator, which in the end allows to consume diff messages, thereby transforming and mutating the target data structure without the need to know any internal details.

See also
diff-language.hpp
tree-diff-application.hpp
diff-virtualised-application-test.cpp
TreeMutator

Definition in file diff-mutable.hpp.

Classes

class  DiffMutable
 Marker or capability interface: an otherwise not further disclosed data structure, which can be transformed through "tree diff messages". More...
 

Namespaces

 lib
 Implementation namespace for support and library code.
 
 lib::diff