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)
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 
41 #ifndef MOBJECT_SESSION_H
42 #define MOBJECT_SESSION_H
43 
47 #include "lib/ref-array.hpp"
48 #include "lib/depend.hpp"
49 #include "lib/symbol.hpp"
50 #include "lib/p.hpp"
51 
52 #include <memory>
53 
54 
55 
56 namespace steam {
57 namespace asset {
58  class Timeline; typedef lib::P<Timeline> PTimeline;
59  class Sequence; typedef lib::P<Sequence> PSequence;
60 }
61 namespace fixture {
62  class Fixture;
63  using PFixture = std::shared_ptr<Fixture>;
64 }
65 
66 namespace mobject {
67 
68  namespace session {
69  class SessManager;
70  class ElementQuery;
71  }
72 
74 
75 
100  class Session
102  {
103  protected:
108 
109 
110  Session (DefaultsAccess,
111  ElementsAccess,
112  TimelineAccess,
113  SequenceAccess) noexcept;
114  virtual ~Session ();
115 
116 
117  public:
118  static bool initFlag;
119 
121 
122  DefaultsAccess defaults;
123  ElementsAccess elements;
124  TimelineAccess timelines;
125  SequenceAccess sequences;
126 
127  virtual bool isValid () = 0;
128  virtual MObjectRef attach (PMO const& placement) = 0;
129  virtual bool detach (PMO const& placement) = 0;
130 
131  virtual MObjectRef getRoot() = 0;
132 
133  virtual fixture::PFixture& getFixture () = 0;
134  virtual void rebuildFixture () = 0;
135 
136  };
137 
138 
139  extern const char* ON_SESSION_START;
140  extern const char* ON_SESSION_INIT;
141  extern const char* ON_SESSION_READY;
142  extern const char* ON_SESSION_CLOSE;
143  extern const char* ON_SESSION_END;
144 
145 
146  namespace session {
147 
154  {
155  public:
157  virtual bool isUp () =0;
158 
164  virtual void clear () =0;
165 
172  virtual void close () =0;
173 
177  virtual void reset () =0;
178 
182  virtual void load () =0;
183 
189  virtual void save (string snapshotID) =0;
190 
195  virtual Session* operator-> () noexcept =0;
196 
197  virtual ~SessManager();
198  };
199 
200 
201  LUMIERA_ERROR_DECLARE (CREATE_SESSION);
202 
203 
204  } // namespace mobject::session
205 
206 }} // namespace steam::mobject
207 #endif
IterQueue< T > elements(T const &elm)
convenience free function to build an iterable sequence
Definition: iter-stack.hpp:292
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:87
An active (smart-ptr like) external reference to a specifically placed MObject "instance" within the ...
Definition: mobject-ref.hpp:85
Core abstraction: placement of a media object into session context.
Any copy and copy construction prohibited.
Definition: nocopy.hpp:37
Customised refcounting smart pointer.
#define LUMIERA_ERROR_DECLARE(err)
Forward declare an error constant.
Definition: error.h:62
static session::SessManager & current
access point to the current Session
Definition: session.hpp:120
Steam-Layer implementation namespace root.
DefaultsAccess defaults
manages default configured objects
Definition: session.hpp:122
Namespace of Session and user visible high-level objects.
Definition: sequence.hpp:65
session::SessManager & PSess
acts as a "PImpl" smart ptr
Definition: session.hpp:73
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:100
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:106
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:152
SequenceAccess sequences
collection of sequences
Definition: session.hpp:125
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:95
Customised refcounting smart pointer template, built upon std::shared_ptr, but forwarding type relati...
Definition: trait.hpp:71
static bool initFlag
temporary fix for init problems
Definition: session.hpp:118
const char * ON_SESSION_END
LifecycleHook, to perform any state saving, deregistration or de-activation necessary before bringing...
Definition: session.cpp:125
The asset subsystem of the Steam-Layer.
Definition: wrapperptr.hpp:35
const char * ON_SESSION_CLOSE
LifecycleHook, to commence any activity relying on an opened and fully operative session.
Definition: session.cpp:115
Access point to session global search and query functions.
TimelineAccess timelines
collection of timelines (top level)
Definition: session.hpp:124