Lumiera  0.pre.03
»edit your freedom«
session.cpp
Go to the documentation of this file.
1 /*
2  Session - holds the complete session to be edited by the user
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 
37 //#include "common/query/defs-manager.hpp"
38 
39 #include "lib/symbol.hpp"
40 #include "lib/depend.hpp"
41 
42 
43 
44 namespace steam {
45 namespace mobject {
46 
47  using lib::Symbol;
51 
52 
53  namespace { // the global session manager instance...
54  lib::Depend<SessManagerImpl> theSessionManager;
55  }
56 
57 
61  bool Session::initFlag = false;
62 
63 
73  SessManager& Session::current = theSessionManager();
74 
75 
79  template<>
80  SessManagerImpl& SessionImplAPI::current = static_cast<SessManagerImpl&> (Session::current);
81 
82 
83 
84 
96  const char* ON_SESSION_START = "ON_SESSION_START";
97 
104  const char* ON_SESSION_INIT = "ON_SESSION_INIT";
105 
115  const char* ON_SESSION_READY = "ON_SESSION_READY";
116 
124  const char* ON_SESSION_CLOSE ="ON_SESSION_CLOSE";
125 
134  const char* ON_SESSION_END ="ON_SESSION_END";
135 
136 
137 
138 
139  Session::Session (DefaultsAccess defs
140  ,ElementsAccess quer
141  ,TimelineAccess tils
142  ,SequenceAccess seqs) noexcept
143  : defaults(defs)
144  , elements(quer)
145  , timelines(tils)
146  , sequences(seqs)
147  { }
148 
149 
150  // Emit the vtables and other magic stuff here...
151  SessManager::~SessManager() { }
152  Session::~Session () { }
153 
154 
155 
156 }} // namespace steam::mobject
IterQueue< T > elements(T const &elm)
convenience free function to build an iterable sequence
Definition: iter-stack.hpp:301
const char * ON_SESSION_START
LifecycleHook, to perform all the basic setup for a new session, prior to adding any specific data...
Definition: session.cpp:96
static session::SessManager & current
access point to the current Session
Definition: session.hpp:129
Steam-Layer implementation namespace root.
Access point to singletons and other kinds of dependencies designated by type.
Definition: depend.hpp:289
Token or Atom with distinct identity.
Definition: symbol.hpp:126
Implementation facility for session management.
const char * ON_SESSION_READY
LifecycleHook, to perform post loading tasks, requiring an already completely usable and configured s...
Definition: session.cpp:115
Marker types to indicate a literal string and a Symbol.
Session manager implementation class holding the actual smart pointer to the current Session impl...
creation, access and Session lifecycle Interface.
Definition: session.hpp:161
SessionServices< Types< SessionServiceFetch, SessionServiceMutate, SessionServiceExploreScope, SessionServiceMockIndex, SessionServiceDefaults >, SessManagerImpl, SessionImpl > SessionImplAPI
actual configuration of the session implementation compound: forming an inheritance chain of all inte...
Singleton services and Dependency Injection.
const char * ON_SESSION_INIT
LifecycleHook, to perform any initialisation, wiring and registrations necessary to get the session i...
Definition: session.cpp:104
Session and SessionServices Implementation classes.
static bool initFlag
temporary fix for init problems
Definition: session.hpp:127
const char * ON_SESSION_END
LifecycleHook, to perform any state saving, deregistration or de-activation necessary before bringing...
Definition: session.cpp:134
Primary Interface to the current Session.
const char * ON_SESSION_CLOSE
LifecycleHook, to commence any activity relying on an opened and fully operative session.
Definition: session.cpp:124