Lumiera  0.pre.03
»edit your freedom«
facade.cpp
Go to the documentation of this file.
1 /*
2  Facade - access point for communicating with the Steam-Interface
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 
14 
38 #include "steam/facade.hpp"
39 #include "lib/depend.hpp"
42 
43 #include <string>
44 
45 
46 namespace steam {
47 
48  using std::string;
49  using std::unique_ptr;
50  using lumiera::Subsys;
51  using lumiera::Option;
53 
54 
56  : public Subsys
57  {
58  operator string() const { return "Session"; }
59 
63  bool
64  shouldStart (Option&) override
65  {
66  return false;
67  }
68 
69  bool
70  start (Option&, Subsys::SigTerm termNotification) override
71  {
72  return SteamDispatcher::instance().start (termNotification);
73  }
74 
75  void
76  triggerShutdown() noexcept override
77  {
78  SteamDispatcher::instance().requestStop();
79  }
80 
81  bool
82  checkRunningState() noexcept override
83  {
84  return SteamDispatcher::instance().isRunning();
85  }
86  };
87 
88 
89 
91  : public Subsys
92  {
93  operator string() const { return "PlayOut"; }
94 
102  bool
103  shouldStart (Option&) override
104  {
105  TODO ("extract options about specific output systems to be brought up");
106  return false;
107  }
108 
109  bool
110  start (Option&, Subsys::SigTerm termination) override
111  {
112  this->completedSignal_ = termination;
113  return play::OutputDirector::instance().connectUp();
114  }
115 
116  SigTerm completedSignal_;
117 
118 
119  void
120  triggerShutdown() noexcept override
121  {
122  play::OutputDirector::instance().triggerDisconnect (completedSignal_);
123  }
124 
125 
126  bool
127  checkRunningState() noexcept override
128  {
129  return play::OutputDirector::instance().isOperational();
130  }
131  };
132 
133  namespace {
134  lib::Depend<SessionSubsystem> theSessionSubsystemLifecycle;
135  lib::Depend<PlayOutSubsysDescriptor> thePlayOutDescriptor;
136  }
137 
138 
139 
140 
142  Subsys&
144  {
145  return theSessionSubsystemLifecycle();
146  }
147 
148 
150  Subsys&
152  {
153  return thePlayOutDescriptor();
154  }
155 
156 
157 
158 } // namespace steam
bool checkRunningState() noexcept override
whether this subsystem is actually operational.
Definition: facade.cpp:127
static lib::Depend< SteamDispatcher > instance
storage for Singleton access
Dependencies and lifecycle of a partially independent Subsystem of the Application.
Definition: subsys.hpp:61
Guard to manage processing commands to operate on the session.
A global service to coordinate and handle all external output activities.
static lumiera::Subsys & getPlayOutDescriptor()
provide a descriptor for lumiera::AppState, wired accordingly to allow main() to bring up the render ...
Definition: facade.cpp:151
void triggerShutdown() noexcept override
initiate termination of this subsystem.
Definition: facade.cpp:120
Dispatch and execute mutation operations on the High-level model.
Frontend for handling the Lumiera application commandline arguments.
Definition: option.hpp:68
Steam-Layer implementation namespace root.
Access point to singletons and other kinds of dependencies designated by type.
Definition: depend.hpp:280
bool shouldStart(Option &) override
Definition: facade.cpp:64
void triggerShutdown() noexcept override
initiate termination of this subsystem.
Definition: facade.cpp:76
bool checkRunningState() noexcept override
whether this subsystem is actually operational.
Definition: facade.cpp:82
static lumiera::Subsys & getSessionDescriptor()
provide a descriptor for lumiera::AppState, wired accordingly to allow main() to boot the support inf...
Definition: facade.cpp:143
Singleton services and Dependency Injection.
bool shouldStart(Option &) override
determine, if any output system is required to start up explicitly.
Definition: facade.cpp:103
static lib::Depend< OutputDirector > instance
storage for the single application wide OutputDirector instance
bool start(Option &, Subsys::SigTerm termNotification) override
attempt to bring up this subsystem up.
Definition: facade.cpp:70
bool start(Option &, Subsys::SigTerm termination) override
attempt to bring up this subsystem up.
Definition: facade.cpp:110