44#include <unordered_map>
57 using std::unordered_map;
80 invocationLog_[hash_value (parameter)] =
Invocation(parameter);
103 instance.part.a = seed;
128 , a{param.invoKey.part.a}
129 , b{param.invoKey.part.b}
133 : nominal{
Time::ANYTIME}
147 return access_or_default (invocationLog_, hash_value(param)
154 invocationLog_.clear();
179 invoKey.
part.a = rani (MAX_PARAM_A);
180 invoKey.
part.b = rani (2*MAX_PARAM_B - MAX_PARAM_B);
182 Time nominalTime = lib::test::randTime();
184 return Job(dummyClosure, invoKey, nominalTime);
192 invoKey.
part.a = additionalKey;
193 invoKey.
part.b = rani (2*MAX_PARAM_B - MAX_PARAM_B);
195 return Job(dummyClosure, invoKey, nominalTime);
Access point to singletons and other kinds of dependencies designated by type.
basic constant internal time value.
a mutable time value, behaving like a plain number, allowing copy and re-accessing
Lumiera's internal time value datatype.
static const Time NEVER
border condition marker value. NEVER >= any time value
static bool was_invoked(Job const &job)
static Time invocationNominalTime(Job const &job)
static int invocationAdditionalKey(Job const &job)
static Job build()
uses random job definition values
static Time invocationTime(Job const &job)
static JobClosure & getFunctor()
static bool isNopJob(Job const &)
MockJob objects are backed by this closure.
JobKind getJobKind() const override
Invocation const & queryInvocation(JobParameter param) const
size_t hashOfInstance(InvocationInstanceID invoKey) const override
void invokeJobOperation(JobParameter parameter) override
unordered_map< HashVal, Invocation > invocationLog_
recording MockJob invocations
InvocationInstanceID buildInstanceID(HashVal seed) const override
Generate a specifically marked invocationKey for use in unit-tests.
Convenience frontend to access the current raw system time.
Interface of the closure for frame rendering jobs.
Individual frame rendering task, forwarding to a closure.
bool usesClosure(JobClosure const &) const
Singleton services and Dependency Injection.
Hash combine function extracted from LibBoost 1.67 Combine two hash values to form a composite depend...
int lumiera_invokey_eq(void *l, void *r)
@ META_JOB
render process self organisation
struct InvocationInstanceID::@62 part
opaque ID attached to each individual job invocation.
Mock data structures to support implementation testing of render job planning and frame dispatch.
void combine(size_t &combinedHash, size_t additionalHash)
meld the additional hash value into the given base hash value.
int rani(uint bound=_iBOUND())
size_t HashVal
a STL compatible hash value
const int MAX_PARAM_A(1000)
random test values 0...1000
DummyClosure dummyClosure
actual instance of the test dummy job functor
const int MAX_PARAM_B(10)
random test values -10...+10
Steam-Layer implementation namespace root.
Test runner and basic definitions for tests.
bool isSameObject(A const &a, B const &b)
compare plain object identity, based directly on the referee's memory identities.
OBJ * unConst(const OBJ *)
shortcut to save some typing when having to define const and non-const variants of member functions
MAP::mapped_type const & access_or_default(MAP &map, typename MAP::key_type const &key, typename MAP::mapped_type const &refDefault)
expose a reference to a map entry, with fall-back to some default object
lumiera_jobParameter const & JobParameter
Generic implementation of a JobFunctor to perform no calculations.
Singleton-style holder for NIL or default values.
Front-end for simplified access to the current wall clock time.
Singleton holder for NIL or default value objects.
Primary class template for std::hash.
Invocation(JobParameter param)
A collection of frequently used helper functions to support unit testing.
a family of time value like entities and their relationships.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...