Lumiera
0.pre.03
»edit your freedom«
|
#include "common/subsys.hpp"
Dependencies and lifecycle of a partially independent Subsystem of the Application.
Using such descriptors, AppState as activated from main() is able to pull up, maintain and shut down the primary parts of the Application.
Definition at line 61 of file subsys.hpp.
Public Types | |
typedef function< void(string *)> | SigTerm |
Public Member Functions | |
Subsys & | depends (Subsys &prereq) |
define a dependency to another Subsys required for running this subsystem | |
const std::vector< Subsys * > | getPrerequisites () |
bool | isRunning () noexcept |
virtual | operator string () const =0 |
a human readable name | |
virtual bool | shouldStart (lumiera::Option &)=0 |
query application option state to determine if this subsystem should be activated. More... | |
virtual bool | start (lumiera::Option &options, SigTerm)=0 |
attempt to bring up this subsystem up. More... | |
virtual void | triggerShutdown () noexcept=0 |
initiate termination of this subsystem. More... | |
Private Member Functions | |
virtual bool | checkRunningState () noexcept=0 |
whether this subsystem is actually operational. More... | |
Private Member Functions inherited from NonCopyable | |
NonCopyable (NonCopyable const &)=delete | |
NonCopyable & | operator= (NonCopyable const &)=delete |
Private Attributes | |
std::vector< Subsys * > | prereq_ |
|
noexcept |
Definition at line 50 of file subsys.cpp.
References Subsys::checkRunningState().
|
pure virtual |
query application option state to determine if this subsystem should be activated.
Implemented in MockSys, PlayOutSubsysDescriptor, GuiSubsysDescriptor, SessionSubsystem, DummyPlayerSubsysDescriptor, EngineSubsysDescriptor, ScriptRunnerSubsysDescriptor, and NetNodeSubsysDescriptor.
|
pure virtual |
attempt to bring up this subsystem up.
On return, the subsystem must be operational, according to checkRunningState(). Failure to start up usually terminates the whole application. When this subsystem ceases to work, it must ensure to activate the given callback signal.
options | may be influencing the operation mode |
SigTerm | to be signalled by the subsystem. |
true
if actually started. Implemented in MockSys, GuiSubsysDescriptor, PlayOutSubsysDescriptor, SessionSubsystem, DummyPlayerSubsysDescriptor, EngineSubsysDescriptor, ScriptRunnerSubsysDescriptor, and NetNodeSubsysDescriptor.
|
pure virtualnoexcept |
initiate termination of this subsystem.
This trigger may be called repeatedly any time... When the subsystem actually has terminated, the SigTerm passed to start must be invoked.
Implemented in MockSys, GuiSubsysDescriptor, PlayOutSubsysDescriptor, DummyPlayerSubsysDescriptor, SessionSubsystem, EngineSubsysDescriptor, ScriptRunnerSubsysDescriptor, and NetNodeSubsysDescriptor.
|
privatepure virtualnoexcept |
whether this subsystem is actually operational.
When returning false
here, the application may terminate at any point without further notice Note further, that a subsystem must not be in running state when signalling termination.
Implemented in MockSys, GuiSubsysDescriptor, PlayOutSubsysDescriptor, DummyPlayerSubsysDescriptor, SessionSubsystem, EngineSubsysDescriptor, ScriptRunnerSubsysDescriptor, and NetNodeSubsysDescriptor.
Referenced by Subsys::isRunning().