124#ifndef LIB_DIFF_TREE_DIFF_APPLICATION_H
125#define LIB_DIFF_TREE_DIFF_APPLICATION_H
169 template<
size_t buffSiz>
189 throw error::Logic(
"Attempt to access the current scope "
190 "without establishing a root scope beforehand."
191 , error::LUMIERA_ERROR_LIFECYCLE);
203 return placementHandle;
210 REQUIRE (0 <
depth(),
"attempt to return beyond root scope");
353 return buffHandle.
get();
370 buildMutator(target)->init();
373 REQUIRE (this->treeMutator_);
379 if (not treeMutator_->completeScope())
380 throw error::State(
_Fmt(
"Unsettled content remains after diff application. "
381 "Top level == %s") % subject_
382 ,
LERR_(DIFF_STRUCTURE));
384 treeMutator_ =
nullptr;
Buffer to place and maintain an object instance privately within another object.
A handle to allow for safe »remote implantation« of an unknown subclass into a given opaque InPlaceBu...
SUB & emplace(SUB &&implementation)
move-construct an instance of a subclass into the opaque buffer
TreeMutator * buildMutator(DiffMutable &targetBinding)
void initDiffApplication()
void completeDiffApplication()
DiffApplicationStrategy(TAR &subject)
Marker or capability interface: an otherwise not further disclosed data structure,...
virtual void buildMutator(TreeMutator::Handle buffer)=0
build a custom implementation of the TreeMutator interface, suitably wired to cause appropriate chang...
Management interface to deal with storage for TreeMutators dedicated to nested scopes.
virtual TreeMutator::Handle openScope()=0
virtual size_t depth() const =0
virtual TreeMutator & closeScope()=0
virtual ~ScopeManager()
this is an interface
Typical standard implementation of the ScopeManager.
InPlaceBuffer< TreeMutator, buffSiz > MutatorBuffer
TreeMutator & currentScope() const
virtual size_t depth() const
virtual TreeMutator & closeScope()
virtual TreeMutator::Handle openScope()
MutatorStack scopes_
Allocate Heap Storage for nested TreeMutator(s)
std::stack< MutatorBuffer > MutatorStack
Interpreter interface to define the operations ("verbs"), which describe differences or changes in hi...
Implementation of the tree-diff-language to work on arbitrary tree-like data.
ScopeManager * scopeManger_
void __expect_further_elements(GenNode const &elm)
void __failMismatch(Literal oper, GenNode const &spec)
virtual void ins(GenNode const &n) override
virtual void mut(GenNode const &n) override
open nested scope to apply diff to child object
virtual void skip(GenNode const &n) override
virtual void set(GenNode const &n) override
assignment of changed value in one step
virtual void emu(GenNode const &n) override
finish and leave child object scope, return to parent
virtual void del(GenNode const &n) override
TreeMutator * treeMutator_
void __fail_not_found(GenNode const &elm)
virtual void find(GenNode const &n) override
virtual void pick(GenNode const &n) override
void __expect_valid_parent_scope(GenNode::ID const &idi)
void __expect_end_of_scope(GenNode::ID const &idi)
virtual void after(GenNode const &n) override
cue to a position behind the named node, thereby picking (accepting) all traversed elements into the ...
Customisable intermediary to abstract mutating operations on arbitrary, hierarchical object-like data...
Any copy and copy construction prohibited.
A front-end for using printf-style formatting.
Abstraction or descriptor interface for a data structure exposing the ability for mutation by receivi...
Generic building block for tree shaped (meta)data structures.
TreeDiffTraits< TAR >::Ret mutatorBinding(TAR &subject)
public access point to this configuration machinery
Extension point: define how a specific diff language can be applied to elements in a concrete contain...
Implementation namespace for support and library code.
LumieraError< LERR_(STATE)> State
LumieraError< LERR_(LOGIC)> Logic
OBJ * unConst(const OBJ *)
shortcut to save some typing when having to define const and non-const variants of member functions
generic data element node within a tree
Definitions and Properties to guide automated tree mutator binding.
A token language to represent structural changes in a tree like hierarchical data structure.
Customisable intermediary to abstract generic tree mutation operations.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...