50 #ifndef STEAM_ENGINE_TEST_MOCK_DISPATCHER_H 51 #define STEAM_ENGINE_TEST_MOCK_DISPATCHER_H 79 using std::make_tuple;
87 using fixture::Segmentation;
113 :
Job{
build (nominalTime,additionalKey)}
117 static bool was_invoked (
Job const& job);
118 static Time invocationTime (
Job const& job);
119 static Time invocationNominalTime (
Job const& job);
120 static int invocationAdditionalKey (
Job const& job);
157 return ExitNode{seed, DUMMY_JOB_RUNTIME
164 :
JobTicket{defineSimpleSpec(), allocator()}
168 :
JobTicket{defineSimpleSpec (seed), allocator()}
174 bool verify_associated (
Job const&)
const;
175 static bool isAssociated (
Job const&,
JobTicket const&);
212 for (
auto& spec : specs)
214 auto start = spec.retrieveAttribute<
Time> (
"start");
215 auto after = spec.retrieveAttribute<
Time> (
"after");
217 ,ExitNodes{buildExitNodeFromSpec (spec)}
224 buildExitNodeFromSpec (
GenNode const& spec)
228 ,buildPrerequisites (spec)
233 void duplicateExitNodeSpec (uint times);
239 buildSeed (
GenNode const& spec)
246 buildRuntime (
GenNode const& spec)
249 return runtime? *runtime : DUMMY_JOB_RUNTIME;
253 buildPrerequisites (
GenNode const& spec)
255 ExitNodes prerequisites;
256 for (
auto& child : spec.getChildren())
257 prerequisites.emplace_back (
258 buildExitNodeFromSpec (child));
259 return prerequisites;
280 return Spec{ExitNodes(times, spec[0])};
296 return this->isValid()
297 and this->verifyInstance(functor, invoKey, nominalTime);
341 DummyPlaybackSetup dummySetup_;
344 using PortIdxMap = std::map<ModelPort, size_t>;
346 const PortIdxMap portIdx_;
354 auto entry = portIdx_.find(modelPort);
355 if (
entry == portIdx_.end())
356 throw error::Logic{
"Invalid ModelPort for this Dispatcher"};
358 return entry->second;
365 auto& seg = mockSeg_[nominalTime];
366 return seg.jobTicket(portIDX);
373 , mockSeg_{MakeRec().genNode()}
374 , portIdx_{buildPortIndex()}
382 , portIdx_{buildPortIndex()}
389 provideMockModelPort()
391 ModelPorts mockModelPorts = dummySetup_.getAllModelPorts();
392 return *mockModelPorts;
404 play::test::DummyOutputLink
407 return dummySetup_.getModelPort (index);
415 if (not dummySetup_.isSupported (port, sink))
return false;
417 TimeValue nominalTime{job.parameter.nominalTime};
418 size_t portIDX = resolveModelPort (port);
419 JobTicket& ticket = getJobTicketFor (portIDX, nominalTime);
430 for (
auto it=dummySetup_.getAllModelPorts()
Organising the output data calculation possibilities.
size_t resolveModelPort(ModelPort modelPort) override
translate a generic ModelPort spec into the specific index number applicable at the Timeline referred...
Execution plan to generate render jobs within a specific render process.
static JobClosure & getFunctor()
JobTicket & getJobTicketFor(size_t portIDX, TimeValue nominalTime) override
Core Dispatcher operation: locate the appropriate Segment and retrieve/derive a »blueprint« for rende...
Mock setup for a JobTicket to generate dummy render Job invocations.
Framework for dummy playback and rendering.
For the purpose of building and rendering, the fixture (for each timeline) is partitioned such that e...
AnyPair entry(Query< TY > const &query, typename WrapReturn< TY >::Wrapper &obj)
helper to simplify creating mock table entries, wrapped correctly
bool verify_associated(Job const &) const
verify the given job instance was actually generated from this JobTicket.
Service abstraction within the render engine for generating render jobs.
A mocked frame Dispatcher setup without any backing model.
void duplicateExitNodeSpec(uint times)
This is some trickery to allow handling of multiple ModelPort(s) in MockDispatcher; actually the code...
A front-end/concept to allow access to custom memory management.
Internal abstraction: a service within the engine for translating a logical calculation stream (corre...
Segment const & splitSplice(OptTime start, OptTime after, engine::ExitNodes &&modelLink=ExitNodes{})
rework the existing Segmentation to include a new Segment as specified
Mock setup for a render Job with NO action but built-in diagnostics.
denotes an opened connection ready to receive media data for output.
play::test::DummyOutputLink getDummyConnection(uint index)
The faked builder/playback setup provides some preconfigured ModelPort and corresponding DataSink han...
Steam-Layer implementation namespace root.
static ExitNode defineSimpleSpec(HashVal seed=1+rand())
provide a test specification wired to MockJob
Placeholder implementation for a custom allocator.
Lumiera's internal time value datatype.
Derived specific exceptions within Lumiera's exception hierarchy.
Dummy and test setup of playback and rendering, omitting most of the Lumiera engine.
A top-level point in the render node network where data generation can be driven. ...
bool verify(Job const &job, ModelPort const &port, play::DataSink const &sink)
Test support: verify the given Job is consistent with this Dispatcher.
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...
Generic building block for tree shaped (meta)data structures.
Binding and access point from a given Segment to access the actual render nodes.
Mock setup for a complete Segmentation to emulate the structure of the actual fixture, without the need of building a low-level Model.
A collection of frequently used helper functions to support unit testing.
static Job build()
uses random job definition values
Intrusive single linked list with optional ownership.
std::optional< X > retrieveAttribute(string key) const
mismatch tolerant convenience shortcut to peek into the attributes of a nested Record ...
void adaptSpecification(std::function< NodeGraphAttachment(NodeGraphAttachment const &)> rewrite)
Definition of a render job.
Singleton services and Dependency Injection.
static bool isAssociated(Job const &, JobTicket const &)
convenience shortcut to perform this test on arbitrary JobTicket and Job instances.
Handle designating a point within the model, where actually output data can be pulled.
Link from the Fixture datastructure into the render node network.
opaque ID attached to each individual job invocation.
size_t HashVal
a STL compatible hash value
static bool isNopJob(Job const &)
Interface of the closure for frame rendering jobs.
Duration is the internal Lumiera time metric.
Part of the Fixture datastructure to manage time segments of constant structure.
Convenience frontend to access the current raw system time.
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.
basic constant internal time value.
generic data element node within a tree
execution plan for pulling a specific exit node.
bool isSameObject(A const &a, B const &b)
compare plain object identity, bypassing any custom comparison operators.