Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
appstate.hpp
Go to the documentation of this file.
1/*
2 APPSTATE.hpp - application initialisation and behaviour
3
4 Copyright (C)
5 2008, Hermann Vosseler <Ichthyostega@web.de>
6
7  **Lumiera** is free software; you can redistribute it and/or modify it
8  under the terms of the GNU General Public License as published by the
9  Free Software Foundation; either version 2 of the License, or (at your
10  option) any later version. See the file COPYING for further details.
11
12*/
13
31#ifndef LUMIERA_APPSTATE_H
32#define LUMIERA_APPSTATE_H
33
34#include "lib/symbol.hpp"
35#include "lib/nocopy.hpp"
36#include "lib/depend.hpp"
37#include "common/option.hpp"
38#include "common/subsys.hpp"
40
41#include <memory>
42#include <string>
43#include <map>
44
45
46
47namespace lumiera {
48
49 using std::string;
50
51 class SubsystemRunner;
52
53
63 {
64 private:
65 AppState ();
66
68 friend class lib::DependencyFactory<AppState>;
69
70
71 public:
75
76
80 void init (lumiera::Option& options);
81
82
84 string fetchSetupValue (lib::Literal key);
85
86
92
93
100
110
111
114 ExitCode abort (lumiera::Error& problem);
115
116
119 ExitCode abort () noexcept;
120
121
122
123 private:
124 using PSub = std::unique_ptr<SubsystemRunner>;
125
127
129
132
133 };
134
135
136} // namespace lumiera
137
138#endif
Bootstrap and self-configuration of the application at startup.
Access point to singletons and other kinds of dependencies designated by type.
Definition depend.hpp:281
Helper to abstract creation and lifecycle of a dependency.
Definition depend.hpp:127
Inline string literal.
Definition symbol.hpp:78
The Lumiera Application state and basic initialisation.
Definition appstate.hpp:63
~AppState()
anything which should be closed as late as possible and after the normal shutdown sequence can be pla...
Definition appstate.cpp:227
string fetchSetupValue(lib::Literal key)
access basic application setup values (from setup.ini)
Definition appstate.cpp:83
void init(lumiera::Option &options)
evaluate the result of option parsing and maybe additional configuration such as to be able to determ...
Definition appstate.cpp:102
ExitCode abort() noexcept
initiate an fatal emergency shutdown, caused by an unforeseen error condition
Definition appstate.cpp:203
ExitCode maybeWait()
put the main thread of the application into a wait state, as long as some subsystem(s) registered wit...
Definition appstate.cpp:152
std::unique_ptr< SubsystemRunner > PSub
Definition appstate.hpp:124
static lib::Depend< AppState > instance
get the (single) AppState instance.
Definition appstate.hpp:74
BasicSetup setup_
Definition appstate.hpp:126
void maybeStart(lumiera::Subsys &)
building on the state determined by init, decide if the given Subsys needs to be pulled up and,...
Definition appstate.cpp:127
AppState()
perform initialisation triggered on first access.
Definition appstate.cpp:71
Represents the elementary self-configuration of a running Lumiera application instance.
Interface and Base definition for all Lumiera Exceptions.
Definition error.hpp:65
Frontend for handling the Lumiera application commandline arguments.
Definition option.hpp:70
Dependencies and lifecycle of a partially independent Subsystem of the Application.
Definition subsys.hpp:63
Implementation helper for managing execution of a collection of subsystems, which may depend on one a...
Any copy and copy construction prohibited.
Definition nocopy.hpp:38
Singleton services and Dependency Injection.
Lumiera public interface.
Definition advice.hpp:102
STL namespace.
Mix-Ins to allow or prohibit various degrees of copying and cloning.
front-end for handling the commandline arguments.
Describing dependencies and lifecycle of the application's primary parts.
Marker types to indicate a literal string and a Symbol.