Lumiera  0.pre.03
»edit your freedom«
sess-manager-impl.hpp
Go to the documentation of this file.
1 /*
2  SESS-MANAGER-IMPL.hpp - global session access and lifecycle
3 
4  Copyright (C) Lumiera.org
5  2009, 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 
40 #ifndef MOBJECT_SESSION_SESS_MANAGER_IMPL_H
41 #define MOBJECT_SESSION_SESS_MANAGER_IMPL_H
42 
44 #include "lib/sync.hpp"
45 
46 
47 namespace steam {
48 namespace mobject {
49 namespace session {
50 
51  using lib::Sync;
52  using lib::RecursiveLock_NoWait;
53 
54  class LifecycleAdvisor;
55 
56 
62  : public SessManager
63  , public Sync<RecursiveLock_NoWait>
64  {
65  unique_ptr<SessionImplAPI> pSess_;
66  unique_ptr<LifecycleAdvisor> lifecycle_;
67 
69  friend class lib::DependencyFactory<SessManagerImpl>;
70 
71  ~SessManagerImpl() ;
72 
73  /* ==== SessManager API ==== */
74  virtual void clear() override;
75  virtual void close() override;
76  virtual void reset() override;
77  virtual void load () override;
78  virtual void save (string) override;
79 
80  virtual bool isUp () override;
81 
82 
83  public:
84  /* ==== steam layer internal API ==== */
85 
86  virtual SessionImplAPI* operator-> () noexcept override;
87 
88  };
89 
90 
91 
92 }}} // namespace steam::mobject::session
93 #endif
Facility for monitor object based locking.
Definition: sync.hpp:217
Collection of configured implementation-level services to provide by the Session. ...
Steam-Layer implementation namespace root.
Namespace of Session and user visible high-level objects.
Definition: sequence.hpp:74
Object Monitor based synchronisation.
SessManagerImpl()
Starting up the session access and lifecycle management.
Session manager implementation class holding the actual smart pointer to the current Session impl...
creation, access and Session lifecycle Interface.
Definition: session.hpp:161
virtual SessionImplAPI * operator->() noexcept override
Access to the "current session", which actually is an SessionImpl instance.
Helper to abstract creation and lifecycle of a dependency.
Definition: depend.hpp:134
Session and SessionServices Implementation classes.
virtual bool isUp() override
diagnostics: session interface opened?
virtual void close() override
Shut down the current session together with all associated services.