From c8ad698ac4793eeb24fd1f16fd34bc1731826b7d Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sun, 2 Oct 2016 23:51:45 +0200 Subject: [PATCH] MutationMessage: limit to treating of gui::model::Tangible the generic typing to DiffMutatble does not make much sense, since the desired implementation within gui::ctrl::Nexus is bound to work on Tangibles only, since that is what the UI-Bus stores in the routing table --- src/gui/ctrl/bus-term.hpp | 3 ++- src/gui/ctrl/mutation-message.hpp | 14 +++++++------- src/gui/ctrl/nexus.hpp | 1 + src/gui/model/tangible.hpp | 1 + tests/gui/abstract-tangible-test.cpp | 1 + tests/gui/test/test-nexus.cpp | 1 + wiki/thinkPad.ichthyo.mm | 24 ++++++++++++++++-------- 7 files changed, 29 insertions(+), 16 deletions(-) diff --git a/src/gui/ctrl/bus-term.hpp b/src/gui/ctrl/bus-term.hpp index 58cf21a40..38e21b4ef 100644 --- a/src/gui/ctrl/bus-term.hpp +++ b/src/gui/ctrl/bus-term.hpp @@ -55,7 +55,6 @@ //#include "lib/util.hpp" #include "lib/idi/entry-id.hpp" #include "lib/diff/gen-node.hpp" -#include "gui/ctrl/mutation-message.hpp" #include #include @@ -68,6 +67,8 @@ namespace model { } namespace ctrl{ + class MutationMessage; + // using lib::HashVal; // using util::isnil; using lib::idi::EntryID; diff --git a/src/gui/ctrl/mutation-message.hpp b/src/gui/ctrl/mutation-message.hpp index 08e0ecd4c..da9901a98 100644 --- a/src/gui/ctrl/mutation-message.hpp +++ b/src/gui/ctrl/mutation-message.hpp @@ -51,8 +51,8 @@ #include "lib/error.hpp" #include "lib/opaque-holder.hpp" -#include "lib/diff/diff-mutable.hpp" #include "lib/diff/tree-diff-application.hpp" +#include "gui/model/tangible.hpp" #include "lib/format-util.hpp" #include @@ -66,16 +66,16 @@ namespace ctrl{ namespace diff_msg { // implementation details for embedding concrete diff messages - using lib::diff::DiffMutable; using lib::diff::DiffApplicator; + using model::Tangible; using std::move; class Holder { public: virtual ~Holder(); ///< this is an interface - virtual void applyTo (DiffMutable&) =0; - virtual string describe() const =0; + virtual void applyTo (Tangible&) =0; + virtual string describe() const =0; }; template @@ -85,9 +85,9 @@ namespace ctrl{ DIFF diff_; virtual void - applyTo (DiffMutable& target) override + applyTo (Tangible& target) override { - DiffApplicator applicator(target); + DiffApplicator applicator(target); applicator.consume (move(diff_)); } @@ -143,7 +143,7 @@ namespace ctrl{ { } void - applyTo (lib::diff::DiffMutable& target) + applyTo (model::Tangible& target) { access()->applyTo(target); } diff --git a/src/gui/ctrl/nexus.hpp b/src/gui/ctrl/nexus.hpp index dc5757c22..153c43968 100644 --- a/src/gui/ctrl/nexus.hpp +++ b/src/gui/ctrl/nexus.hpp @@ -42,6 +42,7 @@ //#include "lib/idi/entry-id.hpp" #include "lib/idi/genfunc.hpp" #include "gui/ctrl/bus-term.hpp" +#include "gui/ctrl/mutation-message.hpp" #include "gui/model/tangible.hpp" //#include "lib/util.hpp" //#include "gui/model/tangible.hpp" diff --git a/src/gui/model/tangible.hpp b/src/gui/model/tangible.hpp index 2110edc96..9ac8b196e 100644 --- a/src/gui/model/tangible.hpp +++ b/src/gui/model/tangible.hpp @@ -208,6 +208,7 @@ namespace model { virtual void doFlash() =0; virtual void doMark(GenNode const&) =0; + public: virtual void buildMutator (lib::diff::TreeMutator::Handle) =0; private: }; diff --git a/tests/gui/abstract-tangible-test.cpp b/tests/gui/abstract-tangible-test.cpp index a855f65b5..efdc79349 100644 --- a/tests/gui/abstract-tangible-test.cpp +++ b/tests/gui/abstract-tangible-test.cpp @@ -52,6 +52,7 @@ #include "test/test-nexus.hpp" #include "lib/idi/entry-id.hpp" #include "proc/control/command-def.hpp" +#include "gui/ctrl/mutation-message.hpp" #include "lib/iter-adapter-stl.hpp" #include "lib/diff/tree-diff.hpp" #include "lib/time/timevalue.hpp" diff --git a/tests/gui/test/test-nexus.cpp b/tests/gui/test/test-nexus.cpp index 9b9ff6ac0..8e22a0e63 100644 --- a/tests/gui/test/test-nexus.cpp +++ b/tests/gui/test/test-nexus.cpp @@ -49,6 +49,7 @@ #include "test/test-nexus.hpp" #include "lib/test/event-log.hpp" #include "gui/ctrl/nexus.hpp" +#include "gui/ctrl/mutation-message.hpp" #include "gui/interact/state-recorder.hpp" #include "proc/control/command.hpp" #include "lib/diff/gen-node.hpp" diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index cd9de3f0e..cb7d1a09d 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -5585,14 +5585,18 @@ - - - + + + + + + + - + - + @@ -5617,7 +5621,7 @@ - + @@ -5643,10 +5647,14 @@ - + - + + + + +