Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
steam-dispatcher.hpp
Go to the documentation of this file.
1/*
2 STEAM-DISPATCHER.hpp - Steam-Layer command dispatch and execution
3
4 Copyright (C)
5 2009, 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
45#ifndef STEAM_CONTROL_PROC_DISPATCHER_H
46#define STEAM_CONTROL_PROC_DISPATCHER_H
47
48#include "common/subsys.hpp"
49#include "lib/depend.hpp"
50#include "lib/sync.hpp"
51
52#include <memory>
53
54
55
56namespace steam {
57namespace control {
58
59 using std::unique_ptr;
60 using lumiera::Subsys;
61
62
63 class DispatcherLoop;
64
65
78 : public lib::Sync<>
79 {
81 bool active_{false};
82
83 public:
85
87 bool isRunning();
88 void requestStop() noexcept;
89
90 void activate();
91 void deactivate();
92 void awaitDeactivation();
93 void clear();
94
95 bool empty() const ;
96
97 private:
99
102 friend class lib::DependencyFactory<SteamDispatcher>;
103 };
104
105
106
107
108}} // namespace steam::control
109#endif /*STEAM_CONTROL_PROC_DISPATCHER_H*/
Access point to singletons and other kinds of dependencies designated by type.
Definition depend.hpp:281
Facility for monitor object based locking.
Definition sync.hpp:210
Dependencies and lifecycle of a partially independent Subsystem of the Application.
Definition subsys.hpp:63
function< void(string *)> SigTerm
Definition subsys.hpp:65
Guard to manage processing commands to operate on the session.
bool start(Subsys::SigTerm)
starting the SteamDispatcher means to start the session subsystem.
unique_ptr< DispatcherLoop > runningLoop_
bool isRunning()
whether the »session subsystem« is operational.
static lib::Depend< SteamDispatcher > instance
storage for Singleton access
void activate()
activate processing of enqueued session commands.
void deactivate()
halt further processing of session commands
void awaitDeactivation()
block until the dispatcher has actually reached disabled state.
void clear()
discard any commands waiting in the dispatcher queue
void requestStop() noexcept
signal to the loop thread that it needs to terminate.
Singleton services and Dependency Injection.
enable_if_c< Cond::value, T >::type enable_if
SFINAE helper to control the visibility of specialisations and overloads.
Definition meta/util.hpp:87
Implementation namespace for support and library code.
Steam-Layer implementation namespace root.
Describing dependencies and lifecycle of the application's primary parts.
Object Monitor based synchronisation.