Lumiera  0.pre.03
»edit your freedom«
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 
34 namespace steam {
35 namespace mobject {
36 namespace 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 
88  ~ScopeLocator();
89 
90  protected:
91  ScopeLocator();
92 
94 
95  private:
97  };
98 
99 
100 
101 
105  template<typename MO>
106  inline typename ScopeQuery<MO>::iterator
108  {
109  return ScopeQuery<MO> (scope.getTop(), CHILDREN).resolveBy (theResolver());
110  }
111 
112 
116  template<typename MO>
117  inline typename ScopeQuery<MO>::iterator
118  ScopeLocator::query (Scope const& scope)
119  {
120  return ScopeQuery<MO> (scope.getTop(), CONTENTS).resolveBy (theResolver());
121  }
122 
123 
133  template<typename MO>
134  inline typename ScopeQuery<MO>::iterator
136  {
137  return ScopeQuery<MO> (scope.getTop(), PATH).resolveBy (theResolver());
138  }
139 
141  ScopeLocator::getRawPath (Scope const& scope)
142  {
143  return ScopeQuery<MObject> (scope.getTop(), PATH).resolveBy (theResolver());
144  }
145 
146 
147 }}} // namespace steam::mobject::session
148 #endif
Query a scope to discover it&#39;s contents or location.
Interface: a facility for resolving (some kind of) queries A concrete subclass has the ability to cre...
ScopeQuery< MO >::iterator explore(Scope const &)
use the contents-resolving facility exposed by the session to enumerate the contents (children) of th...
Core abstraction: placement of a media object into session context.
discover any contained objects depth-first
Steam-Layer implementation namespace root.
Namespace of Session and user visible high-level objects.
Definition: sequence.hpp:65
Access point to singletons and other kinds of dependencies designated by type.
Definition: depend.hpp:280
Sequence of nested scopes within the high-level model.
Definition: scope-path.hpp:126
A Placement scope within the high-level-model.
Definition: scope.hpp:69
Singleton service establishing a link to relate any compound of nested placement scopes to the curren...
discover the path to root
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...
ScopeQuery< MO >::iterator query(Scope const &)
use the contents-resolving facility exposed by the session to discover depth-first any object within ...
lib::IterSource< const Scope >::iterator locate(Scope const &target)
navigate the current QueryFocus scope location.
Definition: scope.cpp:173
Singleton services and Dependency Injection.
ScopePath & pushPath()
push aside the current focus location and open a new ScopePath frame, to serve as current location un...
Definition: scope.cpp:154
ScopePath & currPath()
establishes the current query focus location.
Definition: scope.cpp:143
Specific queries to explore contents of a scope within the high-level model.
Helper to abstract creation and lifecycle of a dependency.
Definition: depend.hpp:125
static lib::Depend< ScopeLocator > instance
Storage holding the single ScopeLocator instance.
discover the immediate children
Extension module to build an opaque data source, accessible as Lumiera Forward Iterator.
Adapter for building an implementation of the »Lumiera Forward Iterator« concept. ...