124 #ifndef LIB_DIFF_TREE_DIFF_APPLICATION_H 125 #define LIB_DIFF_TREE_DIFF_APPLICATION_H 154 virtual void clear() =0;
156 virtual size_t depth()
const =0;
169 template<
size_t buffSiz>
174 using MutatorStack = std::stack<MutatorBuffer>;
189 throw error::Logic(
"Attempt to access the current scope " 190 "without establishing a root scope beforehand." 191 , error::LUMIERA_ERROR_LIFECYCLE);
192 return *scopes_.top();
203 return placementHandle;
210 REQUIRE (0 < depth(),
"attempt to return beyond root scope");
211 return *scopes_.top();
217 while (0 < scopes_.size())
220 ENSURE (scopes_.empty());
227 return scopes_.size();
275 void __expect_further_elements (
GenNode const& elm);
276 void __fail_not_found (
GenNode const& elm);
277 void __expect_end_of_scope (
GenNode::ID const& idi);
278 void __expect_valid_parent_scope (
GenNode::ID const& idi);
285 virtual void ins (
GenNode const& n)
override;
286 virtual void del (
GenNode const& n)
override;
287 virtual void pick (
GenNode const& n)
override;
288 virtual void skip (
GenNode const& n)
override;
289 virtual void find (
GenNode const& n)
override;
294 virtual void after(
GenNode const& n)
override;
295 virtual void set (
GenNode const& n)
override;
296 virtual void mut (
GenNode const& n)
override;
297 virtual void emu (
GenNode const& n)
override;
302 : treeMutator_(
nullptr)
303 , scopeManger_(
nullptr)
353 return buffHandle.get();
365 initDiffApplication()
370 buildMutator(target)->init();
371 TreeDiffMutatorBinding::scopeManger_ = &scopes_;
372 TreeDiffMutatorBinding::treeMutator_ = &scopes_.currentScope();
373 REQUIRE (this->treeMutator_);
377 completeDiffApplication()
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;
Interpreter interface to define the operations ("verbs"), which describe differences or changes in hi...
Abstraction or descriptor interface for a data structure exposing the ability for mutation by receivi...
virtual TreeMutator::Handle openScope()
virtual void buildMutator(TreeMutator::Handle buffer)=0
build a custom implementation of the TreeMutator interface, suitably wired to cause appropriate chang...
virtual TreeMutator::Handle openScope()=0
virtual ~ScopeManager()
this is an interface
Any copy and copy construction prohibited.
inline string literal This is a marker type to indicate that
A front-end for using printf-style formatting.
Implementation namespace for support and library code.
Definitions and Properties to guide automated tree mutator binding.
Derived specific exceptions within Lumiera's exception hierarchy.
SUB & emplace(SUB &&implementation)
move-construct an instance of a subclass into the opaque buffer
A handle to allow for safe »remote implantation« of an unknown subclass into a given opaque InPlaceBu...
Typical standard implementation of the ScopeManager.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
MutatorStack scopes_
Allocate Heap Storage for nested TreeMutator(s)
Generic building block for tree shaped (meta)data structures.
Extension point: define how a specific diff language can be applied to elements in a concrete contain...
Management interface to deal with storage for TreeMutators dedicated to nested scopes.
A token language to represent structural changes in a tree like hierarchical data structure...
Customisable intermediary to abstract generic tree mutation operations.
Buffer to place and maintain an object instance privately within another object.
TreeDiffTraits< TAR >::Ret mutatorBinding(TAR &subject)
public access point to this configuration machinery
generic data element node within a tree
Marker or capability interface: an otherwise not further disclosed data structure, which can be transformed through "tree diff messages".
Customisable intermediary to abstract mutating operations on arbitrary, hierarchical object-like data...
Implementation of the tree-diff-language to work on arbitrary tree-like data.