From db68577b4aac0dd11eb20dbe06fd4d60439e68bf Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sat, 18 Feb 2012 00:49:53 +0100 Subject: [PATCH] clarify relation of Job, JobTicket and channel number --- src/proc/engine/dispatcher.cpp | 2 +- src/proc/engine/dispatcher.hpp | 3 +-- src/proc/engine/frame-coord.hpp | 6 ++++++ src/proc/engine/job-ticket.hpp | 4 +++- src/proc/engine/job.hpp | 10 ++++++++-- src/proc/engine/time-anchor.hpp | 4 +++- .../proc/engine/dispatcher-interface-test.cpp | 15 ++++++++++++--- 7 files changed, 34 insertions(+), 10 deletions(-) diff --git a/src/proc/engine/dispatcher.cpp b/src/proc/engine/dispatcher.cpp index ff44d1f57..10307282b 100644 --- a/src/proc/engine/dispatcher.cpp +++ b/src/proc/engine/dispatcher.cpp @@ -35,7 +35,7 @@ namespace engine { /** */ JobTicket& - Dispatcher::accessJobTicket (FrameCoord const& frameID, mobject::ModelPort const& port) + Dispatcher::accessJobTicket (FrameCoord const& frameID) { UNIMPLEMENTED ("figure out and create the actual JobTicket, for the current segment and the given port"); } diff --git a/src/proc/engine/dispatcher.hpp b/src/proc/engine/dispatcher.hpp index ee255c384..3f06bb94b 100644 --- a/src/proc/engine/dispatcher.hpp +++ b/src/proc/engine/dispatcher.hpp @@ -26,7 +26,6 @@ #include "proc/common.hpp" //#include "proc/state.hpp" -#include "proc/mobject/model-port.hpp" #include "proc/engine/time-anchor.hpp" #include "proc/engine/frame-coord.hpp" #include "proc/engine/job-ticket.hpp" @@ -58,7 +57,7 @@ namespace engine { virtual FrameCoord locateFrameNext (uint frameCountOffset) =0; - JobTicket& accessJobTicket (FrameCoord const&, mobject::ModelPort const&); + JobTicket& accessJobTicket (FrameCoord const&); }; diff --git a/src/proc/engine/frame-coord.hpp b/src/proc/engine/frame-coord.hpp index 950874927..11b751bb1 100644 --- a/src/proc/engine/frame-coord.hpp +++ b/src/proc/engine/frame-coord.hpp @@ -26,6 +26,7 @@ #include "proc/common.hpp" //#include "proc/state.hpp" +#include "proc/mobject/model-port.hpp" #include "lib/time/timevalue.hpp" #include "lib/time/timequant.hpp" @@ -34,6 +35,7 @@ namespace proc { namespace engine { + using mobject::ModelPort; //using lib::time::TimeSpan; using lib::time::Duration; //using lib::time::FSecs; @@ -62,6 +64,10 @@ namespace engine { Time absoluteNominalTime; int64_t absoluteFrameNumber; + ModelPort modelPort; + uint channelNr; + + FrameCoord() { UNIMPLEMENTED ("anything regarding the Node Invocation"); diff --git a/src/proc/engine/job-ticket.hpp b/src/proc/engine/job-ticket.hpp index 61c03fedb..7dc2980f9 100644 --- a/src/proc/engine/job-ticket.hpp +++ b/src/proc/engine/job-ticket.hpp @@ -56,7 +56,9 @@ namespace engine { * which figures out everything to be done for generating data from this node. * To turn a JobTicket into an actual job, we need the additional information * regarding the precise frame number (=nominal time) and the channel number - * to calculate (in case the actual feed is multichannel, which is the default). + * to calculate (in case the actual feed is multichannel, which is the default). + * This way, the JobTicket acts as higher order function: a function + * generating on invocation another, specific function (= the job). * * @todo 1/12 WIP-WIP-WIP defining the invocation sequence and render jobs */ diff --git a/src/proc/engine/job.hpp b/src/proc/engine/job.hpp index 31b563889..592931ab5 100644 --- a/src/proc/engine/job.hpp +++ b/src/proc/engine/job.hpp @@ -117,8 +117,14 @@ namespace engine { * Frame rendering task, represented as closure. * This functor encodes all information necessary to actually * trigger and invoke the rendering operation. It will be embedded - * into a job descriptor and then enqueued with the scheduler for - * invocation just in time. + * by reference into a job descriptor and then enqueued with the scheduler + * for invocation just in time. The job interface exposes everything necessary + * to plan, handle, schedule and abort jobs. The implementation refers to the + * concrete "execution plan" encoded into the corresponding engine::JobTicket. + * The latter is embedded into the storage for segment of the low-level model + * and thus is shared for all frames and channels within this part of the + * timeline. Thus, the lumiera_jobParameter struct contains the "moving parts" + * changing for each individual job. * * @todo 1/12 WIP-WIP-WIP defining the invocation sequence and render jobs */ diff --git a/src/proc/engine/time-anchor.hpp b/src/proc/engine/time-anchor.hpp index 3144db1f2..f65f7fa30 100644 --- a/src/proc/engine/time-anchor.hpp +++ b/src/proc/engine/time-anchor.hpp @@ -26,6 +26,7 @@ #include "proc/common.hpp" //#include "proc/state.hpp" +#include "proc/mobject/model-port.hpp" #include "lib/time/timevalue.hpp" #include "proc/play/timings.hpp" @@ -34,6 +35,7 @@ namespace proc { namespace engine { + using mobject::ModelPort; // using lib::time::TimeSpan; // using lib::time::FSecs; // using lib::time::Time; @@ -67,7 +69,7 @@ namespace engine { // using default copy operations static TimeAnchor - build (play::Timings timings, uint64_t startFrame, uint channel) + build (play::Timings timings, uint64_t startFrame, ModelPort modelPort, uint channel) { UNIMPLEMENTED ("representation of the Time Anchor closure"); } diff --git a/tests/components/proc/engine/dispatcher-interface-test.cpp b/tests/components/proc/engine/dispatcher-interface-test.cpp index 8b528c699..96d4f6383 100644 --- a/tests/components/proc/engine/dispatcher-interface-test.cpp +++ b/tests/components/proc/engine/dispatcher-interface-test.cpp @@ -119,7 +119,7 @@ namespace test { /** @test perform the basic dispatch step - * and verify the generated frame coordinates + * and verify the generated frame coordinates */ void verify_basicDispatch() @@ -130,17 +130,26 @@ namespace test { uint startFrame(10); uint channel(0); - TimeAnchor refPoint = TimeAnchor::build (timings, startFrame, channel); + TimeAnchor refPoint = TimeAnchor::build (timings, startFrame, modelPort, channel); CHECK (refPoint == Time::ZERO + Duration(10, FrameRate::PAL)); FrameCoord coordinates = dispatcher.locateFrameNext (15); CHECK (coordinates.absoluteNominalTime == Time(0,1)); CHECK (coordinates.absoluteFrameNumber == 25); CHECK (coordinates.remainingRealTime() >= Time(FSecs(24,25))); + CHECK (coordinates.modelPort == modelPort); + CHECK (coordinates.channelNr == channel); - JobTicket& executionPlan = dispatcher.accessJobTicket (coordinates, modelPort); + JobTicket& executionPlan = dispatcher.accessJobTicket (coordinates); CHECK (executionPlan.isValid()); + #if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #880 + JobTicket::JobsPlanning jobs = executionPlan.createJobsFor (coordinates); + CHECK (!isnil (jobs)); + + Job headJob = *jobs; + CHECK (headJob.getNominalTime() == coordinates.absoluteNominalTime); + CHECK (0 < headJob.getInvocationInstanceID()); #endif /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #880 }