Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
scope-locator.hpp
Go to the documentation of this file.
1/*
2 SCOPE-LOCATOR.hpp - management and registration point for the QueryFocus-system
3
4 Copyright (C)
5 2009, 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
22#ifndef STEAM_MOBJECT_SESSION_SCOPE_LOCATOR_H
23#define STEAM_MOBJECT_SESSION_SCOPE_LOCATOR_H
24
28#include "lib/iter-source.hpp"
29#include "lib/depend.hpp"
30
31#include <memory>
32
33
34namespace steam {
35namespace mobject {
36namespace session {
37
38 class QueryFocusStack;
39 class ScopePath;
40
41
42
58 {
59 std::unique_ptr<QueryFocusStack> focusStack_;
60
61 public:
63
66
67 template<typename MO>
69 explore (Scope const&);
70
71 template<typename MO>
73 query (Scope const&);
74
75 template<typename MO>
77 getRawPath (Scope const&);
78
80 getRawPath (Scope const&);
81
83 locate (Scope const& target);
84
85 size_t stackSize() const;
86
87
89
90 protected:
92
94
95 private:
97 };
98
99
100
101
105 template<typename MO>
108 {
109 return ScopeQuery<MO> (scope.getTop(), CHILDREN).resolveBy (theResolver());
110 }
111
112
116 template<typename MO>
119 {
120 return ScopeQuery<MO> (scope.getTop(), CONTENTS).resolveBy (theResolver());
121 }
122
123
133 template<typename MO>
136 {
137 return ScopeQuery<MO> (scope.getTop(), PATH).resolveBy (theResolver());
138 }
139
142 {
143 return ScopeQuery<MObject> (scope.getTop(), PATH).resolveBy (theResolver());
144 }
145
146
147}}} // namespace steam::mobject::session
148#endif
Access point to singletons and other kinds of dependencies designated by type.
Definition depend.hpp:281
Helper to abstract creation and lifecycle of a dependency.
Definition depend.hpp:127
Interface: a facility for resolving (some kind of) queries A concrete subclass has the ability to cre...
iterator resolveBy(QueryResolver const &resolver) const
Singleton service establishing a link to relate any compound of nested placement scopes to the curren...
ScopeQuery< MO >::iterator query(Scope const &)
use the contents-resolving facility exposed by the session to discover depth-first any object within ...
lumiera::QueryResolver const & theResolver()
Definition scope.cpp:119
ScopeQuery< MO >::iterator getRawPath(Scope const &)
use the contents-resolving facility exposed by the session to discover the path up from the given sco...
lib::IterSource< constScope >::iterator locate(Scope const &target)
navigate the current QueryFocus scope location.
Definition scope.cpp:173
ScopePath & currPath()
establishes the current query focus location.
Definition scope.cpp:143
std::unique_ptr< QueryFocusStack > focusStack_
static lib::Depend< ScopeLocator > instance
Storage holding the single ScopeLocator instance.
ScopeQuery< MO >::iterator explore(Scope const &)
use the contents-resolving facility exposed by the session to enumerate the contents (children) of th...
ScopePath & pushPath()
push aside the current focus location and open a new ScopePath frame, to serve as current location un...
Definition scope.cpp:154
Sequence of nested scopes within the high-level model.
Query a scope to discover it's contents or location.
A Placement scope within the high-level-model.
Definition scope.hpp:70
Singleton services and Dependency Injection.
Extension module to build an opaque data source, accessible as Lumiera Forward Iterator.
Namespace of Session and user visible high-level objects.
Definition sequence.hpp:65
@ CONTENTS
discover any contained objects depth-first
@ CHILDREN
discover the immediate children
@ PATH
discover the path to root
Steam-Layer implementation namespace root.
Core abstraction: placement of a media object into session context.
Specific queries to explore contents of a scope within the high-level model.