Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
query-focus.hpp
Go to the documentation of this file.
1/*
2 QUERY-FOCUS.hpp - management of current scope within the Session
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
38#ifndef MOBJECT_SESSION_QUERY_FOCUS_H
39#define MOBJECT_SESSION_QUERY_FOCUS_H
40
45
46#include <boost/intrusive_ptr.hpp>
47#include <string>
48
49namespace steam {
50namespace mobject {
51namespace session {
52
53
54
103 {
104 boost::intrusive_ptr<ScopePath> focus_;
105
106 public:
107 QueryFocus();
108
109 ScopePath const& currentPath() const;
111 operator Scope() const;
112 operator string() const;
113
114 QueryFocus& shift (Scope const&);
115 static QueryFocus push (Scope const&);
116 static QueryFocus push ();
117 QueryFocus& reset ();
118 QueryFocus& pop ();
119
120
121 template<class MO>
123 query() const;
124
125 template<class MO>
127 explore() const;
128
130 locate (Scope const& toTarget);
131
132
133 private:
135 static ScopePath& currPath();
136 };
137
138
139
140
141
142
147 inline QueryFocus::operator Scope() const
148 {
149 return focus_->getLeaf();
150 }
151
158 inline ScopePath const&
160 {
161 return *focus_;
162 }
163
167 inline RefPlacement
169 {
170 return RefPlacement (focus_->getLeaf().getTop());
171 }
172
173
177 template<class MO>
180 {
181 return ScopeLocator::instance().query<MO> (*this);
182 }
183
184
188 template<class MO>
191 {
192 return ScopeLocator::instance().explore<MO> (*this);
193 }
194
195
205 QueryFocus::locate (Scope const& toTarget)
206 {
207 return ScopeLocator::instance().locate (toTarget);
208 }
209
210
211
212}}} // namespace steam::mobject::session
213#endif
Current focus location to use as point-of reference for contents and location discovery queries.
lib::IterSource< constScope >::iterator locate(Scope const &toTarget)
shift or navigate the current focus to point at the given target scope.
QueryFocus & shift(Scope const &)
shift this QueryFocus to a container-like scope, causing it to navigate, changing the current ScopePa...
QueryFocus()
create a new QueryFocus (handle) linked to the current focus for discovery queries.
ScopePath const & currentPath() const
QueryFocus & pop()
cease to use this specific reference to the current frame.
ScopeQuery< MO >::iterator query() const
discover depth-first any matching object within current focus.
ScopeQuery< MO >::iterator explore() const
discover any matching object contained as immediate Child within current focus.
QueryFocus & reset()
discard any state and navigate current focus path to model root
static QueryFocus push()
push the "current QueryFocus" aside and open a new focus frame, which starts out at the same location...
boost::intrusive_ptr< ScopePath > focus_
static lib::Depend< ScopeLocator > instance
Storage holding the single ScopeLocator instance.
Sequence of nested scopes within the high-level model.
A Placement scope within the high-level-model.
Definition scope.hpp:70
Namespace of Session and user visible high-level objects.
Definition sequence.hpp:65
PlacementRef< MObject > RefPlacement
frequently-used shorthand
Steam-Layer implementation namespace root.
A generic reference mechanism for Placements, as added to the current session.
Service to build the notion of a current location within the Sesison model.
An Object representing a sequence of nested scopes within the Session.
Specific queries to explore contents of a scope within the high-level model.