diff --git a/src/common/instancehandle.hpp b/src/common/instancehandle.hpp index 513a7607e..e12b8ec2d 100644 --- a/src/common/instancehandle.hpp +++ b/src/common/instancehandle.hpp @@ -101,7 +101,11 @@ namespace lumiera { ifa->version, ifa->name)); } + + } // (End) impl details + + namespace facade { /** * @internal Helper/Adapter for establishing a link @@ -113,13 +117,13 @@ namespace lumiera { * when destroying the InstanceHandle, the proxy will be closed. */ template - struct FacadeLink + struct Link : boost::noncopyable { typedef InstanceHandle IH; - FacadeLink (IH const& iha) { facade::openProxy(iha); } - ~FacadeLink() { facade::closeProxy(); } + Link (IH const& iha) { facade::openProxy(iha); } + ~Link() { facade::closeProxy(); } FA& operator() (IH const&) const @@ -132,16 +136,16 @@ namespace lumiera { /** * @internal when the InstanceHandle isn't associated with a * facade interface, then this specialisation switches - * the FacadeLink into "NOP" mode. + * the facade::Link into "NOP" mode. */ template - struct FacadeLink + struct Link : boost::noncopyable { typedef InstanceHandle IH; - FacadeLink (IH const&) { /* NOP */ } - ~FacadeLink() { /* NOP */ } + Link (IH const&) { /* NOP */ } + ~Link() { /* NOP */ } I& operator() (IH const& handle) const @@ -150,7 +154,7 @@ namespace lumiera { } }; - } // (End) impl details + } // namespace facade (impl details) @@ -174,7 +178,7 @@ namespace lumiera { { LumieraInterface desc_; I* instance_; - FacadeLink facadeLink_; + facade::Link facadeLink_; typedef InstanceHandle _ThisType; diff --git a/src/common/interfaceproxy.cpp b/src/common/interfaceproxy.cpp index 52bd9d3f7..6cbc8b4cb 100644 --- a/src/common/interfaceproxy.cpp +++ b/src/common/interfaceproxy.cpp @@ -59,7 +59,7 @@ namespace lumiera { protected: typedef InstanceHandle IHandle; typedef Holder THolder; - typedef Proxy Proxy; + typedef Proxy TProxy; typedef Accessor Access; I& _i_; @@ -69,10 +69,10 @@ namespace lumiera { { } public: - static Proxy& open(IHandle const& iha) + static TProxy& open(IHandle const& iha) { - static char buff[sizeof(Proxy)]; - Proxy* p = new(buff) Proxy(iha); + static char buff[sizeof(TProxy)]; + TProxy* p = new(buff) TProxy(iha); Access::implProxy_ = p; return *p; } @@ -80,9 +80,9 @@ namespace lumiera { static void close() { if (!Access::implProxy_) return; - Proxy* p = static_cast (Access::implProxy_); + TProxy* p = static_cast (Access::implProxy_); Access::implProxy_ = 0; - p->~Proxy(); + p->~TProxy(); } }; diff --git a/src/common/subsystem-runner.hpp b/src/common/subsystem-runner.hpp index a25bc3dc0..d2476a77e 100644 --- a/src/common/subsystem-runner.hpp +++ b/src/common/subsystem-runner.hpp @@ -162,10 +162,12 @@ namespace lumiera { bool started = susy->start (opts_, bind (&SubsystemRunner::sigTerm, this, susy, _1)); if (started) - if (susy->isRunning()) - running_.push_back (susy); // now responsible for managing the started subsystem - else - throw error::Logic("Subsystem "+string(*susy)+" failed to start"); + { + if (susy->isRunning()) + running_.push_back (susy); // now responsible for managing the started subsystem + else + throw error::Logic("Subsystem "+string(*susy)+" failed to start"); + } if (!and_all (susy->getPrerequisites(), isRunning() )) { diff --git a/src/gui/gtk-lumiera.hpp b/src/gui/gtk-lumiera.hpp index ce3d4c2e4..f2e228851 100644 --- a/src/gui/gtk-lumiera.hpp +++ b/src/gui/gtk-lumiera.hpp @@ -29,7 +29,7 @@ #define GTK_LUMIERA_HPP #include -#include +#include // need to include this after gtkmm.h, because types.h from GTK tries to shaddow the ERROR macro from windows, which kills NoBug's ERROR macro #include #include #include diff --git a/src/gui/guistart.cpp b/src/gui/guistart.cpp index 529ea37de..455dafabb 100644 --- a/src/gui/guistart.cpp +++ b/src/gui/guistart.cpp @@ -45,8 +45,9 @@ ** @see gui::GtkLumiera#main the GTK GUI main */ +#include // need to include this to prevent errors when libintl.h defines textdomain (because gtk-lumiera removes the def when ENABLE_NLS isn't defined) -#include "gui/gtk-lumiera.hpp" +#include "gui/gtk-lumiera.hpp" // need to include this before nobugcfg.h, because types.h from GTK tries to shaddow the ERROR macro from windows, which kills nobug's ERROR macro #include "include/nobugcfg.h" #include "lib/error.hpp" #include "gui/guifacade.hpp" diff --git a/tests/lib/subsystem-runner-test.cpp b/tests/lib/subsystem-runner-test.cpp index 513b132d6..dd2fc7b1f 100644 --- a/tests/lib/subsystem-runner-test.cpp +++ b/tests/lib/subsystem-runner-test.cpp @@ -103,6 +103,7 @@ namespace lumiera { || "throw"==startSpec; } + bool start (lumiera::Option&, Subsys::SigTerm termination) { @@ -282,8 +283,8 @@ namespace lumiera { MockSys unit4 ("U4", "start(true), run(false)."); SubsystemRunner runner(dummyOpt); - runner.maybeRun (unit1); - runner.maybeRun (unit4); + runner.maybeRun (unit1); // this one doesn't start at all, which isn't considered an error + try { runner.maybeRun (unit2); @@ -302,6 +303,15 @@ namespace lumiera { { ASSERT (lumiera_error() == error::LUMIERA_ERROR_LOGIC); // incorrect behaviour trapped } + try + { + runner.maybeRun (unit4); + NOTREACHED; + } + catch (lumiera::Error&) + { + ASSERT (lumiera_error() == error::LUMIERA_ERROR_LOGIC); // detected that the subsystem didn't come up + } bool emergency = runner.wait();