Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
lib::diff Namespace Reference

Namespaces

namespace  anonymous_namespace{mutation-message.hpp}
 
namespace  anonymous_namespace{test-mutation-target.hpp}
 
namespace  anonymous_namespace{tree-mutator-attribute-binding.hpp}
 
namespace  anonymous_namespace{tree-mutator-collection-binding.hpp}
 
namespace  anonymous_namespace{tree-mutator-diffmutable-binding.hpp}
 
namespace  anonymous_namespace{tree-mutator-gen-node-binding.hpp}
 
namespace  anonymous_namespace{tree-mutator-listener-binding.hpp}
 
namespace  anonymous_namespace{tree-mutator-noop-binding.hpp}
 
namespace  anonymous_namespace{tree-mutator.hpp}
 
namespace  test
 

Typedefs

template<class I , typename E >
using HandlerFun = void(I::*)(E const &)
 
using Rec = Record< GenNode >
 
using RecRef = RecordRef< GenNode >
 
using MakeRec = Rec::Mutator
 
using DataValues = meta::Types< int,int64_t,short,char,bool,double,string,time::Time,time::Offset,time::Duration,time::TimeSpan,hash::LuidH,RecRef,Rec >
 
using DiffStep = TreeDiffLanguage::DiffStep
 
using DiffSource = IterSource< DiffStep >
 

Classes

struct  can_wrap_in_GenNode
 metafunction to detect types able to be wrapped into a GenNode. More...
 
class  DataCap
 
struct  defines_custom_BufferSize
 
class  DiffApplicationStrategy
 Extension point: define how a specific diff language can be applied to elements in a concrete container. More...
 
class  DiffApplicationStrategy< TAR, enable_if< TreeDiffTraits< TAR > > >
 Interpreter for the tree-diff-language to work on arbitrary opaque target data structures. More...
 
class  DiffApplicationStrategy< vector< E, ARGS... > >
 concrete strategy to apply a list diff to a target sequence given as vector. More...
 
class  DiffApplicator
 generic builder to apply a diff description to a given target data structure. More...
 
class  DiffDetector
 Detect and describe changes in a monitored data sequence. More...
 
struct  DiffLanguage
 Definition frame for a language to describe differences in data structures. More...
 
class  DiffMutable
 Marker or capability interface: an otherwise not further disclosed data structure, which can be transformed through "tree diff messages". More...
 
struct  DiffStepBuilder
 generator to produce specific language tokens More...
 
class  exposes_MutatorBuilder
 helper to detect presence of a TreeMutator builder function More...
 
struct  GenNode
 generic data element node within a tree More...
 
class  IndexTable
 data snapshot and lookup table More...
 
struct  InterpreterScheme
 < base case is to expect typedef I::Val More...
 
struct  InterpreterScheme< HandlerFun< I, E > >
 < alternatively derive value and interpreter from a Handler binding More...
 
struct  InterpreterScheme< IP< E > >
 < alternatively, the interpreter value type can be templated More...
 
class  ListDiffInterpreter
 Interpreter interface to define the operations ("verbs"), which describe differences or changes in a given list of data elements. More...
 
struct  ListDiffLanguage
 
struct  MutationMessage
 Opaque message to effect a structural change on a target, which is likewise only known in an abstract way, as being specifically structured. More...
 
class  Record
 object-like record of data. More...
 
class  RecordRef
 wrapped record reference. More...
 
struct  RecordSetup
 
struct  RecordSetup< GenNode >
 Define actual data storage and access types used. More...
 
struct  RecordSetup< string >
 Type configuration (extension point). More...
 
struct  Ref
 Constructor for a specially crafted 'ref GenNode'. More...
 
class  ScopeManager
 Management interface to deal with storage for TreeMutators dedicated to nested scopes. More...
 
class  StackScopeManager
 Typical standard implementation of the ScopeManager. More...
 
class  TestMutationTarget
 Test adapter to watch and verify how the TreeMutator binds to custom tree data structures. More...
 
