remove the parent-iteration capability from Scope
its not needed yet, and would be surprisingly tricky to implement, so lets get rid of it! Use QueryFocus or ScopeLocator instead
This commit is contained in:
parent
d5cdd39f52
commit
e14aba833e
4 changed files with 25 additions and 44 deletions
|
|
@ -25,6 +25,7 @@
|
|||
#define MOBJECT_SESSION_QUERY_FOCUS_H
|
||||
|
||||
#include "proc/mobject/session/scope-path.hpp"
|
||||
#include "proc/mobject/session/scope-query.hpp"
|
||||
#include "proc/mobject/session/scope-locator.hpp"
|
||||
|
||||
#include <boost/intrusive_ptr.hpp>
|
||||
|
|
|
|||
|
|
@ -74,8 +74,7 @@ namespace session {
|
|||
typename ScopeQuery<MO>::iterator
|
||||
query (Scope);
|
||||
|
||||
template<typename MO>
|
||||
typename ScopeQuery<MO>::iterator
|
||||
ScopeQuery<MObject>::iterator
|
||||
locate (Scope scope);
|
||||
|
||||
ScopeQuery<MObject>::iterator
|
||||
|
|
@ -117,29 +116,6 @@ namespace session {
|
|||
return ScopeQuery<MO> (scope.getTop(), CONTENTS).resolveBy (theResolver());
|
||||
}
|
||||
|
||||
|
||||
/** navigate the \em current QueryFocus scope location. The resulting
|
||||
* access path to the new location is chosen such as to be most closely related
|
||||
* to the original location; this includes picking a timeline or meta-clip
|
||||
* attachment most similar to the one used in the original path. So effectively
|
||||
* you'll see things through the same "scoping perspective" as given by the
|
||||
* original path, if possible to the new location
|
||||
* given as parameter. use the contents-resolving facility exposed by the session
|
||||
* @note changes the \em current QueryFocus as a sideeffect
|
||||
* @param scope the new target location to navigate
|
||||
* @return an iterator yielding the nested scopes from the new location
|
||||
* up to root, in a way likely to be similar to the original location
|
||||
*/
|
||||
template<typename MO>
|
||||
inline typename ScopeQuery<MO>::iterator
|
||||
ScopeLocator::locate (Scope scope)
|
||||
{
|
||||
UNIMPLEMENTED ("virtual navigation");
|
||||
///////////////////////////////////////////TODO: see scope-query.hpp
|
||||
///////////////////////////////////////////TODO: its hard to come up with a generic implementation which yields a compatible iterator
|
||||
///////////////////////////////////////////TODO: *alternatively* just expose an Iterator of Scopes?
|
||||
}
|
||||
|
||||
|
||||
/** use the contents-resolving facility exposed by the session
|
||||
* to discover the path up from the given scope to model root.
|
||||
|
|
|
|||
|
|
@ -122,6 +122,28 @@ namespace session {
|
|||
return focusStack_->push (SessionServiceExploreScope::getScopeRoot());
|
||||
}
|
||||
|
||||
|
||||
/** navigate the \em current QueryFocus scope location. The resulting
|
||||
* access path to the new location is chosen such as to be most closely related
|
||||
* to the original location; this includes picking a timeline or meta-clip
|
||||
* attachment most similar to the one used in the original path. So effectively
|
||||
* you'll see things through the same "scoping perspective" as given by the
|
||||
* original path, if possible to the new location
|
||||
* given as parameter. use the contents-resolving facility exposed by the session
|
||||
* @note changes the \em current QueryFocus as a sideeffect
|
||||
* @param scope the new target location to navigate
|
||||
* @return an iterator yielding the nested scopes from the new location
|
||||
* up to root, in a way likely to be similar to the original location
|
||||
*/
|
||||
ScopeQuery<MObject>::iterator
|
||||
ScopeLocator::locate (Scope scope)
|
||||
{
|
||||
UNIMPLEMENTED ("virtual navigation");
|
||||
///////////////////////////////////////////TODO: see scope-query.hpp
|
||||
///////////////////////////////////////////TODO: its hard to come up with a generic implementation which yields a compatible iterator
|
||||
///////////////////////////////////////////TODO: *alternatively* just expose an Iterator of Scopes?
|
||||
}
|
||||
|
||||
|
||||
|
||||
/** discover the enclosing scope of a given Placement */
|
||||
|
|
@ -175,17 +197,6 @@ namespace session {
|
|||
}
|
||||
|
||||
|
||||
/** enumerate the path of nested scopes up to root scope.
|
||||
* @return an iterator which starts with this scope and
|
||||
* successively yields outer scopes, stopping at root.
|
||||
*/
|
||||
Scope::IterType_
|
||||
Scope::ascend() const
|
||||
{
|
||||
UNIMPLEMENTED ("ascend scope hierarchy up to root");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
#include "proc/mobject/placement.hpp"
|
||||
#include "proc/mobject/placement-ref.hpp"
|
||||
//#include "proc/mobject/session/query-resolver.hpp" ///////////TODO: really?
|
||||
#include "lib/iter-adapter.hpp"
|
||||
//#include "lib/iter-adapter.hpp"
|
||||
#include "lib/error.hpp"
|
||||
//#include "lib/singleton.hpp"
|
||||
|
||||
|
|
@ -44,8 +44,6 @@
|
|||
namespace mobject {
|
||||
namespace session {
|
||||
|
||||
using lib::IterAdapter;
|
||||
|
||||
LUMIERA_ERROR_DECLARE (INVALID_SCOPE); ///< Placement scope invalid and not locatable within model
|
||||
|
||||
|
||||
|
|
@ -61,8 +59,6 @@ namespace session {
|
|||
{
|
||||
RefPlacement anchor_;
|
||||
|
||||
typedef IterAdapter<PlacementMO*, Scope> IterType_;
|
||||
|
||||
public:
|
||||
Scope (PlacementMO const& constitutingPlacement);
|
||||
Scope (); ///< unlocated NIL scope
|
||||
|
|
@ -78,9 +74,6 @@ namespace session {
|
|||
bool isValid() const;
|
||||
bool isRoot() const;
|
||||
|
||||
typedef IterType_ iterator;
|
||||
iterator ascend() const;
|
||||
|
||||
friend bool operator== (Scope const&, Scope const&);
|
||||
friend bool operator!= (Scope const&, Scope const&);
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue