diff --git a/src/proc/engine/calc-plan-continuation.hpp b/src/proc/engine/calc-plan-continuation.hpp index 4bb246408..834c6d732 100644 --- a/src/proc/engine/calc-plan-continuation.hpp +++ b/src/proc/engine/calc-plan-continuation.hpp @@ -131,7 +131,7 @@ namespace engine { invoKey.frameNumber = startFrame; Time nominalPlanningStartTime = timings_.getFrameStartAt (startFrame); - return Job(this, invoKey, nominalPlanningStartTime); + return Job(*this, invoKey, nominalPlanningStartTime); } diff --git a/src/proc/engine/dispatcher.cpp b/src/proc/engine/dispatcher.cpp index 07ee667ce..463d2124b 100644 --- a/src/proc/engine/dispatcher.cpp +++ b/src/proc/engine/dispatcher.cpp @@ -44,7 +44,7 @@ namespace engine { /** */ FrameCoord - Dispatcher::JobBuilder::relativeFrameLocation (TimeAnchor refPoint, uint frameCountOffset) + Dispatcher::JobBuilder::relativeFrameLocation (TimeAnchor& refPoint, uint frameCountOffset) { UNIMPLEMENTED ("build coordinates of frame to render"); } diff --git a/src/proc/engine/dispatcher.hpp b/src/proc/engine/dispatcher.hpp index 0ff4c0f57..6d3c59ebd 100644 --- a/src/proc/engine/dispatcher.hpp +++ b/src/proc/engine/dispatcher.hpp @@ -83,7 +83,7 @@ namespace engine { establishNextJobs (TimeAnchor& refPoint) { return JobPlanningSequence( - relativeFrameLocation(refPoint_), + relativeFrameLocation(refPoint), dispatcher_); } }; diff --git a/src/proc/engine/job.cpp b/src/proc/engine/job.cpp index 3ed4a674d..1c468dbfd 100644 --- a/src/proc/engine/job.cpp +++ b/src/proc/engine/job.cpp @@ -74,14 +74,14 @@ namespace engine { void Job::triggerJob() const { - myClosure(this).invokeJobOperation (parameter, currentTime); + myClosure(this).invokeJobOperation (parameter); } void Job::signalFailure() const { - myClosure(this).signalFailure (parameter, now); + myClosure(this).signalFailure (parameter); } @@ -106,7 +106,6 @@ namespace engine { Job::isValid() const { return this->jobClosure - && this->parameter.invoKey > 0 && myClosure(this).verify (getNominalTime()); } diff --git a/src/proc/engine/job.hpp b/src/proc/engine/job.hpp index 676d800e4..d9cafee82 100644 --- a/src/proc/engine/job.hpp +++ b/src/proc/engine/job.hpp @@ -143,62 +143,6 @@ namespace engine { typedef lumiera_jobParameter const& JobParameter; - class JobClosure; - - - /** - * Individual frame rendering task, forwarding to a closure. - * This functor encodes all information necessary to trigger - * and invoke the actual rendering operation. It will be embedded - * by value 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 one 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" - * different for each \em individual job. - * - * @todo 2/12 WIP-WIP-WIP defining the invocation sequence and render jobs - */ - class Job - : public lumiera_jobDefinition - { - - public: - - Job (JobClosure& specificJobDefinition - ,InvocationInstanceID invoKey - ,Time nominalFrameTime) - { - this->jobClosure = &specificJobDefinition; - this->parameter = {_raw(nominalFrameTime), invoKey }; - } - - // using standard copy operations - - - void triggerJob() const; - void signalFailure() const; - - - Time - getNominalTime() const - { - return Time (TimeValue(parameter.nominalTime)); - } - - InvocationInstanceID - getInvocationInstanceID() const - { - return this->parameter.invoKey; - } - - JobKind getKind() const; - bool isValid() const; - }; - - /** * Interface of the closure for frame rendering jobs. * Hidden behind this interface resides all of the context re-building @@ -229,6 +173,60 @@ namespace engine { }; + + + /** + * Individual frame rendering task, forwarding to a closure. + * This functor encodes all information necessary to trigger + * and invoke the actual rendering operation. It will be embedded + * by value 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 one 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" + * different for each \em individual job. + */ + class Job + : public lumiera_jobDefinition + { + + public: + + Job (JobClosure& specificJobDefinition + ,InvocationInstanceID invoKey + ,Time nominalFrameTime) + { + this->jobClosure = &specificJobDefinition; + this->parameter.nominalTime = _raw(nominalFrameTime); + this->parameter.invoKey = invoKey; + } + + // using standard copy operations + + + void triggerJob() const; + void signalFailure() const; + + + Time + getNominalTime() const + { + return Time (TimeValue(parameter.nominalTime)); + } + + InvocationInstanceID + getInvocationInstanceID() const + { + return this->parameter.invoKey; + } + + JobKind getKind() const; + bool isValid() const; + }; + + }} // namespace proc::engine diff --git a/src/proc/play/timings.cpp b/src/proc/play/timings.cpp index 045fd1143..0947dd243 100644 --- a/src/proc/play/timings.cpp +++ b/src/proc/play/timings.cpp @@ -77,17 +77,17 @@ namespace play { Timings Timings::DISABLED(FrameRate::HALTED); - TimeValue + Time Timings::getOrigin() const { - return grid_->timeOf(0); + return Time(grid_->timeOf(0)); } - TimeValue + Time Timings::getFrameStartAt (int64_t frameNr) const { - return grid_->timeOf(frameNr); + return Time(grid_->timeOf(frameNr)); } diff --git a/src/proc/play/timings.hpp b/src/proc/play/timings.hpp index c2ec75ab2..e2cf02a8e 100644 --- a/src/proc/play/timings.hpp +++ b/src/proc/play/timings.hpp @@ -113,12 +113,12 @@ namespace play { /** marker for halted output */ static Timings DISABLED; - TimeValue getOrigin() const; + Time getOrigin() const; - TimeValue getFrameStartAt (int64_t frameNr) const; - Offset getFrameOffsetAt (TimeValue refPoint) const; - Duration getFrameDurationAt (TimeValue refPoint) const; - Duration getFrameDurationAt (int64_t refFrameNr) const; + Time getFrameStartAt (int64_t frameNr) const; + Offset getFrameOffsetAt (TimeValue refPoint) const; + Duration getFrameDurationAt (TimeValue refPoint) const; + Duration getFrameDurationAt (int64_t refFrameNr) const; /** the frame spacing and duration remains constant for some time... * @param startPoint looking from that time point into future diff --git a/tests/core/proc/engine/dispatcher-interface-test.cpp b/tests/core/proc/engine/dispatcher-interface-test.cpp index c598ae720..6eeb4fef8 100644 --- a/tests/core/proc/engine/dispatcher-interface-test.cpp +++ b/tests/core/proc/engine/dispatcher-interface-test.cpp @@ -174,7 +174,7 @@ namespace test { Timings timings (FrameRate::PAL); ENSURE (START_FRAME == 10); - TimeAnchor refPoint = TimeAnchor::build (timings, START_FRAME); + TimeAnchor refPoint(timings, START_FRAME); CHECK (refPoint == Time::ZERO + Duration(10, FrameRate::PAL)); FrameCoord coordinates = dispatcher.onCalcStream (modelPort,CHANNEL) @@ -191,7 +191,6 @@ namespace test { Job frameJob = executionPlan.createJobFor (coordinates); CHECK (frameJob.getNominalTime() == coordinates.absoluteNominalTime); - CHECK (0 < frameJob.getInvocationInstanceID()); #if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #880 #endif /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #880 } @@ -209,7 +208,7 @@ namespace test { ModelPort modelPort (getTestPort()); Timings timings (FrameRate::PAL); - TimeAnchor refPoint = TimeAnchor::build (timings, START_FRAME); + TimeAnchor refPoint = TimeAnchor(timings, START_FRAME); JobPlanningSequence jobs = dispatcher.onCalcStream(modelPort,CHANNEL) .establishNextJobs(refPoint); @@ -226,9 +225,8 @@ namespace test { ///TODO nachfolgendes muß komplett umgeschrieben werden ///TODO definieren, wie das scheduler-interface angesprochen wird ///TODO dann stub dafür bauen - ///TODO Idee/Frage: kann man nach den Prerequisites nochmal zum Job *zurückkehren* ? - /////////////////// Antwort: nein man kann nicht. +#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #880 TimeVar frameStart (refPoint); InvocationInstanceID prevInvocationID(0); Offset expectedTimeIncrement (1, FrameRate::PAL); @@ -248,7 +246,6 @@ namespace test { CHECK (frameStart == Time(refPoint) + coveredTime); CHECK (frameStart >= Time(refPoint) + timings.getPlanningChunkDuration()); CHECK (frameStart + expectedTimeIncrement > Time(refPoint) + timings.getPlanningChunkDuration()); -#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #880 #endif /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #880 }