class  TreeDiffInterpreter
 Interpreter interface to define the operations ("verbs"), which describe differences or changes in hierarchical data structure. More...
 
struct  TreeDiffLanguage
 
class  TreeDiffMutatorBinding
 Implementation of the tree-diff-language to work on arbitrary tree-like data. More...
 
struct  TreeDiffTraits
 
struct  TreeDiffTraits< TAR, enable_if< exposes_MutatorBuilder< TAR > > >
 
struct  TreeDiffTraits< TAR, enable_if< is_base_of< DiffMutable, TAR > > >
 
class  TreeMutator
 Customisable intermediary to abstract mutating operations on arbitrary, hierarchical object-like data. More...
 
struct  TreeMutatorSizeTraits
 Heuristics to guide the allocation for nested TreeMutator. More...
 
struct  TreeMutatorSizeTraits< TAR, enable_if< defines_custom_BufferSize< TAR > > >
 

Functions

template<class H >
DiffStepBuilder< typename InterpreterScheme< H >::Interpreter > diffTokenBuilder (H handlerFun, Literal id)
 set up a diff language token generator, based on the specific handler function given.
 
string renderCompact (Rec const &rec)
 compact textual representation of a Record<GenNode> (»object«).
 
string renderCompact (RecRef const &ref)
 
string renderCompact (GenNode const &)
 compact textual representation of a GenNode tree
 
template<typename VAL >
Record< VAL >::Mutator & mutateInPlace (Record< VAL > &record_to_mutate)
 open an existing record for modification in-place.
 
constexpr size_t treeMutatorSize (...)
 
template<typename T >
constexpr T * getSelector ()
 
template<class TAR >
TreeDiffTraits< TAR >::Ret mutatorBinding (TAR &subject)
 public access point to this configuration machinery
 
 LAUNCHER (DiffListGeneration_test, "unit common")
 Register this test class...
 

Typedef Documentation

◆ HandlerFun

template<class I , typename E >
using HandlerFun = void (I::*) (E const&)

Definition at line 101 of file diff-language.hpp.

◆ Rec

using Rec = Record<GenNode>

Definition at line 133 of file gen-node.hpp.

◆ RecRef

Definition at line 134 of file gen-node.hpp.

◆ MakeRec

Definition at line 135 of file gen-node.hpp.

◆ DataValues

using DataValues = meta::Types<int ,int64_t ,short ,char ,bool ,double ,string ,time::Time ,time::Offset ,time::Duration ,time::TimeSpan ,hash::LuidH ,RecRef ,Rec >

Definition at line 136 of file gen-node.hpp.

◆ DiffStep

using DiffStep = TreeDiffLanguage::DiffStep

Definition at line 106 of file mutation-message.hpp.

◆ DiffSource

Definition at line 107 of file mutation-message.hpp.


Class Documentation

◆ lib::diff::DiffApplicationStrategy

class lib::diff::DiffApplicationStrategy
+ Collaboration diagram for DiffApplicationStrategy< TAR, SEL >:

◆ lib::diff::InterpreterScheme

struct lib::diff::InterpreterScheme
Class Members
typedef I Interpreter
typedef Val Val
typedef HandlerFun< I, Val > Handler
+ Collaboration diagram for InterpreterScheme< I >:

◆ lib::diff::InterpreterScheme< HandlerFun< I, E > >

struct lib::diff::InterpreterScheme< HandlerFun< I, E > >
Class Members
typedef E Val
typedef I Interpreter
typedef HandlerFun< I, E > Handler
+ Collaboration diagram for InterpreterScheme< HandlerFun< I, E > >:

◆ lib::diff::InterpreterScheme< IP< E > >

struct lib::diff::InterpreterScheme< IP< E > >
Class Members
typedef E Val
typedef IP< E > Interpreter
typedef HandlerFun< Interpreter, Val > Handler
+ Collaboration diagram for InterpreterScheme< IP< E > >:

