Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
scope.hpp
Go to the documentation of this file.
1/*
2 SCOPE.hpp - nested search scope for properties of placement
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
21#ifndef STEAM_MOBJECT_SESSION_SCOPE_H
22#define STEAM_MOBJECT_SESSION_SCOPE_H
23
26#include "lib/error.hpp"
27
28#include <string>
29
30
31namespace lumiera {
32namespace error {
33 LUMIERA_ERROR_DECLARE (EMPTY_SCOPE_PATH);
34 LUMIERA_ERROR_DECLARE (NO_PARENT_SCOPE);
35 LUMIERA_ERROR_DECLARE (INVALID_SCOPE);
36}}
37
38namespace steam {
39namespace mobject {
40namespace session {
41
42
43
69 class Scope
70 {
72
73 public:
74 Scope (PlacementMO const& constitutingPlacement);
75 Scope ();
76
77 explicit
78 Scope (PlacementMO::ID const& constitutingPlacement);
79
80 Scope (Scope const&);
81 Scope& operator= (Scope const&);
82
83 static const Scope INVALID;
84
85 static Scope containing (PlacementMO const& aPlacement);
86 static Scope containing (RefPlacement const& refPlacement);
87
88 operator std::string() const;
89 Scope getParent() const;
90 PlacementMO& getTop() const;
91 bool isValid() const;
92 bool isRoot() const;
93
94 friend bool operator== (Scope const&, Scope const&);
95 friend bool operator!= (Scope const&, Scope const&);
96 };
97
98
99
100
101
106 inline bool
107 operator== (Scope const& scope1, Scope const& scope2)
108 {
109 return scope1.anchor_ == scope2.anchor_;
110 }
111
112 inline bool
113 operator!= (Scope const& scope1, Scope const& scope2)
114 {
115 return scope1.anchor_ != scope2.anchor_;
116 }
117
118
119
120
121}}} // namespace steam::mobject::session
122#endif
A Placement scope within the high-level-model.
Definition scope.hpp:70
static Scope containing(PlacementMO const &aPlacement)
discover the enclosing scope of a given Placement
Definition scope.cpp:184
Scope & operator=(Scope const &)
Definition scope.cpp:88
PlacementMO & getTop() const
Definition scope.cpp:198
Scope getParent() const
retrieve the parent scope which encloses this scope.
Definition scope.cpp:209
friend bool operator==(Scope const &, Scope const &)
as scopes are constituted by a "scope top" element (placement) registered within the PlacementIndex o...
Definition scope.hpp:107
Scope()
unlocated NIL scope
Definition scope.cpp:73
bool isValid() const
check if this scope can be located.
Definition scope.cpp:231
friend bool operator!=(Scope const &, Scope const &)
Definition scope.hpp:113
static const Scope INVALID
constant invalid scope token.
Definition scope.hpp:83
#define LUMIERA_ERROR_DECLARE(err)
Forward declare an error constant.
Definition error.h:62
Lumiera error handling (C++ interface).
Lumiera public interface.
Definition advice.hpp:102
Namespace of Session and user visible high-level objects.
Definition sequence.hpp:65
bool operator==(LocatingPin const &pin1, LocatingPin const &pin2)
check for equivalent definition of a complete locating chain
bool operator!=(ScopePath const &path1, ScopePath const &path2)
Steam-Layer implementation namespace root.
A generic reference mechanism for Placements, as added to the current session.
Core abstraction: placement of a media object into session context.