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

#include "steam/engine/job-ticket.hpp"

Description

execution plan for pulling a specific exit node.

Usable as blue print for generating actual render jobs. Job tickets are created on demand, specialised for each segment of the low-level model, and for each individual feed (corresponding to a single model port). Once created, they are final for this segment, stored together with the other descriptor objects (ProcNode and WiringDescriptor) and finally discarded in bulk, in case that segment of the low-level model becomes obsolete and is replaced by a newly built new version of this model segment.

Job tickets are created by a classical recursive descent call on the exit node, which figures out everything to be done for generating data from this node. To turn a JobTicket into an actual job, we need the additional information regarding the precise frame number (=nominal time) and a handle for the DataSink exposing buffers to output generated data. Thus effectively the JobTicket acts as higher order function: a function generating on invocation another, specific function (= the job).

Note
JobTicket is effectively immutable after construction
Todo:
6/23 WIP rework and integration for »PlaybackVerticalSlice«

Definition at line 87 of file job-ticket.hpp.

Public Member Functions

template<class ALO >
 JobTicket (ExitNode const &exitNode, ALO &allocator)
 
Job createJobFor (Time nominalTime)
 Core operation: build a concrete render job based on this blueprint. More...
 
bool empty () const
 
Duration getExpectedRuntime ()
 Core operation: guess expected runtime for rendering. More...
 
auto getPrerequisites ()
 Core operation: iterate over the prerequisites, required to carry out a render operation based on this blueprint. More...
 
bool isValid () const
 

Static Public Attributes

static JobTicket NOP {}
 special »do nothing« JobTicket marker
 

Classes

struct  Prerequisite
 
struct  Provision
 

Protected Member Functions

bool verifyInstance (JobFunctor &, InvocationInstanceID const &, Time) const
 Helper for tests: verify the given invocation parameters match this JobTicket.
 

Static Protected Member Functions

static InvocationInstanceID timeHash (Time, InvocationInstanceID const &)
 Tag the precomputed invocation ID with the nominal frame time.
 

Private Types

using Prerequisites = LinkedElements< Prerequisite >
 

Private Member Functions

 JobTicket ()
 
- Private Member Functions inherited from NonCopyable
 NonCopyable (NonCopyable const &)=delete
 
NonCopyableoperator= (NonCopyable const &)=delete
 

Static Private Member Functions

template<class ALO >
static Provision buildProvisionSpec (ExitNode const &, ALO &)
 

Private Attributes

Provision provision_
 

Constructor & Destructor Documentation

◆ JobTicket()

JobTicket ( )
private

as NIL marker, a JobTicket can be empty

Definition at line 64 of file job-ticket.cpp.

Member Function Documentation

◆ buildProvisionSpec()

JobTicket::Provision buildProvisionSpec ( ExitNode const &  exitNode,
ALO &  allocTicket 
)
inlinestaticprivate

prepare and assemble the working data structure to build a JobTicket.

Template Parameters
ALOtype of an allocator front-end for generating prerequisite JobTicket(s)
Parameters
exitNodea (possibly recursive) tree of ExitNode, detailing points where to pull and process data from the render nodes network; these can refer to nested ExitNodes(s), which need to be processed beforehand, as prerequisite for invoking the given (dependent) ExitNode.
Returns
the final wired instance of the data structure to back the new JobTicket
Remarks
Note especially that those data structures linked together for use by the JobTicket are themselves allocated "elsewhere", and need to be attached to a memory management scheme (typically an AllocationCluster for some Segment of the Fixture datastructure). This data layout can be tricky to get right, and is chosen here for performance reasons, assuming that there is a huge number of segments, and these are updated frequently after each strike of edit operations, yet traversed and evaluated on a sub-second scale for ongoing playback.

Definition at line 213 of file job-ticket.hpp.

◆ getPrerequisites()

auto getPrerequisites ( )
inline

Core operation: iterate over the prerequisites, required to carry out a render operation based on this blueprint.

Returns
iterator exposing the prerequisites as JobTicket&

Definition at line 164 of file job-ticket.hpp.

References JobTicket::createJobFor(), JobTicket::getExpectedRuntime(), JobTicket::timeHash(), lib::transformIterator(), and JobTicket::verifyInstance().

Referenced by JobPlanning::buildDependencyPlanning().

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

◆ createJobFor()

Job createJobFor ( Time  nominalTime)

Core operation: build a concrete render job based on this blueprint.

Generate a render job to invoke the render network configuration as defined and backing this JobTicket.

The generated job descriptor record will include a specific InvocationInstanceID, which factors in the nominal frame time, but also the specific backing render configuration. The actual implementation of the job functionality will be delegated to the JobClosure, which was set up for this Segment and JobTiket after the last Builder run created this part of the render network.

Definition at line 79 of file job-ticket.cpp.

Referenced by JobPlanning::buildJob(), Dispatcher::createJobFor(), JobTicket::getPrerequisites(), and MockSupport_test::verify_MockJobTicket().

+ Here is the caller graph for this function:

◆ getExpectedRuntime()

Duration getExpectedRuntime ( )

Core operation: guess expected runtime for rendering.

Use observed runtime values of past job invocations to guess a sensible bound for the calculation time to expect for next invocation.

Todo:
6/2023 placeholder implementation with hard wired values in ExitNode

Definition at line 102 of file job-ticket.cpp.

Referenced by JobPlanning_test::calculateDeadline(), JobTicket::getPrerequisites(), and JobPlanning::JobPlanning().

+ Here is the caller graph for this function:

Member Data Documentation

◆ provision_

Provision provision_
private

reference to all information required for actual Job creation

Definition at line 120 of file job-ticket.hpp.

Referenced by JobTicket::verifyInstance().

+ Inheritance diagram for JobTicket:
+ Collaboration diagram for JobTicket:

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