From 0320bc4b2ca7f7df6f506c08bc882dfa7a237d69 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Fri, 27 Apr 2012 18:59:08 +0200 Subject: [PATCH] considering the relation of Job and JobClosure --- src/proc/engine/frame-coord.hpp | 1 + src/proc/engine/job-ticket.hpp | 7 +++++++ src/proc/engine/job.cpp | 13 +++++++++++++ src/proc/engine/job.hpp | 13 +++---------- .../proc/engine/dispatcher-interface-test.cpp | 4 ++-- 5 files changed, 26 insertions(+), 12 deletions(-) diff --git a/src/proc/engine/frame-coord.hpp b/src/proc/engine/frame-coord.hpp index 3eec79c19..c211b1193 100644 --- a/src/proc/engine/frame-coord.hpp +++ b/src/proc/engine/frame-coord.hpp @@ -82,6 +82,7 @@ namespace engine { Duration remainingRealTime() { UNIMPLEMENTED ("deterine the real wall clock time amount left until deadline"); + ////////////////////////TODO the coordinates can't answer that question! Who else can? } diff --git a/src/proc/engine/job-ticket.hpp b/src/proc/engine/job-ticket.hpp index ef54308a9..7d6b973c9 100644 --- a/src/proc/engine/job-ticket.hpp +++ b/src/proc/engine/job-ticket.hpp @@ -57,6 +57,13 @@ namespace engine { { public: + JobKind + getJobKind() const + { + UNIMPLEMENTED ("representation of JobTicket and JobClosure"); + } + + bool verify (Time nominalJobTime) const { diff --git a/src/proc/engine/job.cpp b/src/proc/engine/job.cpp index 0af1b192f..bc7bd0bd9 100644 --- a/src/proc/engine/job.cpp +++ b/src/proc/engine/job.cpp @@ -73,6 +73,19 @@ namespace engine { } + /** find out about the classification of this job. + * Typically its not necessary for the normal scheduling of + * Jobs to know anything beyond the contents of the #lumiera_jobDescriptor, + * but the JobClosure is able to answer any additional introspection queries + */ + JobKind + Job::getKind() const + { + REQUIRE (isValid()); + myClosure(this).getJobKind(); + } + + /** Render Job self verification. * performs a parameter consistency check * including a call-back to the defining JobTicket diff --git a/src/proc/engine/job.hpp b/src/proc/engine/job.hpp index b8349bb98..2e60f3c98 100644 --- a/src/proc/engine/job.hpp +++ b/src/proc/engine/job.hpp @@ -67,8 +67,8 @@ typedef struct lumiera_jobClosure* LumieraJobClosure; */ struct lumiera_jobParameter_struct { - InvocationInstanceID invoKey; gavl_time_t nominalTime; + InvocationInstanceID invoKey; //////////////////////////////////////////////////////////////TODO: place an additional parameter value here, or make the instanceID globally unique? }; typedef struct lumiera_jobParameter_struct lumiera_jobParameter; @@ -78,8 +78,8 @@ typedef lumiera_jobParameter* LumieraJobParameter; /** complete definition of an individual job */ struct lumiera_jobDefinition_struct { - LumieraJobClosure jobClosure; - lumiera_jobParameter parameter; + LumieraJobClosure jobClosure; ///< type and context of the job, including the actual functor + lumiera_jobParameter parameter; ///< the "moving parts" for this individual invocation (Job) }; typedef struct lumiera_jobDefinition_struct lumiera_jobDefinition; @@ -184,13 +184,6 @@ using lib::time::Time; bool isValid() const; }; - - inline JobKind - Job::getKind() const - { - UNIMPLEMENTED ("need a better C-representation of the job"); - } - }} // namespace proc::engine diff --git a/tests/components/proc/engine/dispatcher-interface-test.cpp b/tests/components/proc/engine/dispatcher-interface-test.cpp index ab721989d..6c037b602 100644 --- a/tests/components/proc/engine/dispatcher-interface-test.cpp +++ b/tests/components/proc/engine/dispatcher-interface-test.cpp @@ -148,7 +148,7 @@ namespace test { .relativeFrameLocation (refPoint, 15); CHECK (coordinates.absoluteNominalTime == Time(0,1)); CHECK (coordinates.absoluteFrameNumber == 25); - CHECK (coordinates.remainingRealTime() < Time(FSecs(25,25))); + CHECK (coordinates.remainingRealTime() < Time(FSecs(25,25))); ////////////////////////TODO the coordinates can't answer that question! Who else can? CHECK (coordinates.remainingRealTime() >= Time(FSecs(24,25))); CHECK (coordinates.modelPort == modelPort); CHECK (coordinates.channelNr == channel); @@ -240,7 +240,7 @@ namespace test { uint nrJobs = timings.getPlanningChunkSize(); Duration frameDuration (1, FrameRate::PAL); - // the Continuation will be scheduled sufficiently ahead of the planning end + // the Continuation will be scheduled sufficiently ahead of the currently planned chunk's end CHECK (continuation.getNominalTime() < Time(refPoint) + (nrJobs-1) * frameDuration); // now invoke the rest of this test, which has been embedded into the continuation job.