Lumiera  0.pre.03
»edit your freedom«
session.hpp
Go to the documentation of this file.
1 /*
2  SESSION.hpp - 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 
50 #ifndef MOBJECT_SESSION_H
51 #define MOBJECT_SESSION_H
52 
56 #include "lib/ref-array.hpp"
57 #include "lib/depend.hpp"
58 #include "lib/symbol.hpp"
59 #include "lib/p.hpp"
60 
61 #include <memory>
62 
63 
64 
65 namespace steam {
66 namespace asset {
67  class Timeline; typedef lib::P<Timeline> PTimeline;
68  class Sequence; typedef lib::P<Sequence> PSequence;
69 }
70 namespace fixture {
71  class Fixture;
72  using PFixture = std::shared_ptr<Fixture>;
73 }
74 
75 namespace mobject {
76 
77  namespace session {
78  class SessManager;
79  class ElementQuery;
80  }
81 
83 
84 
109  class Session
111  {
112  protected:
117 
118 
119  Session (DefaultsAccess,
120  ElementsAccess,
121  TimelineAccess,
122  SequenceAccess) noexcept;
123  virtual ~Session ();
124 
125 
126  public:
127  static bool initFlag;
128 
130 
131  DefaultsAccess defaults;
132  ElementsAccess elements;
133  TimelineAccess timelines;
134  SequenceAccess sequences;
135 
136  virtual bool isValid () = 0;
137  virtual MObjectRef attach (PMO const& placement) = 0;
138  virtual bool detach (PMO const& placement) = 0;
139 
140  virtual MObjectRef getRoot() = 0;
141 
142  virtual fixture::PFixture& getFixture () = 0;
143  virtual void rebuildFixture () = 0;
144 
145  };
146 
147 
148  extern const char* ON_SESSION_START;
149  extern const char* ON_SESSION_INIT;
150  extern const char* ON_SESSION_READY;
151  extern const char* ON_SESSION_CLOSE;
152  extern const char* ON_SESSION_END;
153 
154 
155  namespace session {
156 
163  {
164  public:
166  virtual bool isUp () =0;
167 
173  virtual void clear () =0;
174 
181  virtual void close () =0;
182 
186  virtual void reset () =0;
187 
191  virtual void load () =0;
192 
198  virtual void save (string snapshotID) =0;
199 
204  virtual Session* operator-> () noexcept =0;
205 
206  virtual ~SessManager();
207  };
208 
209 
210  LUMIERA_ERROR_DECLARE (CREATE_SESSION);
211 
212 
213  } // namespace mobject::session
214 
215 }} // namespace steam::mobject
216 #endif
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
An active (smart-ptr like) external reference to a specifically placed MObject "instance" within the ...
Definition: mobject-ref.hpp:94
Core abstraction: placement of a media object into session context.
Any copy and copy construction prohibited.
Definition: nocopy.hpp:46
Customised refcounting smart pointer.
#define LUMIERA_ERROR_DECLARE(err)
Forward declare an error constant.
Definition: error.h:71
static session::SessManager & current
access point to the current Session
Definition: session.hpp:129
Steam-Layer implementation namespace root.
DefaultsAccess defaults
manages default configured objects
Definition: session.hpp:131
Namespace of Session and user visible high-level objects.
Definition: sequence.hpp:74
session::SessManager & PSess
acts as a "PImpl" smart ptr
Definition: session.hpp:82
Management of defaults and default rules.
The (current) Session holds all the user visible content to be edited and manipulated within the Lumi...
Definition: session.hpp:109
External MObject/Placement reference.
Organise a collection of preconfigured default objects.
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.
Abstraction interface: array-like access by subscript.
creation, access and Session lifecycle Interface.
Definition: session.hpp:161
SequenceAccess sequences
collection of sequences
Definition: session.hpp:134
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
Customised refcounting smart pointer template, built upon std::shared_ptr, but forwarding type relati...
Definition: trait.hpp:80
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
The asset subsystem of the Steam-Layer.
Definition: wrapperptr.hpp:44
const char * ON_SESSION_CLOSE
LifecycleHook, to commence any activity relying on an opened and fully operative session.
Definition: session.cpp:124
Access point to session global search and query functions.
TimelineAccess timelines
collection of timelines (top level)
Definition: session.hpp:133