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)
5  2008, 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 
37 #ifndef STEAM_MOBJECT_SESSION_LOCATINGPIN_H
38 #define STEAM_MOBJECT_SESSION_LOCATINGPIN_H
39 
40 
41 #include "steam/common.hpp"
42 #include "lib/time/timevalue.hpp"
43 
44 #include <utility>
45 #include <memory>
46 
47 
48 
49 
50 namespace steam {
51 namespace asset { class Pipe; }
52 
53 namespace mobject {
54 
55  class MObject;
56 
58 //
59 //template<class MO, class B=MObject>
60 //class Placement ;
61 //typedef Placement<MObject> PMO;
62 
63  template<class MO>
64  class PlacementRef;
65 
67 
68 
69  namespace session {
70 
71  class FixedLocation;
72  class RelativeLocation;
73 
74 
75 
89  {
90  protected:
91  typedef lib::time::Time Time;
93  typedef lib::time::Offset Offset;
94  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"
96  typedef std::pair<Time,Pipe> SolutionData; //TICKET #100 (ichthyo considers better passing of solution by subclass)
98 
100  std::unique_ptr<LocatingPin> next_;
101 
103  virtual int getPrioLevel () const { return 0; }
104 
105  LocatingPin& addChain (LocatingPin*);
106  void resolve (LocatingSolution&) const;
107  virtual void intersect (LocatingSolution&) const;
108 
109  public:
110  const SolutionData resolve () const;
111  bool isOverdetermined () const;
112 
113  /* Factory functions for adding LocatingPins */
114 
115  FixedLocation& operator() (Time start, Fork track=0);
116  RelativeLocation& operator() (PlacementRef<MObject>& refObj, Offset const& offset=Offset(Time::ZERO));
117 
118  LocatingPin (const LocatingPin&);
119  LocatingPin& operator= (const LocatingPin&);
120  virtual LocatingPin* clone () const;
121 
122  virtual ~LocatingPin() {};
123 
124 // protected:
125  LocatingPin () {};
126 
127 //TODO (for working out the buildable interface; ctor should be protected)
128 protected:
129 
130 // friend class Placement<MObject>;
131 
141  {
142  TimeVar minTime;
143  TimeVar maxTime;
144  Fork minTrack; // TODO don't use Tracks
145  Fork maxTrack;
146  bool impo;
147 
148  LocatingSolution ()
149  : minTime(Time::MIN), // TODO: better implementation of "unspecified..."
150  maxTime(Time::MAX),
151  minTrack(0), // TODO
152  maxTrack(0),
153  impo(false)
154  { }
155 
156  Time getTime ();
157  Pipe getPipe ();
158 
159  bool is_definite ();
160  bool is_impossible ();
161  bool still_to_solve ();
162 
163  };
164 
165  friend bool operator== (LocatingPin const&, LocatingPin const&);
166 
167  };
168 
169 
172  inline bool
173  operator== (LocatingPin const& pin1, LocatingPin const& pin2)
174  {
176  return pin1.resolve().first == pin2.resolve().first;
177  }
178 
179 
180 
181 }}} // namespace steam::mobject::session
182 #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:232
Basic set of definitions and includes commonly used together.
std::unique_ptr< LocatingPin > next_
next additional Pin, if any
Definition: locatingpin.hpp:97
Positioning specification, possibly chained to further specifications.
Definition: locatingpin.hpp:88
Steam-Layer implementation namespace root.
Namespace of Session and user visible high-level objects.
Definition: sequence.hpp:65
#define MAX(A, B)
the inevitable MAX macro, sometimes still necessary in template code
Definition: util.hpp:518
Lumiera&#39;s internal time value datatype.
Definition: timevalue.hpp:299
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:358
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:35
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:64
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:56