From 4601c6350e6828b23ec71375d2a899cf52432e6a Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Sun, 4 Jun 2023 01:54:15 +0200 Subject: [PATCH] Dispatcher-Pipeline: arrangement of builder types ...it turns out that we actually do not need to wrap TreeExplorer on the builder types, because basically there is only a single active builder type, and the complete processing pipeline can be assembled in a single terminal function. The type rebinding problem can thus be solved just by a simple marker struct, which inherits from a template parameter --- src/steam/engine/calc-plan-continuation.cpp | 3 +- src/steam/engine/dispatcher.cpp | 8 -- src/steam/engine/dispatcher.hpp | 97 ++++++++----------- .../engine/dispatcher-interface-test.cpp | 6 +- .../steam/engine/job-planning-setup-test.cpp | 13 ++- wiki/thinkPad.ichthyo.mm | 88 ++++++++++++++++- 6 files changed, 140 insertions(+), 75 deletions(-) diff --git a/src/steam/engine/calc-plan-continuation.cpp b/src/steam/engine/calc-plan-continuation.cpp index 4825e1e41..c737058eb 100644 --- a/src/steam/engine/calc-plan-continuation.cpp +++ b/src/steam/engine/calc-plan-continuation.cpp @@ -100,11 +100,12 @@ namespace engine { void CalcPlanContinuation::performJobPlanningChunk(FrameCnt nextStartFrame) { - TimeAnchor refPoint(timings_, nextStartFrame); +#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #1301 JobPlanningSequence jobs = dispatcher_.onCalcStream(modelPort_, channel_) .establishNextJobs(refPoint); Job nextChunkOfPlanning = buildFollowUpJobFrom (refPoint); +#endif /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #1301 TimeAnchor refPoint(timings_, nextStartFrame); UNIMPLEMENTED ("the actual meat: access the scheduler and fed those jobs"); } diff --git a/src/steam/engine/dispatcher.cpp b/src/steam/engine/dispatcher.cpp index c2406af67..2c8d432d3 100644 --- a/src/steam/engine/dispatcher.cpp +++ b/src/steam/engine/dispatcher.cpp @@ -40,14 +40,6 @@ namespace engine { FrameSequencer::~FrameSequencer() { } - /** @todo WIP */ - Dispatcher::JobBuilder - Dispatcher::onCalcStream (ModelPort modelPort, uint channel) - { - JobBuilder builder = {this, modelPort,channel}; - return builder; - } - /** @todo WIP */ FrameCoord diff --git a/src/steam/engine/dispatcher.hpp b/src/steam/engine/dispatcher.hpp index 9ad16dfb1..0b7810078 100644 --- a/src/steam/engine/dispatcher.hpp +++ b/src/steam/engine/dispatcher.hpp @@ -110,53 +110,24 @@ namespace engine { } }; /////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1301 : obsolete - public: //////////////////////////////////////////////////////////////////OOO TODO not public; need a way to pick up the result type struct PipeFrameTick; struct PipeSelector; struct PipeExpander; struct PipePlanner; -/////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1301 : obsolete - using FrameNrIter = lib::NumIter; - - struct PipelineBuilder - : FrameNrIter - { - Dispatcher* dispatcher; - Timings timings; - ModelPort port; - DataSink sink; - - auto - timeRange (Time start, Time after) - { - auto frame = [&](Time t){ return timings.getBreakPointAfter(t); }; - auto reset = [&](auto i){ static_cast(*this) = i; }; - - reset (lib::eachNum (frame(start), frame(after))); - return lib::treeExplore (move(*this)) - .transform ([&](FrameCnt frameNr) -> TimeVar //////////////////////////////TICKET #1261 : transform-iterator unable to handle immutable time - { - return timings.getFrameStartAt (frameNr); - }); - } - }; -/////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1301 : obsolete public: virtual ~Dispatcher(); ///< this is an interface -/////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1301 : obsolete - JobBuilder onCalcStream (ModelPort modelPort, uint channel); + PipeSelector forCalcStream (Timings timings); - PipelineBuilder forCalcStream(Timings timings, ModelPort port, DataSink sink) + template + class PlanningPipeline + : public IT { - return PipelineBuilder{FrameNrIter(), this, timings, port, sink}; - } -/////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1301 : obsolete - PipeFrameTick forCalcStream (Timings timings); - + + }; protected: /** core dispatcher operation: based on the coordinates of a reference point, @@ -226,42 +197,56 @@ namespace engine { ++frameNr; currPoint = timings.getFrameStartAt (frameNr); } - - - /** Builder Function: start frame sequence */ - auto - timeRange (Time start, Time after) - { - stopPoint = after; - frameNr = timings.getBreakPointAfter(start); - currPoint = timings.getFrameStartAt (frameNr); - - // start iterator pipeline based on this as »state core« - return lib::treeExplore (move(*this)); - } - }; - inline Dispatcher::PipeFrameTick - Dispatcher::forCalcStream(Timings timings) - { - return PipeFrameTick{this, timings}; - } //////////////////////////////////////////////////////////////////////////////////////////////////////////////OOO need better solution for type rebinding - using Builder = decltype( declval().timeRange (declval