clean-up: mark subsystem implementations with noexcept and override
throw() is deprecated noexcept behaves similar, but allows for optimisations and will be promoted to a part of the signature type in C++17
This commit is contained in:
parent
79800bb6eb
commit
4fc1126a28
9 changed files with 43 additions and 43 deletions
|
|
@ -38,27 +38,27 @@ namespace backend {
|
|||
operator string () const { return "Engine"; }
|
||||
|
||||
bool
|
||||
shouldStart (lumiera::Option&)
|
||||
shouldStart (lumiera::Option&) override
|
||||
{
|
||||
TODO ("determine, if renderengine should be started");
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
start (lumiera::Option&, Subsys::SigTerm termination)
|
||||
start (lumiera::Option&, Subsys::SigTerm termination) override
|
||||
{
|
||||
UNIMPLEMENTED ("pull up renderengine and register shutdown hook");
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
triggerShutdown () throw()
|
||||
triggerShutdown () noexcept override
|
||||
{
|
||||
UNIMPLEMENTED ("initiate halting the engine");
|
||||
}
|
||||
|
||||
bool
|
||||
checkRunningState () throw()
|
||||
checkRunningState () noexcept override
|
||||
{
|
||||
//Lock guard (*this);
|
||||
TODO ("implement detecting running state");
|
||||
|
|
|
|||
|
|
@ -37,27 +37,27 @@ namespace backend {
|
|||
operator string () const { return "Renderfarm node"; }
|
||||
|
||||
bool
|
||||
shouldStart (lumiera::Option&)
|
||||
shouldStart (lumiera::Option&) override
|
||||
{
|
||||
TODO ("determine, if render node service should be provided");
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
start (lumiera::Option&, SigTerm termination)
|
||||
start (lumiera::Option&, SigTerm termination) override
|
||||
{
|
||||
UNIMPLEMENTED ("open a render node server port and register shutdown hook");
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
triggerShutdown () throw()
|
||||
triggerShutdown () noexcept override
|
||||
{
|
||||
UNIMPLEMENTED ("initiate shutting down the render node");
|
||||
}
|
||||
|
||||
bool
|
||||
checkRunningState () throw()
|
||||
checkRunningState () noexcept override
|
||||
{
|
||||
//Lock guard (*this);
|
||||
TODO ("implement detecting running state");
|
||||
|
|
|
|||
|
|
@ -38,27 +38,27 @@ namespace backend {
|
|||
operator string () const { return "Script runner"; }
|
||||
|
||||
bool
|
||||
shouldStart (lumiera::Option&)
|
||||
shouldStart (lumiera::Option&) override
|
||||
{
|
||||
TODO ("determine, if a script should be executed");
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
start (lumiera::Option&, SigTerm termination)
|
||||
start (lumiera::Option&, SigTerm termination) override
|
||||
{
|
||||
UNIMPLEMENTED ("start the script as defined by the options and register script abort/exit hook");
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
triggerShutdown () throw()
|
||||
triggerShutdown () noexcept override
|
||||
{
|
||||
UNIMPLEMENTED ("halt any running script");
|
||||
}
|
||||
|
||||
bool
|
||||
checkRunningState () throw()
|
||||
checkRunningState () noexcept override
|
||||
{
|
||||
//Lock guard (*this);
|
||||
TODO ("implement detecting running state");
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ namespace gui {
|
|||
operator string () const { return "Lumiera GTK GUI"; }
|
||||
|
||||
bool
|
||||
shouldStart (lumiera::Option& opts)
|
||||
shouldStart (lumiera::Option& opts) override
|
||||
{
|
||||
if (opts.isHeadless() || 0 < opts.getPort())
|
||||
{
|
||||
|
|
@ -103,7 +103,7 @@ namespace gui {
|
|||
}
|
||||
|
||||
bool
|
||||
start (lumiera::Option&, Subsys::SigTerm termination)
|
||||
start (lumiera::Option&, Subsys::SigTerm termination) override
|
||||
{
|
||||
Lock guard (this);
|
||||
if (facade) return false; // already started
|
||||
|
|
@ -116,15 +116,15 @@ namespace gui {
|
|||
}
|
||||
|
||||
void
|
||||
triggerShutdown () throw()
|
||||
triggerShutdown () noexcept override
|
||||
{
|
||||
try { GuiNotification::facade().triggerGuiShutdown ("Application shutdown"); }
|
||||
|
||||
catch (...){}
|
||||
ERROR_LOG_AND_IGNORE (guifacade, "trigger shutdown of the GUI");
|
||||
}
|
||||
|
||||
bool
|
||||
checkRunningState () throw()
|
||||
checkRunningState () noexcept override
|
||||
{
|
||||
return bool(facade);
|
||||
}
|
||||
|
|
@ -158,8 +158,8 @@ namespace gui {
|
|||
WARN (guifacade, "GUI subsystem terminates, but GuiFacade isn't properly closed. "
|
||||
"Closing it forcedly; this indicates broken startup logic and should be fixed.");
|
||||
try { facade.reset (0); }
|
||||
catch(...) { WARN_IF (lumiera_error_peek(), guifacade, "Ignoring error: %s", lumiera_error()); }
|
||||
lumiera_error(); // clear any remaining error state...
|
||||
ERROR_LOG_AND_IGNORE (guifacade, "forcibly closing the GUI");
|
||||
ENSURE (not lumiera_error_peek());
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ namespace lumiera {
|
|||
|
||||
|
||||
bool
|
||||
Subsys::isRunning()
|
||||
Subsys::isRunning() noexcept
|
||||
{
|
||||
return checkRunningState();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,7 +85,7 @@ namespace lumiera {
|
|||
|
||||
/** @return true if Up
|
||||
* @warning must not block nor throw. */
|
||||
bool isRunning();
|
||||
bool isRunning() noexcept;
|
||||
|
||||
|
||||
/** query application option state to determine
|
||||
|
|
@ -109,7 +109,7 @@ namespace lumiera {
|
|||
* the SigTerm passed to #start must be invoked.
|
||||
* @note called within a locked context (barrier)
|
||||
* @warning must not block nor throw. */
|
||||
virtual void triggerShutdown () throw() =0;
|
||||
virtual void triggerShutdown () noexcept =0;
|
||||
|
||||
|
||||
const std::vector<Subsys*>
|
||||
|
|
@ -122,7 +122,7 @@ namespace lumiera {
|
|||
* terminate at any point without further notice
|
||||
* Note further, that a subsystem must not be in
|
||||
* running state when signalling termination. */
|
||||
virtual bool checkRunningState() throw() =0;
|
||||
virtual bool checkRunningState() noexcept =0;
|
||||
|
||||
std::vector<Subsys*> prereq_;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -41,27 +41,27 @@ namespace proc {
|
|||
operator string () const { return "Builder"; }
|
||||
|
||||
bool
|
||||
shouldStart (Option&)
|
||||
shouldStart (Option&) override
|
||||
{
|
||||
TODO ("determine, if we need a Builder Thread");
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
start (Option&, Subsys::SigTerm termination)
|
||||
start (Option&, Subsys::SigTerm termination) override
|
||||
{
|
||||
UNIMPLEMENTED ("fire up a Builder in a separate Thread, and register shutdown hook");
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
triggerShutdown () throw()
|
||||
triggerShutdown () noexcept override
|
||||
{
|
||||
UNIMPLEMENTED ("halt the Builder and cancel any build process"); /////TODO really cancel??
|
||||
}
|
||||
|
||||
bool
|
||||
checkRunningState () throw()
|
||||
checkRunningState () noexcept override
|
||||
{
|
||||
//Lock guard (*this);
|
||||
TODO ("implement detecting running state");
|
||||
|
|
@ -77,27 +77,27 @@ namespace proc {
|
|||
operator string () const { return "Session"; }
|
||||
|
||||
bool
|
||||
shouldStart (Option&)
|
||||
shouldStart (Option&) override
|
||||
{
|
||||
TODO ("determine, if an existing Session should be loaded");
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
start (Option&, Subsys::SigTerm termination)
|
||||
start (Option&, Subsys::SigTerm termination) override
|
||||
{
|
||||
UNIMPLEMENTED ("load an existing session as denoted by the options and register shutdown hook");
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
triggerShutdown () throw()
|
||||
triggerShutdown () noexcept override
|
||||
{
|
||||
UNIMPLEMENTED ("initiate closing this Session");
|
||||
}
|
||||
|
||||
bool
|
||||
checkRunningState () throw()
|
||||
checkRunningState () noexcept override
|
||||
{
|
||||
//Lock guard (*this);
|
||||
TODO ("implement detecting running state");
|
||||
|
|
@ -120,14 +120,14 @@ namespace proc {
|
|||
* @todo actually define cmdline options and parse/decide here!
|
||||
*/
|
||||
bool
|
||||
shouldStart (Option&)
|
||||
shouldStart (Option&) override
|
||||
{
|
||||
TODO ("extract options about specific output systems to be brought up");
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
start (Option&, Subsys::SigTerm termination)
|
||||
start (Option&, Subsys::SigTerm termination) override
|
||||
{
|
||||
this->completedSignal_ = termination;
|
||||
return play::OutputDirector::instance().connectUp();
|
||||
|
|
@ -137,14 +137,14 @@ namespace proc {
|
|||
|
||||
|
||||
void
|
||||
triggerShutdown () throw()
|
||||
triggerShutdown () noexcept override
|
||||
{
|
||||
play::OutputDirector::instance().triggerDisconnect (completedSignal_);
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
checkRunningState () throw()
|
||||
checkRunningState () noexcept override
|
||||
{
|
||||
return play::OutputDirector::instance().isOperational();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -59,13 +59,13 @@ namespace proc {
|
|||
|
||||
|
||||
bool
|
||||
shouldStart (lumiera::Option&)
|
||||
shouldStart (lumiera::Option&) override
|
||||
{
|
||||
return false; // for now the DummyPlayerService only comes "up" as dependency,
|
||||
} // but doesn't start as a subsystem on it's own.
|
||||
|
||||
bool
|
||||
start (lumiera::Option&, Subsys::SigTerm terminationHandle)
|
||||
start (lumiera::Option&, Subsys::SigTerm terminationHandle) override
|
||||
{
|
||||
ASSERT (!thePlayer_);
|
||||
|
||||
|
|
@ -78,7 +78,7 @@ namespace proc {
|
|||
|
||||
|
||||
void
|
||||
triggerShutdown () throw()
|
||||
triggerShutdown () noexcept override
|
||||
{
|
||||
thePlayer_.reset(0);
|
||||
// note: shutdown of the DummyPlayerService instance may block
|
||||
|
|
@ -86,7 +86,7 @@ namespace proc {
|
|||
}
|
||||
|
||||
bool
|
||||
checkRunningState () throw()
|
||||
checkRunningState () noexcept override
|
||||
{
|
||||
return bool(thePlayer_);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ namespace test {
|
|||
|
||||
|
||||
bool
|
||||
shouldStart (lumiera::Option&)
|
||||
shouldStart (lumiera::Option&) override
|
||||
{
|
||||
string startSpec (extractID ("start",spec_));
|
||||
return "true" ==startSpec
|
||||
|
|
@ -112,7 +112,7 @@ namespace test {
|
|||
|
||||
|
||||
bool
|
||||
start (lumiera::Option&, Subsys::SigTerm termination)
|
||||
start (lumiera::Option&, Subsys::SigTerm termination) override
|
||||
{
|
||||
CHECK (!(isUp_|started_|didRun_), "attempt to start %s twice!", cStr(*this));
|
||||
|
||||
|
|
@ -139,7 +139,7 @@ namespace test {
|
|||
}
|
||||
|
||||
void
|
||||
triggerShutdown () throw()
|
||||
triggerShutdown () noexcept override
|
||||
{
|
||||
// note: *not* locking here...
|
||||
termRequest_ = true;
|
||||
|
|
@ -148,7 +148,7 @@ namespace test {
|
|||
}
|
||||
|
||||
bool
|
||||
checkRunningState () throw()
|
||||
checkRunningState () noexcept override
|
||||
{
|
||||
// note: *not* locking here...
|
||||
return isUp_;
|
||||
|
|
|
|||
Loading…
Reference in a new issue