diff --git a/src/backend/engine/job.cpp b/src/backend/engine/job.cpp index bacfadc09..9dd53944b 100644 --- a/src/backend/engine/job.cpp +++ b/src/backend/engine/job.cpp @@ -175,4 +175,11 @@ lumiera_job_failure (LumieraJobDefinition jobDef, JobFailureReason reason) REQUIRE (jobDef); forwardInvocation(*jobDef).signalFailure(reason); } + +size_t +lumiera_job_get_hash (LumieraJobDefinition jobDef) +{ + REQUIRE (jobDef); + return hash_value (forwardInvocation (*jobDef)); +} } diff --git a/src/backend/engine/job.h b/src/backend/engine/job.h index 6de6e03ff..cf107e9e9 100644 --- a/src/backend/engine/job.h +++ b/src/backend/engine/job.h @@ -73,6 +73,14 @@ enum JobKind META_JOB ///< render process self organisation }; +enum JobPriority + { + TIMEBOUND_JOB, ///< regular job scheduled for time-bound delivery + PAUSED_JOB, ///< @todo do we need this special state? + ASAP_JOB, ///< job for freewheeling calculation of final results + BACKGROUND_JOB ///< background rendering job + }; + /** * @todo find out about the possible kinds of failure @@ -314,6 +322,9 @@ void lumiera_job_invoke (LumieraJobDefinition); * missing deadlines or aborting a sequence of jobs */ void lumiera_job_failure (LumieraJobDefinition, JobFailureReason); +/** calculate a hash value based on the Job's \em identity. */ +size_t lumiera_job_get_hash (LumieraJobDefinition); + #ifdef __cplusplus diff --git a/src/backend/engine/scheduler-diagnostics.hpp b/src/backend/engine/scheduler-diagnostics.hpp index 8ea1d8db3..470a1ea7d 100644 --- a/src/backend/engine/scheduler-diagnostics.hpp +++ b/src/backend/engine/scheduler-diagnostics.hpp @@ -41,20 +41,8 @@ #include "lib/hash-value.h" #include "lib/time/timevalue.hpp" #include "backend/engine/scheduler-frontend.hpp" -//#include "include/dummy-player-facade.h" -//#include "include/display-facade.h" -//#include "proc/engine/calc-stream.hpp" -//#include "proc/mobject/model-port.hpp" -//#include "proc/play/timings.hpp" -//#include "proc/play/output-slot.hpp" -//#include "common/instancehandle.hpp" -//#include "lib/singleton-ref.hpp" -//#include "lib/polymorphic-value.hpp" -//#include "lib/singleton.hpp" -// #include -//#include //#include @@ -62,10 +50,6 @@ namespace backend{ namespace engine { // using std::string; -// using lumiera::Subsys; -// using lumiera::Display; -// using lumiera::DummyPlayer; -// using proc::play::Timings; using lib::time::Time; using lib::HashVal; @@ -92,13 +76,11 @@ namespace engine { SchedulerDiagnostics (SchedulerFrontend& sch) : scheduler_(sch) { - UNIMPLEMENTED ("attach tracing connector"); scheduler_.activateTracing(); } ~SchedulerDiagnostics() { - TODO ("detach tracing connector"); scheduler_.disableTracing(); } @@ -143,6 +125,9 @@ namespace engine { bool has_job_scheduled_at (Time deadline) { + ///////////////TODO this would be a classical use case for some kind of Maybe monad. + ///////////////TODO I am considering to add such a helper since quite some time, maybe really do it now?? + UNIMPLEMENTED ("query for job scheduled for specific deadline"); } diff --git a/src/backend/engine/scheduler-frontend.hpp b/src/backend/engine/scheduler-frontend.hpp index 20fe98c4e..1b7524ad6 100644 --- a/src/backend/engine/scheduler-frontend.hpp +++ b/src/backend/engine/scheduler-frontend.hpp @@ -76,9 +76,7 @@ namespace engine { JobTransaction (SchedulerFrontend* s) : sched_(s) - { - UNIMPLEMENTED ("suitable representation, link to the actual scheduler?"); - } + { } friend class SchedulerFrontend; @@ -126,6 +124,14 @@ namespace engine { return *this; } + /** + * define a set of prerequisites of the current JobTransaction. + * @param prerequisites a set of job definitions, which need to be executed + * successfully before any job of the current JobTransaction may be + * invoked. + * @note prerequisites may be nested recursively, a prerequisite transaction + * might rely on further prerequisites + */ JobTransaction& attach (JobTransaction const& prerequisites) { @@ -136,7 +142,6 @@ namespace engine { JobTransaction startPrerequisiteTx() { - UNIMPLEMENTED ("how to start a nested job definition context"); return JobTransaction(sched_); }