diff --git a/src/common/interface-facade-link.hpp b/src/common/interface-facade-link.hpp deleted file mode 100644 index 580863127..000000000 --- a/src/common/interface-facade-link.hpp +++ /dev/null @@ -1,124 +0,0 @@ -/* - INTERFACE-FACADE-LINK - a switchable link from interface to service implementation - - Copyright (C) Lumiera.org - 2011, 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 interface-facade-link.hpp - ** Opening, accessing and closing the service access through a facade interface. - ** Client code is assumed to access an application level service through an facade - ** interface, while the actual implementation object remains an opaque internal detail. - ** Moreover, services may come up and shut down, so the implementation might change - ** during the Lifecycle. The facility defined here in this header provides a basic - ** implementation for this access mechanism, but without any adaptation, binding - ** or plugin access layer. It works only under the assumption that both the - ** interface and the actual service implementation coexist in the same - ** executable and are written in C++, so any invocation of an - ** interface method boils down to a language-level call. - ** - ** Usually, client code doesn't need to include this header. Clients are assumed - ** to use the facade interface of the service in question. This facade interface - ** contains a static member of type \c lumiera::facade::Accessor (where I is - ** the type of the facade interface). The Accessor baseclass is defined in - ** interfaceproxy.hpp and typically included through the facade header. - ** - ** @note there is a way more elaborate implementation of the same mechanism - ** for use with the Lumiera Interface/Plugin system. - ** - ** @see interfaceproxy.hpp description of the more general use case - ** @see PlayService example for the simple use case - */ - - -#ifndef LUMIERA_FACADE_INTERFACE_FACADE_LINK_H -#define LUMIERA_FACADE_INTERFACE_FACADE_LINK_H - - -#include "lib/error.hpp" -#include "lib/nocopy.hpp" -#include "lib/meta/util.hpp" -#include "include/interfaceproxy.hpp" -#include "lib/symbol.hpp" - - - - -namespace lumiera { -namespace facade { - - using lib::Literal; - - - /********************************************************************//** - * simple access-frontend to the implementation of a service (C++ only). - * Usually, an instance of Accessor is placed as static member right into - * the facade interface used to access the service. This implementation - * of the access mechanism handles the simple case that both the facade - * and the service implementation are written in C++ and calls happen - * within the main executable as direct language calls, without an - * binding layer and without involving the Interface/Plugin system. - * - * Typically, the InterfaceFacadeLink becomes a member of the service - * implementation class and is directly tied into the constructor of - * the latter. Being a subclass of lumiera::facade::Accessor, it is - * allowed to "open" the facade access just by setting the static - * protected pointer Accessor::implProxy_ - */ - template - class InterfaceFacadeLink - : protected Accessor - , util::NonCopyable - { - string displayName_; - - void - __checkLifecycle () - { - if (Accessor::implProxy_) - throw error::State("Attempt to open an already opened Facade interface." - , error::LERR_(LIFECYCLE)); - } - - public: - InterfaceFacadeLink(FA& serviceImpl, Literal interfaceName_for_Log=0) - : displayName_(interfaceName_for_Log? string(interfaceName_for_Log) - : util::typeStr()) - { - __checkLifecycle(); - Accessor::implProxy_ = &serviceImpl; - INFO (interface, "interface %s opened", displayName_.c_str()); - } - - ~InterfaceFacadeLink() - { - INFO (interface, "closing interface %s...", displayName_.c_str()); - Accessor::implProxy_ = 0; - } - }; - - - - /** storage for the static access pointer */ - template - FA* Accessor::implProxy_; - - -}} // namespace lumiera::facade - -#endif diff --git a/src/include/play-facade.h b/src/include/play-facade.hpp similarity index 89% rename from src/include/play-facade.h rename to src/include/play-facade.hpp index 31894886b..dfe141c64 100644 --- a/src/include/play-facade.h +++ b/src/include/play-facade.hpp @@ -21,8 +21,13 @@ */ -/** @file play-facade.h +/** @file play-facade.hpp ** Public access point to the _playback service_ provided by the »play-out subsystem« + ** @todo in theory this could be an external interface mapped via Lumiera's interface system. + ** This would be much work however, and not serve any tangible goal in the current stage + ** of development (2018). I take this as just another confirmation that turning everything + ** into a plug-in does not quality as good architecture: if you want to do it right, it + ** creates a lot of additional cost. And to do it just superficially would be like cheating. */ @@ -31,15 +36,11 @@ - -#ifdef __cplusplus /* ============== C++ Interface ================= */ - -//#include "include/interfaceproxy.hpp" +#include "lib/depend.hpp" #include "lib/handle.hpp" #include "lib/iter-source.hpp" ////////////////////TICKET #493 : only using the IterSource base interface here #include "lib/time/control.hpp" #include "lib/time/timevalue.hpp" -#include "include/interfaceproxy.hpp" #include "proc/mobject/model-port.hpp" #include "proc/mobject/output-designation.hpp" #include "proc/mobject/session/clip.hpp" @@ -83,7 +84,7 @@ namespace lumiera { public: /** get an implementation instance of this service */ - static lumiera::facade::Accessor facade; + static lib::Depend facade; /** @@ -153,19 +154,4 @@ namespace lumiera { } // namespace lumiera - - - - -extern "C" { -#endif /* =========================== CL Interface ===================== */ - - -// #include "common/interface.h" -////////////////////////////////////TODO define a C binding for the Interface system here - - -#ifdef __cplusplus -} -#endif -#endif +#endif /*PROC_INTERFACE_PLAY_H*/ diff --git a/src/proc/play/output-director.cpp b/src/proc/play/output-director.cpp index f1e343135..97468138b 100644 --- a/src/proc/play/output-director.cpp +++ b/src/proc/play/output-director.cpp @@ -72,7 +72,7 @@ namespace play { Lock sync(this); REQUIRE (not shutdown_initiated_); - player_.reset (new PlayService); + player_.createInstance(); return this->isOperational(); } @@ -132,7 +132,7 @@ namespace play { try { TODO ("actually bring down the output generation"); - player_.reset(0); + player_.shutdown(); completedSignal(0); } diff --git a/src/proc/play/output-director.hpp b/src/proc/play/output-director.hpp index 10069b74a..f1bf22c5a 100644 --- a/src/proc/play/output-director.hpp +++ b/src/proc/play/output-director.hpp @@ -37,6 +37,7 @@ #include "lib/error.hpp" #include "lib/depend.hpp" +#include "lib/depend-inject.hpp" #include "proc/play/output-manager.hpp" #include "common/subsys.hpp" #include "lib/nocopy.hpp" @@ -54,6 +55,7 @@ namespace play { using std::unique_ptr; + class Play; class PlayService; @@ -70,9 +72,10 @@ namespace play { : util::NonCopyable , public lib::Sync<> { - typedef lumiera::Subsys::SigTerm SigTerm; + using SigTerm = lumiera::Subsys::SigTerm; + using PlayServiceHandle = lib::DependInject::ServiceInstance; - unique_ptr player_; + PlayServiceHandle player_; ///////TODO more components and connections to manage here... bool shutdown_initiated_ = false; /////TODO probably need a way more elaborate lifecylce management diff --git a/src/proc/play/play-service.cpp b/src/proc/play/play-service.cpp index 3a1e7b001..984dbcd6d 100644 --- a/src/proc/play/play-service.cpp +++ b/src/proc/play/play-service.cpp @@ -27,7 +27,7 @@ #include "lib/error.hpp" -#include "include/play-facade.h" +#include "include/play-facade.hpp" #include "proc/play/play-service.hpp" #include "proc/play/play-process.hpp" #include "proc/play/render-configurator.hpp" @@ -167,8 +167,7 @@ namespace play { * this service through the lumiera::Play facade. */ PlayService::PlayService() - : facadeAccess_(*this, "Player") - , pTable_(new ProcessTable) + : pTable_(new ProcessTable) { } diff --git a/src/proc/play/play-service.hpp b/src/proc/play/play-service.hpp index 01978a250..e84043134 100644 --- a/src/proc/play/play-service.hpp +++ b/src/proc/play/play-service.hpp @@ -58,8 +58,7 @@ #include "lib/error.hpp" #include "lib/nocopy.hpp" -#include "include/play-facade.h" -#include "common/interface-facade-link.hpp" +#include "include/play-facade.hpp" #include //#include @@ -102,7 +101,6 @@ namespace play { : public lumiera::Play , util::NonCopyable { - InterfaceFacadeLink facadeAccess_; std::unique_ptr pTable_; diff --git a/tests/core/proc/play/dummy-play-connection-test.cpp b/tests/core/proc/play/dummy-play-connection-test.cpp index 1d4ee4685..e6a2ae46f 100644 --- a/tests/core/proc/play/dummy-play-connection-test.cpp +++ b/tests/core/proc/play/dummy-play-connection-test.cpp @@ -30,7 +30,7 @@ #include "proc/play/dummy-play-connection.hpp" //#include "proc/engine/buffhandle.hpp" //#include "proc/engine/testframe.hpp" -#include "include/play-facade.h" +#include "include/play-facade.hpp" #include "lib/time/control.hpp" diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 4d92964d1..334b6670f 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -28345,8 +28345,8 @@ - - + + @@ -28354,7 +28354,8 @@ - + + @@ -28366,8 +28367,7 @@ den habe ich nicht mehr über das Interface-System gemappt

- -
+ @@ -28380,13 +28380,25 @@ Also hat das hier Prototyp-Charakter!

- -
+
- + + + + + + + + + + + + + +