Lumiera  0.pre.03
»edit your freedom«
MockDispatcher Class Reference

#include "/Werk/devel/lumi/tests/core/steam/engine/mock-dispatcher.hpp"

Description

A mocked frame Dispatcher setup without any backing model.

Instantiating such a MockDispatcher will automatically create some fake model structures and some ModelPort and DisplaySink handles (and thereby push aside and shadow any existing ModelPort registry).

The configuration is similar to MockSegmentation, using a test spec given as GenNode-tree to define Segments of the timeline and possibly pipeline-IDs and prerequisites. One notable difference is that here the default ctor always creates a single Segment covering the whole time axis, and that the ExitNode specification is automatically duplicated for all faked ModelPort(s).

Definition at line 330 of file mock-dispatcher.hpp.

Public Member Functions

 MockDispatcher (std::initializer_list< GenNode > specs)
 
play::test::DummyOutputLink getDummyConnection (uint index)
 The faked builder/playback setup provides some preconfigured ModelPort and corresponding DataSink handles. More...
 
JobTicketgetJobTicketFor (size_t portIDX, TimeValue nominalTime) override
 Core Dispatcher operation: locate the appropriate Segment and retrieve/derive a »blueprint« for render job generation. More...
 
ModelPort provideMockModelPort ()
 
size_t resolveModelPort (ModelPort modelPort) override
 translate a generic ModelPort spec into the specific index number applicable at the Timeline referred-to by this Dispatcher More...
 
bool verify (Job const &job, ModelPort const &port, play::DataSink const &sink)
 Test support: verify the given Job is consistent with this Dispatcher.
 
- Public Member Functions inherited from Dispatcher
virtual ~Dispatcher ()
 this is an interface
 
Job createJobFor (size_t portIDX, TimeValue nominalTime)
 Convenience shortcut for tests: JobTicket ⟼ Job.
 
PipelineBuilder< PipeFrameTickforCalcStream (Timings timings)
 Start a builder sequence to assemble a job-planning pipeline, backed by this Dispatcher. More...
 

Private Types

using PortIdxMap = std::map< ModelPort, size_t >
 

Private Member Functions

PortIdxMap buildPortIndex ()
 

Private Attributes

DummyPlaybackSetup dummySetup_
 
MockSegmentation mockSeg_
 
const PortIdxMap portIdx_
 

Member Function Documentation

◆ resolveModelPort()

size_t resolveModelPort ( ModelPort  )
inlineoverridevirtual

translate a generic ModelPort spec into the specific index number applicable at the Timeline referred-to by this Dispatcher

Exceptions
error::Logicif the given ModelPort is not associated
Remarks
assuming that any Play-Process about to be started is always built on top of an established OutputConnection, and thus relies on a model link predetermined by the Builder. In other words, when a Timeline can be performed to this output, then a suitable ModelPort was derived on the Builder run triggered by preparing this specific output possibility. Thus it's an application logic error if attempting to dispatch on a unknown ModelPort.

Implements Dispatcher.

Definition at line 345 of file mock-dispatcher.hpp.

References steam::mobject::session::query::anonymous_namespace{fake-configrules.cpp}::entry().

Referenced by JobPlanning_test::calculateDeadline(), DispatcherInterface_test::resolveModelPort(), JobPlanning_test::simpleUsage(), and MockSupport_test::verify_MockDispatcherSetup().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getJobTicketFor()

JobTicket& getJobTicketFor ( size_t  portIDX,
TimeValue  nominalTime 
)
inlineoverridevirtual

Core Dispatcher operation: locate the appropriate Segment and retrieve/derive a »blueprint« for render job generation.

Parameters
portIDXindex-number for a ModelPort as resolved
nominalTimetime of the frame to calculate, relative to Timeline origin

Implements Dispatcher.

Definition at line 356 of file mock-dispatcher.hpp.

Referenced by JobPlanning_test::calculateDeadline(), and JobPlanning_test::simpleUsage().

+ Here is the caller graph for this function:

◆ getDummyConnection()

play::test::DummyOutputLink getDummyConnection ( uint  index)
inline

The faked builder/playback setup provides some preconfigured ModelPort and corresponding DataSink handles.

These are stored into a dummy registry and only available during the lifetime of the DummyPlaybackSetup instance.

Parameters
indexnumber of the distinct port / connection
Returns
a std::pair<ModelPort,DataSink>
Warning
as of 5/2023, there are two preconfigured "slots", and they are not usable in any way other then referring to their identity

Definition at line 398 of file mock-dispatcher.hpp.

Referenced by JobPlanningPipeline_test::accessTopLevelJobTicket(), JobPlanning_test::calculateDeadline(), DispatcherInterface_test::resolveModelPort(), JobPlanning_test::simpleUsage(), and MockSupport_test::verify_MockDispatcherSetup().

+ Here is the caller graph for this function:
+ Inheritance diagram for MockDispatcher:
+ Collaboration diagram for MockDispatcher:

The documentation for this class was generated from the following file: