From 6cf97f24783d83c229a864e0c769f1c828e1928f Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Fri, 4 Mar 2016 21:26:25 +0100 Subject: [PATCH] forward operations to test/dummy onion layer ...first round of implementation happens here --- src/lib/diff/test-mutation-target.hpp | 32 +++++++++++++++++++ src/lib/diff/tree-mutator.hpp | 26 +++++++++------ .../diff/tree-manipulation-binding-test.cpp | 1 + 3 files changed, 50 insertions(+), 9 deletions(-) diff --git a/src/lib/diff/test-mutation-target.hpp b/src/lib/diff/test-mutation-target.hpp index d4b01c092..5866e35db 100644 --- a/src/lib/diff/test-mutation-target.hpp +++ b/src/lib/diff/test-mutation-target.hpp @@ -296,6 +296,13 @@ namespace diff{ { /* ==== re-Implementation of the operation API ==== */ + + /** skip next src element and advance abstract source position */ + virtual void + skipSrc () + { + UNIMPLEMENTED(); + } /** record in the test taget * that a new child element is @@ -307,6 +314,31 @@ namespace diff{ : renderChild(n)); } + /** ensure the next source element matches with given spec */ + virtual bool + matchSrc (GenNode const&) + { + UNIMPLEMENTED(); + return false; + } + + /** accept existing element, when matching the given spec */ + virtual bool + acceptSrc (GenNode const&) + { + UNIMPLEMENTED(); + return false; + } + + /** locate designated element and accept it at current position */ + virtual bool + findSrc (GenNode const&) + { + UNIMPLEMENTED(); + return false; + } + + TestWireTap(TestMutationTarget& dummy, PAR const& chain) : PAR(chain) , target_(dummy) diff --git a/src/lib/diff/tree-mutator.hpp b/src/lib/diff/tree-mutator.hpp index de919f96d..c1c80641a 100644 --- a/src/lib/diff/tree-mutator.hpp +++ b/src/lib/diff/tree-mutator.hpp @@ -121,34 +121,42 @@ namespace diff{ /* ==== operation API ==== */ + /** skip next src element and advance abstract source position */ virtual void skipSrc () { - UNIMPLEMENTED("skip next src element and advance abstract source position"); + // do nothing by default } + /** establish new element at current position */ virtual void - injectNew (GenNode const& n) + injectNew (GenNode const&) { - UNIMPLEMENTED("establish new child node at current position"); + // do nothing by default } + /** ensure the next source element matches with given spec */ virtual bool - matchSrc (GenNode const& n) + matchSrc (GenNode const&) { - UNIMPLEMENTED("ensure the next source element matches with given spec"); + // do nothing by default + return false; } + /** accept existing element, when matching the given spec */ virtual bool - acceptSrc (GenNode const& n) + acceptSrc (GenNode const&) { - UNIMPLEMENTED("accept existing element, when matching the given spec"); + // do nothing by default + return false; } + /** locate designated element and accept it at current position */ virtual bool - findSrc (GenNode const& n) + findSrc (GenNode const&) { - UNIMPLEMENTED("locate designated element and accept it at current position"); + // do nothing by default + return false; } virtual TreeMutator& diff --git a/tests/library/diff/tree-manipulation-binding-test.cpp b/tests/library/diff/tree-manipulation-binding-test.cpp index 92a2ff3f4..16f7fad97 100644 --- a/tests/library/diff/tree-manipulation-binding-test.cpp +++ b/tests/library/diff/tree-manipulation-binding-test.cpp @@ -141,6 +141,7 @@ namespace test{ cout << "Content after population; " << join(target) <