41#ifndef STEAM_ENGINE_TEST_MOCK_DISPATCHER_H
42#define STEAM_ENGINE_TEST_MOCK_DISPATCHER_H
70 using std::make_tuple;
80 using fixture::Segmentation;
106 :
Job{
build (nominalTime,additionalKey)}
150 return ExitNode{seed, DUMMY_JOB_RUNTIME
205 for (
auto& spec : specs)
207 auto start = spec.retrieveAttribute<
Time> (
"start");
208 auto after = spec.retrieveAttribute<
Time> (
"after");
235 return seed? HashVal(*seed) : HashVal(1 +rani(1000));
242 return runtime? *runtime : DUMMY_JOB_RUNTIME;
250 prerequisites.emplace_back (
252 return prerequisites;
347 auto entry =
portIdx_.find(modelPort);
349 throw error::Logic{
"Invalid ModelPort for this Dispatcher"};
351 return entry->second;
359 return seg.jobTicket(portIDX);
384 ModelPorts mockModelPorts =
dummySetup_.getAllModelPorts();
385 return *mockModelPorts;
408 if (not
dummySetup_.isSupported (port, sink))
return false;
410 TimeValue nominalTime{job.parameter.nominalTime};
A front-end/concept to allow access to custom memory management.
Placeholder implementation for a custom allocator.
Duration is the internal Lumiera time metric.
basic constant internal time value.
Lumiera's internal time value datatype.
Internal abstraction: a service within the engine for translating a logical calculation stream (corre...
A top-level point in the render node network where data generation can be driven.
execution plan for pulling a specific exit node.
bool verifyInstance(JobFunctor &, InvocationInstanceID const &, Time) const
Helper for tests: verify the given invocation parameters match this JobTicket.
A mocked frame Dispatcher setup without any backing model.
bool verify(Job const &job, ModelPort const &port, play::DataSink const &sink)
Test support: verify the given Job is consistent with this Dispatcher.
size_t resolveModelPort(ModelPort modelPort) override
translate a generic ModelPort spec into the specific index number applicable at the Timeline referred...
play::test::DummyOutputLink getDummyConnection(uint index)
The faked builder/playback setup provides some preconfigured ModelPort and corresponding DataSink han...
MockDispatcher(std::initializer_list< GenNode > specs)
JobTicket & getJobTicketFor(size_t portIDX, TimeValue nominalTime) override
Core Dispatcher operation: locate the appropriate Segment and retrieve/derive a »blueprint« for rende...
const PortIdxMap portIdx_
PortIdxMap buildPortIndex()
DummyPlaybackSetup dummySetup_
MockSegmentation mockSeg_
ModelPort provideMockModelPort()
std::map< ModelPort, size_t > PortIdxMap
Mock setup for a JobTicket to generate dummy render Job invocations.
bool verify_associated(Job const &) const
verify the given job instance was actually generated from this JobTicket.
MockJobTicket(HashVal seed)
static ExitNode defineSimpleSpec(HashVal seed=ranHash())
provide a test specification wired to MockJob
static bool isAssociated(Job const &, JobTicket const &)
convenience shortcut to perform this test on arbitrary JobTicket and Job instances.
Mock setup for a render Job with NO action but built-in diagnostics.
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()
MockJob(Time nominalTime, int additionalKey)
static bool isNopJob(Job const &)
Mock setup for a complete Segmentation to emulate the structure of the actual fixture,...
HashVal buildSeed(GenNode const &spec)
Duration buildRuntime(GenNode const &spec)
void duplicateExitNodeSpec(uint times)
This is some trickery to allow handling of multiple ModelPort(s) in MockDispatcher; actually the code...
MockSegmentation(std::initializer_list< GenNode > specs)
ExitNode buildExitNodeFromSpec(GenNode const &spec)
ExitNodes buildPrerequisites(GenNode const &spec)
Binding and access point from a given Segment to access the actual render nodes.
For the purpose of building and rendering, the fixture (for each timeline) is partitioned such that e...
Segment const & splitSplice(OptTime start, OptTime after, engine::ExitNodes &&modelLink=ExitNodes{})
rework the existing Segmentation to include a new Segment as specified
void adaptSpecification(std::function< NodeGraphAttachment(NodeGraphAttachment const &)> rewrite)
Handle designating a point within the model, where actually output data can be pulled.
denotes an opened connection ready to receive media data for output.
Framework for dummy playback and rendering.
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.
Singleton services and Dependency Injection.
Service abstraction within the render engine for generating render jobs.
Dummy and test setup of playback and rendering, omitting most of the Lumiera engine.
Generic building block for tree shaped (meta)data structures.
Execution plan to generate render jobs within a specific render process.
Definition of a render job.
opaque ID attached to each individual job invocation.
Intrusive single linked list with optional ownership.
Organising the output data calculation possibilities.
int rani(uint bound=_iBOUND())
size_t HashVal
a STL compatible hash value
LumieraError< LERR_(LOGIC)> Logic
std::deque< engine::ExitNode > ExitNodes
std::pair< mobject::ModelPort, play::DataSink > DummyOutputLink
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.
bool isnil(lib::time::Duration const &dur)
Link from the Fixture datastructure into the render node network.
Front-end for simplified access to the current wall clock time.
Part of the Fixture datastructure to manage time segments of constant structure.
generic data element node within a tree
Rec::scopeIter getChildren() const
std::optional< X > retrieveAttribute(string key) const
mismatch tolerant convenience shortcut to peek into the attributes of a nested Record
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...