Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
session-services.cpp
Go to the documentation of this file.
1/*
2 SessionServices - accessing Steam-Layer internal session implementation services
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
40
44
46#include "lib/symbol.hpp"
47
48using lib::Symbol;
49
50namespace steam {
51namespace mobject {
52namespace session {
53
57 bool
63
68 bool
69 SessionServiceFetch::isRegisteredID (PlacementMO::ID const& placementID)
70 {
71 return SessionImplAPI::current->isRegisteredID (placementID);
72 }
73
74
86 SessionServiceFetch::resolveID (PlacementMO::ID const& placementID)
87 {
88 return SessionImplAPI::current->resolveID (placementID);
89 }
90
91
99 PlacementMO::ID const&
101 {
102 return SessionImplAPI::current->insertCopy (newPlacement,scope);
103 }
104
105
111 bool
113 {
114 return SessionImplAPI::current->purgeScopeRecursively (scope);
115 }
116
117
123 bool
125 {
126 return SessionImplAPI::current->detachElement (leafElement);
127 }
128
129
130
131
132 namespace { // deleter function to clean up test/mock PlacementIndex
133 void
135 {
136 REQUIRE (testIdx);
137 SessionImplAPI::current->reset_PlacementIndex(); // restore default Index from Session
138
139 testIdx->clear();
140 ASSERT (0 == testIdx->size());
141 delete testIdx;
142 }
143 }
144
146 PPIdx
148 {
149 Symbol typeID ("dummyRoot");
150 PMO dummyRoot (MObject::create (typeID));
151 PPIdx mockIndex (new PlacementIndex(dummyRoot), &remove_testIndex); // manage instance lifecycle
152 ENSURE (mockIndex);
153 ENSURE (mockIndex->isValid());
154 ENSURE (1 == mockIndex.use_count());
155
156 SessionImplAPI::current->reset_PlacementIndex (mockIndex.get());
157 return mockIndex;
158 }
159
160
162 QueryResolver const&
164 {
165 return SessionImplAPI::current->getScopeQueryResolver();
166 }
167
168
172 {
173 return SessionImplAPI::current->getScope(placementToLocate);
174 }
175
176
178 SessionServiceExploreScope::getScope (PlacementMO::ID const& placementToLocate)
179 {
180 return SessionImplAPI::current->getScope(placementToLocate);
181 }
182
183
187 {
188 return SessionImplAPI::current->getScopeRoot();
189 }
190
191
192
193}}} // namespace steam::mobject::session
Token or Atom with distinct identity.
Definition symbol.hpp:120
Interface: a facility for resolving (some kind of) queries A concrete subclass has the ability to cre...
static session::MObjectFactory create
Storage for the (single, static) MObject factory object.
Definition mobject.hpp:87
static bool initFlag
temporary fix for init problems
Definition session.hpp:118
static session::SessManager & current
access point to the current Session
Definition session.hpp:120
Structured compound of Placement instances with lookup capabilities.
void clear(ID targetScope)
recursively kill a complete scope, including the given element and all children.
virtual bool isUp()=0
diagnostics: session interface opened?
static bool isRegisteredID(PlacementMO::ID const &)
verify the given placement-ID (hash) is valid, by checking if it refers to a Placement instance curre...
static PlacementMO & resolveID(PlacementMO::ID const &)
actually retrieve a Placement tracked by the index.
static bool isAccessible()
is the element-fetch service usable? Effectively this means: is the session up?
static PPIdx install()
Re-define the implicit PlacementIndex temporarily, e.g.
static bool detach_and_clear(PID)
detach the denoted element from the model including all children.
static PID attach_toModel(PMO, PID)
attach an object by placement onto the session.
static bool detach(PID)
detach the denoted leaf element from the model.
Core factory to generate media objects for use in the Session model.
Namespace of Session and user visible high-level objects.
Definition sequence.hpp:65
std::shared_ptr< PlacementIndex > PPIdx
Steam-Layer implementation namespace root.
Implementation facility for session management.
Session and SessionServices Implementation classes.
Implementation level session API: to manage default configured objects.
Implementation level session API: query a scope.
Implementation level session API: resolve a Placement by hash-ID.
Implementation level session API: PlacementIndex mock for tests.
Implementation level session API: add or remove Session contents.
A mechanism for exposing and accessing implementation level services of the session.
static PlacementMO & getScope(PlacementMO const &)
static lumiera::QueryResolver const & getResolver()
Marker types to indicate a literal string and a Symbol.