38 #include "lib/hash-combine.hpp" 44 #include <unordered_map> 57 using std::unordered_map;
58 using util::access_or_default;
60 using vault::gear::JobParameter;
78 invokeJobOperation (JobParameter parameter)
override 84 getJobKind()
const override 103 instance.part.a = seed;
111 HashVal res = hashr (invoKey.frameNumber);
127 , real{RealClock::now()}
128 , a{param.invoKey.part.a}
129 , b{param.invoKey.part.b}
135 , a{MAX_PARAM_A}, b{0}
145 queryInvocation (JobParameter param)
const 147 return access_or_default (invocationLog_,
hash_value(param)
154 invocationLog_.clear();
182 Time nominalTime = lib::test::randTime();
192 invoKey.part.a = additionalKey;
200 MockJob::was_invoked (
Job const& job)
209 MockJob::invocationTime (
Job const& job)
213 return dummyClosure.queryInvocation(job.parameter).real;
218 MockJob::invocationNominalTime (
Job const& job)
222 return dummyClosure.queryInvocation(job.parameter).nominal;
227 MockJob::invocationAdditionalKey (
Job const& job)
253 return lumiera_invokey_eq (&util::unConst(job).parameter.invoKey, &empty)
254 and util::isSameObject (jobFunctor,
nopFunctor());
static const Time ANYTIME
border condition marker value. ANYTIME <= any time value
a mutable time value, behaving like a plain number, allowing copy and re-accessing ...
Mock data structures to support implementation testing of render job planning and frame dispatch...
static JobClosure & getFunctor()
Generic implementation of a JobFunctor to perform no calculations.
void combine(size_t &combinedHash, size_t additionalHash)
meld the additional hash value into the given base hash value.
int rani(uint bound=_iBOUND())
Primary class template for std::hash.
Singleton holder for NIL or default value objects.
unordered_map< HashVal, Invocation > invocationLog_
recording MockJob invocations
Singleton-style holder for NIL or default values.
Steam-Layer implementation namespace root.
Access point to singletons and other kinds of dependencies designated by type.
Lumiera's internal time value datatype.
MockJob objects are backed by this closure.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
A collection of frequently used helper functions to support unit testing.
static Job build()
uses random job definition values
DummyClosure dummyClosure
actual instance of the test dummy job functor
Singleton services and Dependency Injection.
lib::Depend< vault::gear::NopJobFunctor > nopFunctor
access to the fallback-implementation for empty segments
opaque ID attached to each individual job invocation.
size_t HashVal
a STL compatible hash value
const int MAX_PARAM_A(1000)
random test values 0...1000
static const Time NEVER
border condition marker value. NEVER >= any time value
static bool isNopJob(Job const &)
Interface of the closure for frame rendering jobs.
const int MAX_PARAM_B(10)
random test values -10...+10
InvocationInstanceID buildInstanceID(HashVal seed) const override
Generate a specifically marked invocationKey for use in unit-tests.
render process self organisation
Individual frame rendering task, forwarding to a closure.
a family of time value like entities and their relationships.
Front-end for simplified access to the current wall clock time.
HashVal hash_value(ProcID const &procID)
generate registry hash value based on the distinct data in ProcID.
basic constant internal time value.