From a54990de7c3c57a61b40647e5831dde6a99f3237 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sat, 10 Dec 2016 01:21:08 +0100 Subject: [PATCH] define the plan for some scaffolding to drive the UI-Session connection (#1042) ...following a similar idea as employed when developing the Player-Engine connection --- src/gui/ctrl/nexus.hpp | 4 + .../session/dummy-session-connection.cpp | 78 +++++++++++++++ .../session/dummy-session-connection.hpp | 98 +++++++++++++++++++ .../mobject/session/sess-manager-impl.cpp | 2 +- src/proc/play/dummy-play-connection.hpp | 10 +- tests/43session.tests | 5 + .../session/dummy-session-connection-test.cpp | 87 ++++++++++++++++ wiki/thinkPad.ichthyo.mm | 55 ++++++++++- 8 files changed, 335 insertions(+), 4 deletions(-) create mode 100644 src/proc/mobject/session/dummy-session-connection.cpp create mode 100644 src/proc/mobject/session/dummy-session-connection.hpp create mode 100644 tests/core/proc/mobject/session/dummy-session-connection-test.cpp diff --git a/src/gui/ctrl/nexus.hpp b/src/gui/ctrl/nexus.hpp index c43b80b16..cae1f5738 100644 --- a/src/gui/ctrl/nexus.hpp +++ b/src/gui/ctrl/nexus.hpp @@ -76,6 +76,10 @@ namespace ctrl{ * defining special handling overrides for _all other kinds of messages_. * The purpose of the Nexus is to route all these _other kinds of messages._ * + * Thus, the "uplink", which is in fact the CoreService, is left to handle + * - the *`act`* messages (command invocation) + * - the *`mark`* messages (upstream state change notification) + * * @todo write type comment */ class Nexus diff --git a/src/proc/mobject/session/dummy-session-connection.cpp b/src/proc/mobject/session/dummy-session-connection.cpp new file mode 100644 index 000000000..a8025f884 --- /dev/null +++ b/src/proc/mobject/session/dummy-session-connection.cpp @@ -0,0 +1,78 @@ +/* + DummySessionConnection - scaffolding placeholder to drive the GUI-Session connection + + Copyright (C) Lumiera.org + 2016, Hermann Vosseler + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +* *****************************************************/ + + +/** @file dummy-session-connection.cpp + ** Implementation details to build some scaffolding for UI<-->Session integration. + ** In this translation unit, actually a singleton will be instantiated, whenever + ** some other part of the application (or some unit test) needs backing by a faked + ** session with... + ** - some session content + ** - commands to be invoked + ** + ** @todo WIP as of 12/2016 ///////////////////////TICKET #1042 + ** + ** @see DummySessionConnection_test + ** + */ + +#include "lib/util.hpp" +//#include "lib/symbol.hpp" +//#include "include/logging.h" +#include "proc/mobject/session/dummy-session-connection.hpp" + +//#include +#include +#include + +using std::map; +using std::string; + +using util::contains; +using util::isnil; + +namespace proc { +namespace mobject { +namespace session { + + namespace { //Implementation details.... + + } //(End)Implementation details.... + + DummySessionConnection::DummySessionConnection ( ) + { + } + + DummySessionConnection::~DummySessionConnection ( ) + { + // ////TODO Auto-generated destructor stub + } + + + /** + * + * @param id + * @return + */ + + +}}} // namespace proc::mobject::session diff --git a/src/proc/mobject/session/dummy-session-connection.hpp b/src/proc/mobject/session/dummy-session-connection.hpp new file mode 100644 index 000000000..116da0c70 --- /dev/null +++ b/src/proc/mobject/session/dummy-session-connection.hpp @@ -0,0 +1,98 @@ +/* + dummy-session-connection.hpp - scaffolding placeholder to drive the GUI-Session connection + + Copyright (C) Lumiera.org + 2016, Hermann Vosseler + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +*/ + +/** @file dummy-session-connection.hpp + ** Dummy and scaffolding to help development of the UI - Session connection. + ** This singleton service can be accessed as placeholder to stand-in for all those + ** parts of the application, which are to defined in the very attempt this placeholder + ** is used for... + ** - it can fake some session content + ** - it may expose some fake command implementations + ** - and all this together with suitable diagnostic facilities + ** + ** The plan is to push this helper along, as we proceed from the UI down towards the session. + ** In the end, this placeholder service may be inserted into the session implementation proper, + ** until we have the ability to load a persistent session from storage. + ** + ** @todo WIP as of 12/2016 //////////////////////////////////////////////////////////////////////TICKET #1042 + ** + ** @see ui-bus.hpp + ** @see dummy-session-connection.cpp implementation + ** + */ + +#ifndef PROC_MOBJECT_SESSION_DUMMY_SESSION_CONNECTION_H +#define PROC_MOBJECT_SESSION_DUMMY_SESSION_CONNECTION_H + +#include "lib/error.hpp" +#include "lib/hash-value.h" +//#include "lib/symbol.hpp" +#include "lib/util.hpp" + +#include +#include + +namespace proc { +namespace mobject { +namespace session { + + class LifecycleAdvisor; + + using lib::HashVal; + using util::isnil; + using std::string; + + /** + * Basic (abstracted) view of... + * + * @see SomeSystem + * @see DummySessionConnection_test + */ + class DummySessionConnection + { + string nothing_; + + public: + DummySessionConnection(); + + ~DummySessionConnection ( ); + + // using default copy/assignment + + /* == X interface for == */ + + /* == Adapter interface for == */ + +#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #1042 + void setSolution (string const& solution = "") + { + UNIMPLEMENTED ("tbw"); + if (isDeaf()) + this->transmogrify (solution); + } +#endif /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #1042 + }; + + + +}}} // namespace proc::mobject::session +#endif /*SRC_PROC_MOBJECT_SESSION_DUMMY_SESSION_CONNECTION_HPP_*/ diff --git a/src/proc/mobject/session/sess-manager-impl.cpp b/src/proc/mobject/session/sess-manager-impl.cpp index 4bdd00317..891daeb7a 100644 --- a/src/proc/mobject/session/sess-manager-impl.cpp +++ b/src/proc/mobject/session/sess-manager-impl.cpp @@ -103,7 +103,7 @@ namespace session { - /** @note Any session services get up into default configured state. + /** @note Any session services come up into default configured state. * After the swap, \c tmpS holds onto the old session, which * consequently should unwind on leaving this scope. */ void diff --git a/src/proc/play/dummy-play-connection.hpp b/src/proc/play/dummy-play-connection.hpp index 45ca8048a..81ac36b5e 100644 --- a/src/proc/play/dummy-play-connection.hpp +++ b/src/proc/play/dummy-play-connection.hpp @@ -63,7 +63,11 @@ ** ** The test support interface provides a test driver for performing a controlled ** playback or rendering for some time. Thus, a test routine may lock into a blocking wait, - ** to investigate results after the planned test sequence was performed. + ** to investigate results after the planned test sequence was performed. + ** + ** @todo this was invented in 2012 -- but development of the player subsystem stalled thereafter. + ** As of 2016, I still consider this design valid and intend to pick up development when + ** able to address this topic again. At the moment, the UI-Session connection is more urgent. ** ** @see lumiera::DummyPlayer ** @see gui::PlaybackController usage example @@ -216,7 +220,9 @@ namespace play { * allowing to start a data producing process while leaving out * various parts of the real engine implementation. The specific * mode of operation, suitable for various test scenarios, may be - * fine tuned by the strategy object defined as template parameter. + * fine tuned by the strategy object defined as template parameter. + * + * @todo not-yet-implemented as of 2016 -- but the design can be considered valid. */ template class DummyPlayConnection diff --git a/tests/43session.tests b/tests/43session.tests index 9713a2cc3..a8885dc2b 100644 --- a/tests/43session.tests +++ b/tests/43session.tests @@ -33,6 +33,11 @@ return: 0 END +PLANNED "Scaffolding to develop the UI-Session connection" DummySessionConnection_test < + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2 of + the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +* *****************************************************/ + +/** @file dummy-session-connection-test.cpp + ** + */ + +#include "lib/test/run.hpp" +#include "lib/util.hpp" + +#include "proc/mobject/session/dummy-session-connection.hpp" + +//#include +//#include +#include +#include + +//using boost::lexical_cast; +using util::contains; +using std::string; +//using std::cout; +//using std::endl; + +namespace proc { +namespace mobject { +namespace session { +namespace test { + + + namespace { // test fixture... + + } //(End) test fixture + + + /***********************************************************************//** + * @test verify scaffolding used to develop the actual connection between + * the UI, the UI-Bus, the core services in the UI and the Session. + * - weakness of WIP-WIP-WIP + * + * @see UiBus + * @see DummySessionConnection + */ + class DummySessionConnection_test + : public Test + { + + virtual void + run (Arg) + { + demonstrate_weakness (); + } + + /** @test demonstrate a serious weakness of + * When... + * + * This problem is especially dangerous when... + */ + void demonstrate_weakness ( ) + { + UNIMPLEMENTED("stop making sense..."); + } + + }; + + /** Register this test class... */ + LAUNCHER(DummySessionConnection_test, "unit session"); + +}}}} // namespace proc::mobject::session::test diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index fb9f149c6..ac9b236ae 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -9,9 +9,62 @@ + + + + + + + + + + - + + + + + + + + + + + + + + + + + + +

+ UI: GuiNotification +

+ + +
+
+ + + + + + +

+ Proc: SessionCommand +

+ + +
+ + + + + + +