Lumiera  0.pre.03
»edit your freedom«
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 
31 namespace lumiera {
32 namespace error {
33  LUMIERA_ERROR_DECLARE (EMPTY_SCOPE_PATH);
34  LUMIERA_ERROR_DECLARE (NO_PARENT_SCOPE);
35  LUMIERA_ERROR_DECLARE (INVALID_SCOPE);
36 }}
37 
38 namespace steam {
39 namespace mobject {
40 namespace session {
41 
42 
43 
69  class Scope
70  {
71  RefPlacement anchor_;
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
Core abstraction: placement of a media object into session context.
#define LUMIERA_ERROR_DECLARE(err)
Forward declare an error constant.
Definition: error.h:62
Steam-Layer implementation namespace root.
Namespace of Session and user visible high-level objects.
Definition: sequence.hpp:65
A Placement scope within the high-level-model.
Definition: scope.hpp:69
A generic reference mechanism for Placements, as added to the current session.
static const Scope INVALID
constant invalid scope token.
Definition: scope.hpp:83
Lumiera error handling (C++ interface).
Lumiera public interface.
Definition: advice.cpp:104