◆ lib::diff::RecordSetup

struct lib::diff::RecordSetup
+ Collaboration diagram for RecordSetup< VAL >:

◆ lib::diff::RecordSetup< GenNode >

struct lib::diff::RecordSetup< GenNode >
Class Members
typedef vector< GenNode > Storage
typedef const_iterator ElmIter
typedef GenNode const & Access using const reference data access relevant for handling large subtrees
+ Collaboration diagram for RecordSetup< GenNode >:

◆ lib::diff::RecordSetup< string >

struct lib::diff::RecordSetup< string >
Class Members
typedef vector< string > Storage
typedef const_iterator ElmIter
typedef string Access data access by value copy
+ Collaboration diagram for RecordSetup< string >:

Function Documentation

◆ diffTokenBuilder()

template<class H >
DiffStepBuilder< typename InterpreterScheme< H >::Interpreter > diffTokenBuilder ( handlerFun,
Literal  id 
)
inline

set up a diff language token generator, based on the specific handler function given.

This generator will produce tokens, wrapping concrete content elements of type E. In the end, the purpose is to send a sequence of such tokens around, to feed them to a consumer, which implements the Interpreter interface of the diff language. E.g. this consumer might apply the diff.

Definition at line 218 of file diff-language.hpp.

◆ renderCompact() [1/3]

string renderCompact ( Rec const &  rec)

compact textual representation of a Record<GenNode> (»object«).

Definition at line 290 of file gen-node.cpp.

References Record< VAL >::attribs(), Record< VAL >::getType(), renderCompact(), Record< VAL >::scope(), lib::transformIterator(), and Record< VAL >::TYPE_NIL.

Referenced by renderCompact(), renderCompact(), renderCompact(), GenNode_test::sequenceIteration(), and GenNode_test::simpleUsage().

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

◆ renderCompact() [2/3]

string renderCompact ( RecRef const &  ref)

Definition at line 308 of file gen-node.cpp.

References RecordRef< VAL >::empty(), RecordRef< VAL >::get(), and renderCompact().

+ Here is the call graph for this function:

◆ renderCompact() [3/3]

string renderCompact ( GenNode const &  node)

compact textual representation of a GenNode tree

Remarks
presentation is oriented towards readability
  • numbers are slightly rounded (see util::showDouble() )
  • time values are displayed timecode-like
  • nested scopes are displayed recursively, enclosed in curly brackets
See also
text-template-gen-node-binding.hpp

Definition at line 321 of file gen-node.cpp.

References RENDER_CONTENT, renderCompact(), and util::showHash().

+ Here is the call graph for this function:

◆ mutateInPlace()

template<typename VAL >
Record< VAL >::Mutator & mutateInPlace ( Record< VAL > &  record_to_mutate)
inline

open an existing record for modification in-place.

Warning
this function undermines the immutability of Record
Remarks
exploits the specific and known memory layout of Rec::Mutator. This trickery is necessary to avoid copying a large and possibly nested object tree; this happens when applying a diff, when recursively descending into nested child objects.
Todo:
do we have a design mismatch here?? /////////////////////////////////////////TICKET #970
See also
tree-diff-application.hpp

Definition at line 599 of file record.hpp.

◆ treeMutatorSize()

constexpr size_t treeMutatorSize (   ...)
constexpr
Parameters
...fallback to detect absence of a custom definition

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

◆ getSelector()

template<typename T >
constexpr T * getSelector ( )
constexpr

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

◆ mutatorBinding()

template<class TAR >
TreeDiffTraits< TAR >::Ret 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 204 of file tree-diff-traits.hpp.

Referenced by DiffApplicationStrategy< TAR, enable_if< TreeDiffTraits< TAR > > >::initDiffApplication().

+ Here is the caller graph for this function:

◆ LAUNCHER()

LAUNCHER ( DiffListGeneration_test  ,
"unit common"   
)

Register this test class...