diff --git a/src/gui/demo-gui-roundtrip.cpp b/src/gui/demo-gui-roundtrip.cpp new file mode 100644 index 000000000..77c217dc6 --- /dev/null +++ b/src/gui/demo-gui-roundtrip.cpp @@ -0,0 +1,112 @@ +/* + DemoGuiRoundtrip - placeholder to further progress of the GUI-Session connection + + Copyright (C) Lumiera.org + 2017, 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 demo-gui-roundtrip.cpp + ** Dummy and scaffolding to help development of the UI - Session connection. + ** The Goal is to establish a full messaging round-trip between UI and Proc-Layer + ** - a menu entry + ** - which issues a Proc-Command + ** - which in turn accesses the Notification-facade + ** - and sends a "mark" message towards some UI demo widget + ** - which in turn displays the mark text + ** + ** @todo WIP as of 8/20176 ////////////////////////////////////////////////////////////////////////TICKET #1099 + ** + ** @see CallQueue_test + ** @see notification-service.hpp + ** + */ + +#include "gui/gtk-base.hpp" + +#include "lib/error.hpp" +#include "lib/depend.hpp" +#include "gui/ui-bus.hpp" +#include "gui/ctrl/ui-manager.hpp" + +#include +#include + + + +//using lumiera::error::LUMIERA_ERROR_STATE; + +using std::string; + + +namespace gui { + + namespace { // implementation details + +//using util::isnil; + using std::string; + + } // (End) impl details + + + + + + /** + * Quick-n-dirty hack to establish a prototypic connection between Application Core and UI... + * + * @todo be commendable + * @todo don't misbehave + * + * @see SomeSystem + * @see CallQueue_test + */ + class DemoGuiRoundtrip + : boost::noncopyable + { + string nothing_; + + DemoGuiRoundtrip(); + ~DemoGuiRoundtrip(); + + friend class lib::DependencyFactory; + + public: + /** access point to set up the scaffolding. + * @internal this is a development helper and will be remoulded all the time. + */ + static lib::Depend instance; + + + /* == X interface for == */ + + /* == Adapter interface for == */ + +#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #1099 + void setSolution (string const& solution = "") + { + UNIMPLEMENTED ("tbw"); + if (isDeaf()) + this->transmogrify (solution); + } +#endif /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #1099 + }; + + + +} // namespace gui diff --git a/src/gui/model/tangible.hpp b/src/gui/model/tangible.hpp index 98148794d..4331035d3 100644 --- a/src/gui/model/tangible.hpp +++ b/src/gui/model/tangible.hpp @@ -56,9 +56,9 @@ ** ## the generic interface element API ** ** The _generic interface element_ based on [Tangible](\ref model::Tangible) covers a set of behaviour - ** common to all elements of the interface. This behaviour is targeted towards the _integration_ + ** common to all elements of the interface. This behaviour is targeted towards the _integration_ ** with the core application. Beyond that, there are still several concerns regarding presentation, - ** like a common styling. These are addressed the conventional way, through a common \ref UiManager. + ** like a common styling. These are addressed the conventional way, through a common \ref StyleManager. ** The following discussion focuses on the aspects of integration with the core. ** ** For one reason or another, any element in the UI can appear and go away. @@ -67,9 +67,9 @@ ** In regular, operative state, an interface element may initiate _actions_, which translate ** into _commands_ at the session interface. To complicate matters, there might be higher-level, ** cooperative _gestures_ implemented within the interface, leading to actions being formed - ** similar to sentences of spoken language, with the help of a FocusConcept -- this means, - ** in the end, there is a _subject_ and a _predicate_. These need to be bound in order to - ** form an _action_. And some interface element takes on or relates to the role of the + ** similar to sentences of spoken language, with the help of a _focus concept_ -- anyway, this + ** means, in the end, there is a _subject_ and a _predicate_. These need to be bound in order + ** to form an _action_. And some interface element takes on or relates to the role of the ** underlying, the subject, the **tangible element**. ** ** @todo Some actions are very common and can be represented by a shorthand. @@ -82,10 +82,10 @@ ** expanding and collapsing, moving by focus or manipulation of a similar presentation control. ** These manipulations in itself do not constitute an action. But there typically is some widget ** or controller, which is responsible for the touched presentation state. If this entity judges - ** the state change to be relevant and persistent, it may [send](\ref BusTerm::note()) a **state mark** - ** into the UI-Bus -- expecting this marked state to be remembered. - ** In turn this means the bus terminal might feed a state mark back into the tangible element, - ** expecting this state to be restored. + ** the state change to be relevant and persistent, it may [send](\ref BusTerm::note()) a + ** **state mark** into the UI-Bus -- expecting this marked state to be remembered. + ** In turn this means the bus terminal might feed a state mark back into the + ** tangible element, expecting this state to be restored. ** ** A special case of state marking is the presentation of _transient feedback._ ** Such feedback is pushed from "somewhere" towards given elements, which react through an diff --git a/src/gui/ui-bus.cpp b/src/gui/ui-bus.cpp index a2a8afadf..8369a7855 100644 --- a/src/gui/ui-bus.cpp +++ b/src/gui/ui-bus.cpp @@ -151,7 +151,7 @@ namespace ctrl { * "state mark" messages. This assumes the presence of some dedicated * presentation state manager, attached and listening somewhere at * a core service location. Such a core presentation state service - * has shares additional understanding of the state mark's meaning; + * has additional shared understanding of the state mark's meaning; * it is assumed to track cumulated state, which will be replayed * later when it comes to restoring some presentation state. */ @@ -165,13 +165,13 @@ namespace ctrl { /** route a state update or notification to the given subject. * @param subject the [endpoint-ID](BusTerm::endpointID_) of the element to address * @param mark the actual state update or notification message to be delivered - * @remarks each "subject" to be addressed is a gui::model::Tangible, and as such - * holds a BusTerm of its own, which in turn ensures a registration and - * connection from the [central routing hub](gui::ctrl::Nexus) down to - * the element. Thus, the default implementation is just to pass the - * given state mark "up", assuming that it will reach the hub - * eventually, which in turn knows hot to reach the element. - * @return if the target was known and the mark operation dispatched. + * @remarks each addressed "subject" is a gui::model::Tangible, and as such holds + * a BusTerm of its own, which in turn ensures a registration and connection + * from the [central routing hub](gui::ctrl::Nexus) down to the element. Thus, + * the default implementation is just to pass the given state mark "up", + * assuming that it will reach the hub eventually, which in turn knows + * how to reach the element, and invoke the Tangible::mark() operation. + * @return `true` if the target was known and the mark operation dispatched. * @note messages to unreachable elements will be dropped. */ bool diff --git a/src/lib/call-queue.hpp b/src/lib/call-queue.hpp new file mode 100644 index 000000000..5c418041d --- /dev/null +++ b/src/lib/call-queue.hpp @@ -0,0 +1,63 @@ +/* + CALL-QUEUE.hpp - a queue to dispatch bound function invocations into another thread + + Copyright (C) Lumiera.org + 2017, 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 call-queue.hpp + ** A Queue for function invocations, allowing them to be dispatched on demand. + ** Typically this queue helper is used to forward lambdas into another thread, e.g. + ** the UI thread for execution. + ** + ** @todo simplistic braindead implementation with locking and heap based storage + ** based on std::function; should use a lock-fee queue and should have an eye + ** on the impact of managing argument storage + ** + ** @see gui::NotificationService usage example + */ + + +#ifndef LIB_CALL_QUEUE_H +#define LIB_CALL_QUEUE_H + + +#include "lib/error.hpp" + +#include + + +namespace lib { + + + + /*********************************************************//** + * A threadsafe queue for bound `void(void)` functors. + * Typically used to dispatch function invocations together with + * their concrete parameters into another thread for invocation. + */ + struct CallQueue + : boost::noncopyable + { + + }; + + + +} // namespace lib +#endif /*LIB_CALL_QUEUE_H*/ diff --git a/tests/library/call-queue-test.cpp b/tests/library/call-queue-test.cpp new file mode 100644 index 000000000..fa99bd392 --- /dev/null +++ b/tests/library/call-queue-test.cpp @@ -0,0 +1,103 @@ +/* + CallQueue(Test) - verify queue based dispatch of bound function objects + + Copyright (C) Lumiera.org + 2017, 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 call-queue-test.cpp + ** unit test \ref CallQueue_test + */ + + +#include "lib/test/run.hpp" +#include "lib/util.hpp" +#include "lib/format-cout.hpp" + +#include "lib/call-queue.hpp" + +#include +//#include +#include + + + +namespace lib { +namespace test{ + + using util::cStr; + using std::bind; + using std::string; + + + + namespace { // test data + } + + + + + /**********************************************************************************//** + * @test verify a helper component for dispatching functors through a threadsafe queue. + * - simple usage + * - enqueue and dequeue several functors + * - multithreaded stress test + * + * @see lib::CallQueue + * @see gui::NotificationService usage example + * @see [DemoGuiRoundtrip]: http://issues.lumiera.org/ticket/1099 "Ticket #1099" + */ + class CallQueue_test : public Test + { + + virtual void + run (Arg) + { + verify_SimpleUse(); + verify_Consistency(); + verify_ThreadSafety(); + } + + + void + verify_SimpleUse () + { + UNIMPLEMENTED("verify_SimpleUse"); + } + + + void + verify_Consistency () + { + UNIMPLEMENTED("verify_Consistency"); + } + + + void + verify_ThreadSafety() + { + UNIMPLEMENTED("verify_ThreadSafety"); + } + }; + + + /** Register this test class... */ + LAUNCHER (CallQueue_test, "unit common"); + + +}} // namespace lib::test diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index e5435008b..69d337537 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -38,7 +38,14 @@ - + + + + + + + + @@ -50,7 +57,7 @@ - + @@ -286,21 +293,16 @@ - - + + - - - - - - - + + - + @@ -473,7 +475,7 @@ - + @@ -504,23 +506,26 @@ + + + + + - - - - + - + - + + - + @@ -535,8 +540,30 @@

startende Funktion zurückkehrt.

+

+ +

+

+ Daher können wir zumindest annehmen, daß die ganze Initialisierung +

+

+ bereits läuft, wenn die start()-Funktion mit true (Erfolg) zurückkommt. +

+

+ +

+

+ Allerdings ist definitiv ein Race gegeben, und wenn +

+

+ direkt beim Starten anderer Subsysteme nach dem GUI etwas schiefläuft, +

+

+ dann kann der Shutdown-Prozeß den Start des GUI überholen. +

-
+ +
@@ -782,7 +809,7 @@
- + @@ -857,7 +884,12 @@
- + + + + + + @@ -979,6 +1011,53 @@ + + + + + + +

+ brauche dedizierten Dispatcher +

+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -11546,7 +11625,7 @@ - +