diff --git a/src/steam/engine/job-ticket.cpp b/src/steam/engine/job-ticket.cpp index 3ed1e9552..381c6c789 100644 --- a/src/steam/engine/job-ticket.cpp +++ b/src/steam/engine/job-ticket.cpp @@ -131,7 +131,7 @@ namespace engine { REQUIRE (this->isValid(), "Attempt to generate render job for incomplete or unspecified render plan."); REQUIRE (coordinates.channelNr < provision_.size(), "Inconsistent Job planning; channel beyond provision"); Provision const& provision = provision_[coordinates.channelNr]; - JobClosure& functor = static_cast (unConst(provision.jobFunctor)); ////////////////TICKET #1295 : fix actual interface down to JobFunctor (after removing C structs) + JobClosure& functor = static_cast (unConst(provision.jobFunctor)); ////////////////TICKET #1287 : fix actual interface down to JobFunctor (after removing C structs) InvocationInstanceID invoKey{timeHash (nominalTime, provision.invocationSeed)}; return Job(functor, invoKey, nominalTime); @@ -152,18 +152,25 @@ namespace engine { } + namespace { ///////////////////////////////////////////////////////////////////////////////////////////TICKET #1287 : temporary workaround until we get rid of the C base structs + inline bool + operator== (InvocationInstanceID const& l, InvocationInstanceID const& r) + { + return lumiera_invokey_eq (unConst(&l), unConst(&r)); + } + } + /** * Helper for tests: verify the given invocation parameters match this JobTicket. */ bool - JobTicket::verifyInstance (JobFunctor& functor, Time nominalTime) const + JobTicket::verifyInstance (JobFunctor& functor, InvocationInstanceID const& invoKey, Time nominalTime) const { for (Provision const& p : provision_) - if (util::isSameObject (p.jobFunctor, functor)) - { - TODO ("actually re-compute the invocation ID !!!!!!!!!!!!"); - return true; - } + if (util::isSameObject (p.jobFunctor, functor) + and invoKey == timeHash (nominalTime, p.invocationSeed) + ) + return true; return false; } diff --git a/src/steam/engine/job-ticket.hpp b/src/steam/engine/job-ticket.hpp index 92f8b2520..e09036b01 100644 --- a/src/steam/engine/job-ticket.hpp +++ b/src/steam/engine/job-ticket.hpp @@ -61,7 +61,7 @@ namespace engine { //using lib::time::Time; using vault::engine::Job; using vault::engine::JobFunctor; -using vault::engine::JobClosure; /////////////////////////////////////////////////////////////////////TICKET #1295 : fix actual interface down to JobFunctor (after removing C structs) +using vault::engine::JobClosure; /////////////////////////////////////////////////////////////////////TICKET #1287 : fix actual interface down to JobFunctor (after removing C structs) using lib::LinkedElements; using lib::OrientationIndicator; using util::isnil; @@ -116,7 +116,7 @@ using lib::LUID; ////////////////////TODO some channel or format descriptor here Provision (JobFunctor& func, HashVal seed =0) : jobFunctor{func} - , invocationSeed(static_cast(func).buildInstanceID(seed)) ////////////////TICKET #1295 : fix actual interface down to JobFunctor (after removing C structs) + , invocationSeed(static_cast(func).buildInstanceID(seed)) ////////////////TICKET #1287 : fix actual interface down to JobFunctor (after removing C structs) { } }; @@ -162,7 +162,7 @@ using lib::LUID; protected: static InvocationInstanceID timeHash (Time, InvocationInstanceID const&); - bool verifyInstance (JobFunctor&, Time) const; + bool verifyInstance (JobFunctor&, InvocationInstanceID const&, Time) const; }; diff --git a/src/vault/engine/job.cpp b/src/vault/engine/job.cpp index 6ca7fba97..350056bab 100644 --- a/src/vault/engine/job.cpp +++ b/src/vault/engine/job.cpp @@ -185,4 +185,13 @@ lumiera_job_get_hash (LumieraJobDefinition jobDef) REQUIRE (jobDef); return hash_value (forwardInvocation (*jobDef)); } + +/////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1287 : temporary workaround until we get rid of the C base structs +#include "lib/luid.h" + +int +lumiera_invokey_eq (void* l, void* r) +{ + return lumiera_uid_eq ((LumieraUid)l, (LumieraUid)r); +} } diff --git a/src/vault/engine/job.h b/src/vault/engine/job.h index 0fddb35f3..29a1ac126 100644 --- a/src/vault/engine/job.h +++ b/src/vault/engine/job.h @@ -53,7 +53,7 @@ #include "lib/llist.h" -#include "lib/luid.h" +#include "lib/hash-value.h" #include "lib/time.h" @@ -126,18 +126,6 @@ union InvocationInstanceID struct { int32_t a,b; int64_t t; } part; - - friend bool - operator== (InvocationInstanceID const& l, InvocationInstanceID const& r) - { - return lumiera_uid_eq (&l.luid, &r.luid); - } - - friend bool - operator!= (InvocationInstanceID const& l, InvocationInstanceID const& r) - { - return not (l == r); - } }; @@ -360,6 +348,7 @@ void lumiera_job_failure (LumieraJobDefinition, JobFailureReason); /** calculate a hash value based on the Job's \em identity. */ size_t lumiera_job_get_hash (LumieraJobDefinition); +int lumiera_invokey_eq (void* l, void* r); #ifdef __cplusplus diff --git a/tests/core/steam/engine/mock-dispatcher.hpp b/tests/core/steam/engine/mock-dispatcher.hpp index 1c6552f6f..d99f4a502 100644 --- a/tests/core/steam/engine/mock-dispatcher.hpp +++ b/tests/core/steam/engine/mock-dispatcher.hpp @@ -206,8 +206,9 @@ namespace test { { JobFunctor& functor = dynamic_cast (static_cast (*job.jobClosure)); Time nominalTime {TimeValue{job.parameter.nominalTime}}; + InvocationInstanceID const& invoKey = job.parameter.invoKey; return this->isValid() - and this->verifyInstance(functor, nominalTime); + and this->verifyInstance(functor, invoKey, nominalTime); } diff --git a/tests/core/steam/engine/mock-support-test.cpp b/tests/core/steam/engine/mock-support-test.cpp index 2efb20c4c..1381b56e2 100644 --- a/tests/core/steam/engine/mock-support-test.cpp +++ b/tests/core/steam/engine/mock-support-test.cpp @@ -121,14 +121,16 @@ namespace test { // build a render job to do nothing.... Job nopJob = JobTicket::NOP.createJobFor(coord); - CHECK (INSTANCEOF (vault::engine::NopJobFunctor, static_cast (nopJob.jobClosure))); //////////TICKET #1295 : fix actual interface down to JobFunctor (after removing C structs) + CHECK (INSTANCEOF (vault::engine::NopJobFunctor, static_cast (nopJob.jobClosure))); //////////TICKET #1287 : fix actual interface down to JobFunctor (after removing C structs) CHECK (nopJob.parameter.nominalTime == coord.absoluteNominalTime); - CHECK (nopJob.parameter.invoKey == InvocationInstanceID()); + InvocationInstanceID empty; ///////////////////////////////////////////////////////////////////////TICKET #1287 : temporary workaround until we get rid of the C base structs + CHECK (lumiera_invokey_eq (&nopJob.parameter.invoKey, &empty)); MockJobTicket mockTicket; CHECK (mockTicket.discoverPrerequisites().empty()); Job mockJob = mockTicket.createJobFor (coord); - CHECK (mockTicket.verify_associated (mockJob)); + CHECK ( mockTicket.verify_associated (mockJob)); // proof by invocation hash : is indeed backed by this JobTicket + CHECK (not mockTicket.verify_associated (nopJob)); // ...while some random other job is not related TODO ("cover details of MockJobTicket"); } diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index b52483778..175970825 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -69953,6 +69953,23 @@ + + + + + + +

+ Bisher wird noch die Fiktion aufrecht erhalten, daß die Basis-Schnittstelle zum Scheduler in reinem C geschrieben ist; tatsächlich ist dadurch so mancher Teil der implementierung grenzwertig bzw. würde tatsächlich mit reinem C nicht (mehr) funktionieren; außerdem bekommen wir mehfrach geschichtete Vererbungen und müssen regelmäßig casten und implizite ungeprüfte Annahmen machen. +

+
+

+ Und das gemischte Setup ist tückisch: habe gestern Nacht und heute ein paar Stunden einen Link-Fehler gesucht, der auf ein fehlendes extern "C" { } zurückging, aber nicht aufgefallen war, solange C++ die Definitionen inlinen konnte... +

+ +
+ +
@@ -70760,6 +70777,9 @@ + + + @@ -70877,8 +70897,8 @@ - +