Lumiera  0.pre.03
»edit your freedom«
tree-diff-traits.hpp File Reference

Go to the source code of this file.

Description

Definitions and Properties to guide automated tree mutator binding.

Decision how to access the target structure and how to construct a suitable TreeMutator as attached to this opaque target data.

In a nutshell, if some private data structure wants to receive mutation diff messages...

  • it must either implement the interface DiffMutable
  • or provide the extension point void buildMutator(TreeMutator::Handle) Additionally, when the size of the custom TreeMutator object exceeds some hard wired limit (200 bytes), then the target type also needs to define the extension point size_t treeMutatorSize(TargetType)

All of this boils down to somewhere / somehow using the TreeMutator::Builder (a DSL API) to construct a custom binding, which allows to talk to our private data structure through the TreeMutator interface.

See also
DiffComplexApplication_test
DiffTreeApplication_test
DiffListApplication_test
GenNode_test
tree-diff.hpp

Definition in file tree-diff-traits.hpp.

#include "lib/diff/tree-mutator.hpp"
#include "lib/diff/diff-mutable.hpp"
#include "lib/null-value.hpp"
#include "lib/util.hpp"
#include <utility>
#include <stack>

Classes

struct  defines_custom_BufferSize< T >
 
class  exposes_MutatorBuilder< T >
 helper to detect presence of a TreeMutator builder function More...
 
struct  TreeDiffTraits< TAR, SEL >
 
struct  TreeDiffTraits< TAR, enable_if< exposes_MutatorBuilder< TAR > > >
 
struct  TreeDiffTraits< TAR, enable_if< is_base_of< DiffMutable, TAR > > >
 
struct  TreeMutatorSizeTraits< TAR, SEL >
 Heuristics to guide the allocation for nested TreeMutator. More...
 
struct  TreeMutatorSizeTraits< TAR, enable_if< defines_custom_BufferSize< TAR > > >
 
class  TreeDiffTraits< TAR, enable_if< exposes_MutatorBuilder< TAR > > >::Wrapper
 

Functions

template<typename T >
constexpr T * getSelector ()
 
template<class TAR >
TreeDiffTraits< TAR >::Ret mutatorBinding (TAR &subject)
 public access point to this configuration machinery More...
 
constexpr size_t treeMutatorSize (...)
 

Namespaces

 lib
 Implementation namespace for support and library code.
 

Function Documentation

◆ mutatorBinding()

TreeDiffTraits<TAR>::Ret lib::diff::mutatorBinding ( TAR &  subject)

public access point to this configuration machinery

Returns
depending on the circumstances, either a direct reference to DiffMutable, or a transient functor object implementing the DiffMutable interface
Warning
beware of dangling references! either use this call immediately inline, or (preferably) use an auto typed variable to hold the return value in local scope as long as necessary

Definition at line 213 of file tree-diff-traits.hpp.

References lib::diff::mutatorBinding().

Referenced by lib::diff::mutatorBinding().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: