Lumiera
0.pre.03
»edit your freedom«
|
#include "lib/diff/tree-mutator.hpp"
Customisable intermediary to abstract mutating operations on arbitrary, hierarchical object-like data.
The TreeMutator exposes two distinct interfaces
Definition at line 136 of file tree-mutator.hpp.
Public Types | |
using | Handle = PlantingHandle< TreeMutator > |
Public Member Functions | |
TreeMutator (TreeMutator &&)=default | |
virtual | ~TreeMutator () |
this is an interface More... | |
virtual bool | accept_until (GenNode const &spec) |
repeatedly accept, until after the designated location | |
virtual bool | acceptSrc (GenNode const &) |
accept existing element, when matching the given spec | |
virtual bool | assignElm (GenNode const &) |
locate the designated target element (must be already accepted into the target sequence). More... | |
virtual bool | completeScope () |
ensure the scope addressed by this TreeMutator was processed and exhausted without mismatch More... | |
virtual bool | findSrc (GenNode const &) |
locate designated element and accept it at current position | |
virtual bool | hasSrc () |
virtual void | init () |
initialisation immediately before start of diff application More... | |
virtual bool | injectNew (GenNode const &) |
establish new element at current position More... | |
virtual bool | matchSrc (GenNode const &) |
ensure the next source element matches with given spec | |
virtual bool | mutateChild (GenNode const &, Handle) |
locate the designated target element and build a suitable sub-mutator for this element into the provided target buffer More... | |
virtual void | skipSrc (GenNode const &) |
skip next src element and advance abstract source position. More... | |
Static Public Member Functions | |
static Builder< TreeMutator > | build () |
DSL: start building a custom adapted tree mutator, where the operations are tied by closures or wrappers into the current implementation context. | |
Additional Inherited Members | |
Private Member Functions inherited from MoveOnly | |
MoveOnly (MoveOnly &&)=default | |
MoveOnly (MoveOnly const &)=delete | |
MoveOnly & | operator= (MoveOnly &&)=delete |
MoveOnly & | operator= (MoveOnly const &)=delete |
|
virtual |
|
inlinevirtual |
initialisation immediately before start of diff application
Definition at line 158 of file tree-mutator.hpp.
|
inlinevirtual |
establish new element at current position
true
when successfully inserted something Definition at line 170 of file tree-mutator.hpp.
|
inlinevirtual |
skip next src element and advance abstract source position.
The argument shall be used to determine applicability
del
verb and the skip
verb. Since the latter discards garbage left back by find
we must not touch the contents, to prevent a SEGFAULT. Thus skipSrc
can not match and thus can not return anything. Consequently the del
implementation has to use matchSrc
explicitly, and the latter must invoke the "layer selector" prior to performing the local match. Definition at line 195 of file tree-mutator.hpp.
|
inlinevirtual |
locate the designated target element (must be already accepted into the target sequence).
Perform an assignment with the given payload value
when | assignment fails (typically error::Logic) |
Definition at line 231 of file tree-mutator.hpp.
locate the designated target element and build a suitable sub-mutator for this element into the provided target buffer
error::Fatal | when buffer is insufficient |
false
when unable to locate the target Definition at line 246 of file tree-mutator.hpp.
|
inlinevirtual |
ensure the scope addressed by this TreeMutator was processed and exhausted without mismatch
true
when all "open ends" are closed and no pending work remains to be done. Definition at line 257 of file tree-mutator.hpp.