Lumiera  0.pre.03
»edit your freedom«
locatingpin.hpp
Go to the documentation of this file.
1 /*
2  LOCATINGPIN.hpp - Chaining and constraining the Placement of a Media Object
3 
4  Copyright (C) Lumiera.org
5  2008, Hermann Vosseler <Ichthyostega@web.de>
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of
10  the License, or (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 
21 */
22 
23 
46 #ifndef STEAM_MOBJECT_SESSION_LOCATINGPIN_H
47 #define STEAM_MOBJECT_SESSION_LOCATINGPIN_H
48 
49 
50 #include "steam/common.hpp"
51 #include "lib/time/timevalue.hpp"
52 
53 #include <utility>
54 #include <memory>
55 
56 
57 
58 
59 namespace steam {
60 namespace asset { class Pipe; }
61 
62 namespace mobject {
63 
64  class MObject;
65 
67 //
68 //template<class MO, class B=MObject>
69 //class Placement ;
70 //typedef Placement<MObject> PMO;
71 
72  template<class MO>
73  class PlacementRef;
74 
76 
77 
78  namespace session {
79 
80  class FixedLocation;
81  class RelativeLocation;
82 
83 
84 
98  {
99  protected:
100  typedef lib::time::Time Time;
101  typedef lib::time::TimeVar TimeVar;
102  typedef lib::time::Offset Offset;
103  typedef Time* Fork; //TODO dummy declaration; we don't use Tracks as first-class entity any longer. This role should be taken by the "Output Designation"
105  typedef std::pair<Time,Pipe> SolutionData; //TICKET #100 (ichthyo considers better passing of solution by subclass)
107 
109  std::unique_ptr<LocatingPin> next_;
110 
112  virtual int getPrioLevel () const { return 0; }
113 
114  LocatingPin& addChain (LocatingPin*);
115  void resolve (LocatingSolution&) const;
116  virtual void intersect (LocatingSolution&) const;
117 
118  public:
119  const SolutionData resolve () const;
120  bool isOverdetermined () const;
121 
122  /* Factory functions for adding LocatingPins */
123 
124  FixedLocation& operator() (Time start, Fork track=0);
125  RelativeLocation& operator() (PlacementRef<MObject>& refObj, Offset const& offset=Offset(Time::ZERO));
126 
127  LocatingPin (const LocatingPin&);
128  LocatingPin& operator= (const LocatingPin&);
129  virtual LocatingPin* clone () const;
130 
131  virtual ~LocatingPin() {};
132 
133 // protected:
134  LocatingPin () {};
135 
136 //TODO (for working out the buildable interface; ctor should be protected)
137 protected:
138 
139 // friend class Placement<MObject>;
140 
150  {
151  TimeVar minTime;
152  TimeVar maxTime;
153  Fork minTrack; // TODO don't use Tracks
154  Fork maxTrack;
155  bool impo;
156 
157  LocatingSolution ()
158  : minTime(Time::MIN), // TODO: better implementation of "unspecified..."
159  maxTime(Time::MAX),
160  minTrack(0), // TODO
161  maxTrack(0),
162  impo(false)
163  { }
164 
165  Time getTime ();
166  Pipe getPipe ();
167 
168  bool is_definite ();
169  bool is_impossible ();
170  bool still_to_solve ();
171 
172  };
173 
174  friend bool operator== (LocatingPin const&, LocatingPin const&);
175 
176  };
177 
178 
181  inline bool
182  operator== (LocatingPin const& pin1, LocatingPin const& pin2)
183  {
185  return pin1.resolve().first == pin2.resolve().first;
186  }
187 
188 
189 
190 }}} // namespace steam::mobject::session
191 #endif
Reference tag denoting a placement attached to the session.
a mutable time value, behaving like a plain number, allowing copy and re-accessing ...
Definition: timevalue.hpp:241
Basic set of definitions and includes commonly used together.
std::unique_ptr< LocatingPin > next_
next additional Pin, if any
Positioning specification, possibly chained to further specifications.
Definition: locatingpin.hpp:97
Steam-Layer implementation namespace root.
Namespace of Session and user visible high-level objects.
Definition: sequence.hpp:74
#define MAX(A, B)
the inevitable MAX macro, sometimes still necessary in template code
Definition: util.hpp:496
Lumiera&#39;s internal time value datatype.
Definition: timevalue.hpp:308
The most common case of positioning a MObject in the Session: directly specifying a constant position...
bool operator==(LocatingPin const &pin1, LocatingPin const &pin2)
check for equivalent definition of a complete locating chain
Offset measures a distance in time.
Definition: timevalue.hpp:367
virtual int getPrioLevel() const
order to consider when resolving.
a family of time value like entities and their relationships.
The asset subsystem of the Steam-Layer.
Definition: wrapperptr.hpp:44
PlacementRef< MObject > PlaRef
TODO: as of 5/09 the idea is to phase out direct dependency on the placement class and recast those d...
Definition: locatingpin.hpp:73
string resolve(fsys::path iniSpec)
use the general mechanism for resolving a search path to get the absolute path of the setup...
Definition: basic-setup.cpp:65