Lumiera  0.pre.03
»edit your freedom«
scriptrunnerfacade.cpp
Go to the documentation of this file.
1 /*
2  ScriptRunnerFacade - access point for running a script within Lumiera application context
3 
4  Copyright (C) Lumiera.org
5  2008, Hermann Vosseler <Ichthyostega@web.de>
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of
10  the License, or (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 
21 * *****************************************************/
22 
23 
34 #include "lib/depend.hpp"
35 
36 #include <string>
37 
38 
39 namespace vault {
40 
41  using std::string;
42  using lumiera::Subsys;
43 
45  : public Subsys
46  {
47  operator string () const { return "Script runner"; }
48 
49  bool
51  {
52  TODO ("determine, if a script should be executed");
53  return false;
54  }
55 
56  bool
57  start (lumiera::Option&, SigTerm termination) override
58  {
59  UNIMPLEMENTED ("start the script as defined by the options and register script abort/exit hook");
60  return false;
61  }
62 
63  void
64  triggerShutdown () noexcept override
65  {
66  UNIMPLEMENTED ("halt any running script");
67  }
68 
69  bool
70  checkRunningState () noexcept override
71  {
72  //Lock guard{*this};
73  TODO ("implement detecting running state");
74  return false;
75  }
76  };
77 
78  namespace {
80  }
81 
82 
83 
84 
86  Subsys&
88  {
89  return theDescriptor();
90  }
91 
92 
93 
94 } // namespace vault
bool shouldStart(lumiera::Option &) override
query application option state to determine if this subsystem should be activated.
Dependencies and lifecycle of a partially independent Subsystem of the Application.
Definition: subsys.hpp:70
Global control interface for script driven operation of Lumiera.
bool checkRunningState() noexcept override
whether this subsystem is actually operational.
Frontend for handling the Lumiera application commandline arguments.
Definition: option.hpp:77
Access point to singletons and other kinds of dependencies designated by type.
Definition: depend.hpp:289
bool start(lumiera::Option &, SigTerm termination) override
attempt to bring up this subsystem up.
static lumiera::Subsys & getDescriptor()
provide a descriptor for lumiera::AppState, wired accordingly to allow main to start a script and to ...
Singleton services and Dependency Injection.
void triggerShutdown() noexcept override
initiate termination of this subsystem.
Vault-Layer implementation namespace root.