Lumiera  0.pre.03
»edityourfreedom«
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
calc-plan-continuation.cpp
Go to the documentation of this file.
1 /*
2  CalcPlanContinuation - closure for planning a chunk of jobs
3 
4  Copyright (C) Lumiera.org
5  2013, 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 
33 #include "lib/time/timevalue.hpp"
34 //#include "lib/frameid.hpp"
35 //#include "proc/state.hpp"
36 
37 #include <boost/functional/hash.hpp>
38 
39 
40 
41 namespace proc {
42 namespace engine {
43 
44 
48  void
50  {
51  ASSERT (parameter.nominalTime == timings_.getFrameStartAt (parameter.invoKey.frameNumber));
52 
53  this->performJobPlanningChunk (parameter.invoKey.frameNumber);
54  }
55 
56 
57  void
59  {
60  UNIMPLEMENTED ("what needs to be done when a planning continuation cant be invoked?");
61  }
62 
63 
64  bool
66  {
67  return timings_.isValid()
68  && Time::MIN < nominalTime && nominalTime < Time::MAX
69  && nominalTime == timings_.getFrameStartAt (invoKey.frameNumber);
70  }
71 
72 
73  size_t
75  {
76  return boost::hash_value (invoKey.frameNumber);
77  }
78 
79 
80 
81 
82 
83  Job
85  {
86  InvocationInstanceID invoKey;
87  invoKey.frameNumber = startFrame;
88  Time nominalPlanningStartTime = timings_.getFrameStartAt (startFrame);
89 
90  return Job(*this, invoKey, nominalPlanningStartTime);
91  }
92 
93 
94  void
96  {
97  TimeAnchor refPoint(timings_, nextStartFrame);
99  .establishNextJobs(refPoint);
100 
101  Job nextChunkOfPlanning = buildFollowUpJobFrom (refPoint);
102 
103  UNIMPLEMENTED ("the actual meat: access the scheduler and fed those jobs");
104  }
105 
106 
107  Job
109  {
110  return this->prepareRenderPlanningFrom(
111  refPoint.getNextAnchorPoint());
112  }
113 
114 
115 
116 
117 }} // namespace engine
JobFailureReason
Definition: job.h:88
int64_t FrameCnt
Definition: job.h:94
Execution plan to generate render jobs within a specific render process.
NoUsableHashDefinition hash_value(...)
declared for metaprogramming only, never defined
FrameCnt frameNumber
Definition: job.h:115
size_t hashOfInstance(InvocationInstanceID) const
Individual frame rendering task, forwarding to a closure.
Definition: job.h:248
Lumiera's internal time value datatype.
Definition: timevalue.hpp:226
The process of playback or rendering is a continued series of exploration and evaluation.
Definition: time-anchor.hpp:97
static const Time MIN
Definition: timevalue.hpp:237
Job buildFollowUpJobFrom(TimeAnchor const &refPoint)
Time getFrameStartAt(FrameCnt frameNr) const
Definition: timings.cpp:112
bool isValid() const
Consistency self-check.
Definition: timings.cpp:93
lumiera_jobParameter const & JobParameter
Definition: job.h:198
void signalFailure(JobParameter, JobFailureReason)
FrameCnt getNextAnchorPoint() const
set a follow-up TimeAnchor point.
opaque ID attached to each individual job invocation.
Definition: job.h:113
This iterator represents a pipeline to pull planned jobs from.
Job prepareRenderPlanningFrom(FrameCnt startFrame)
create the "start trigger job" Scheduling this job will effectively get a calculation stream into act...
void performJobPlanningChunk(FrameCnt nextStartFrame)
A specialised render job to care for the planning of the calculation process itself.
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.
static const Time MAX
Definition: timevalue.hpp:236
JobPlanningSequence establishNextJobs(TimeAnchor &refPoint)
Definition: dispatcher.hpp:95
void invokeJobOperation(JobParameter)
entry point (interface JobClosure): invoke the concrete job operation.
bool verify(Time, InvocationInstanceID) const