Lumiera  0.pre.03
»edityourfreedom«
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
dispatcher.hpp
Go to the documentation of this file.
1 /*
2  DISPATCHER.hpp - translating calculation streams into frame jobs
3 
4  Copyright (C) Lumiera.org
5  2011, 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 
35 #ifndef PROC_ENGINE_DISPATCHER_H
36 #define PROC_ENGINE_DISPATCHER_H
37 
38 #include "proc/common.hpp"
44 #include "lib/time/timevalue.hpp"
45 
46 #include <functional>
47 
48 
49 namespace proc {
50 namespace engine {
51 
52  using std::function;
53  using mobject::ModelPort;
54  using lib::time::FrameCnt;
55  using lib::time::TimeSpan;
56  using lib::time::FSecs;
57  using lib::time::Time;
58 
59 
83  class Dispatcher
84  : public FrameLocator
85  {
86  struct JobBuilder
87  {
89  ModelPort modelPort_;
90  uint channel_;
91 
92  FrameCoord relativeFrameLocation (TimeAnchor& refPoint, FrameCnt frameCountOffset =0);
93 
96  {
97  return JobPlanningSequence(
98  relativeFrameLocation(refPoint),
99  *dispatcher_);
100  }
101  };
102 
103 
104  public:
105  virtual ~Dispatcher();
106 
107  JobBuilder onCalcStream (ModelPort modelPort, uint channel);
108 
109 
110  protected:
116  virtual FrameCoord locateRelative (FrameCoord const&, FrameCnt frameOffset) =0;
117 
118  virtual bool isEndOfChunk (FrameCnt, ModelPort port) =0;
119 
123 
126 
128 
133 
137 
138  virtual JobTicket& accessJobTicket (ModelPort, TimeValue nominalTime) =0;
139  };
140 
141 
142 
143 }} // namespace proc::engine
144 #endif
Organising the output data calculation possibilities.
The "mechanics" of discovering and planning frame calculation jobs.
int64_t FrameCnt
Definition: job.h:94
Execution plan to generate render jobs within a specific render process.
virtual JobTicket & accessJobTicket(ModelPort, TimeValue nominalTime)=0
virtual FrameCoord locateRelative(FrameCoord const &, FrameCnt frameOffset)=0
core dispatcher operation: based on the coordinates of a reference point, establish binding frame num...
Basic set of definitions and includes commonly used together.
The process of playback or rendering is a continued series of exploration and evaluation.
Definition: time-anchor.hpp:97
FrameCoord relativeFrameLocation(TimeAnchor &refPoint, FrameCnt frameCountOffset=0)
Definition: dispatcher.cpp:54
boost::rational< long > FSecs
rational representation of fractional seconds
Definition: timevalue.hpp:205
Abstraction: a Facility to establish frame coordinates and identify and access the execution plan for...
Representation of a continuation point for planning the render process.
virtual ~Dispatcher()
this is an interface
Definition: dispatcher.cpp:39
Internal abstraction: a service within the engine for translating a logical calculation stream (corre...
Definition: dispatcher.hpp:83
This iterator represents a pipeline to pull planned jobs from.
effective coordinates of a frame to be calculated.
Definition: frame-coord.hpp:65
int64_t FrameCnt
relative framecount or frame number.
Definition: digxel.hpp:321
A time interval anchored at a specific point in time.
Definition: timevalue.hpp:467
Proc-Layer implementation namespace root.
Definition: id-scheme.hpp:63
JobBuilder onCalcStream(ModelPort modelPort, uint channel)
Definition: dispatcher.cpp:45
Tuple data type to address distinct frames within the render engine calculations. ...
a family of time value like entities and their relationships.
virtual bool isEndOfChunk(FrameCnt, ModelPort port)=0
basic constant internal time value.
Definition: timevalue.hpp:80
JobPlanningSequence establishNextJobs(TimeAnchor &refPoint)
Definition: dispatcher.hpp:95
execution plan for pulling a specific exit node.
Definition: job-ticket.hpp:84