Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
media-weaving-pattern.hpp
Go to the documentation of this file.
1/*
2 MEDIA-WEAVING-PATTERN.hpp - Base patterns to organise data connections and render processing invocation
3
4 Copyright (C)
5 2008, Hermann Vosseler <Ichthyostega@web.de>
6 2024, Hermann Vosseler <Ichthyostega@web.de>
7
8  **Lumiera** is free software; you can redistribute it and/or modify it
9  under the terms of the GNU General Public License as published by the
10  Free Software Foundation; either version 2 of the License, or (at your
11  option) any later version. See the file COPYING for further details.
12
13*/
14
15
134#ifndef STEAM_ENGINE_MEDIA_WEAVING_PATTERN_H
135#define STEAM_ENGINE_MEDIA_WEAVING_PATTERN_H
136
137#include "steam/common.hpp"
142//#include "vault/gear/job.h"
143//#include "steam/engine/exit-node.hpp"
144//#include "lib/time/timevalue.hpp"
145//#include "lib/linked-elements.hpp"
146#include "lib/several.hpp"
147//#include "lib/util-foreach.hpp"
148//#include "lib/iter-adapter.hpp"
149//#include "lib/meta/function.hpp"
150//#include "lib/itertools.hpp"
151//#include "lib/util.hpp" ////////OOO wegen manifoldSiz<FUN>()
152
153//#include <stack>
154
155
156namespace steam {
157namespace engine {
158
159 using lib::Several;
160
161
176 template<class INVO>
179 {
180 using Feed = INVO::Feed;
181
182 static_assert (_verify_usable_as_InvocationAdapter<Feed>());
183
186
188
190
192 template<typename...ARGS>
195 ,uint resultIdx
196 ,ARGS&& ...args)
197 : leadPort_{move(pr)}
198 , outTypes_{move(dr)}
199 , resultSlot_{resultIdx}
200 , prototype_{forward<ARGS>(args)...}
201 { }
202
203
204 Feed
205 mount (TurnoutSystem& turnoutSys)
206 {
207 ENSURE (leadPort_.size() <= INVO::FAN_I);
208 ENSURE (outTypes_.size() <= INVO::FAN_O);
209 return prototype_.buildFeed (turnoutSys);
210 }
211
212 void
213 pull (Feed& feed, TurnoutSystem& turnoutSys)
214 {
215 if constexpr (Feed::hasInput())
216 for (uint i=0; i<leadPort_.size(); ++i)
217 {
218 BuffHandle inputData = leadPort_[i].get().weave (turnoutSys);
219 feed.inBuff.createAt(i, move(inputData));
220 }
221 }
222
223 void
225 {
226 for (uint i=0; i<outTypes_.size(); ++i)
227 {
228 BuffHandle resultData =
229 i == resultSlot_ and outBuff? *outBuff
230 : outTypes_[i].lockBuffer();
231 feed.outBuff.createAt(i, move(resultData));
232 }
233 feed.connect();
234 }
235
236 void
238 {
239 feed.invoke(); // process data
240 }
241
244 {
245 if constexpr (Feed::hasInput())
246 for (uint i=0; i<leadPort_.size(); ++i)
247 {
248 feed.inBuff[i].release();
249 }
250 for (uint i=0; i<outTypes_.size(); ++i)
251 {
252 feed.outBuff[i].emit(); // state transition: data ready
253 if (i != resultSlot_)
254 feed.outBuff[i].release();
255 }
256 ENSURE (resultSlot_ < INVO::FAN_O, "invalid result buffer configured.");
257 return feed.outBuff[resultSlot_];
258 }
259
260
262 friend auto
264 {
265 return std::tie (patt.leadPort_, patt.outTypes_);
266 }
267 };
268
269
270
271}}// namespace steam::engine
272#endif /*STEAM_ENGINE_MEDIA_WEAVING_PATTERN_H*/
Abstraction: Fixed array of elements.
Definition several.hpp:166
Handle for a buffer for processing data, abstracting away the actual implementation.
Communication hub to coordinate and activate the »Render Node Network« performance.
Any copy and copy construction prohibited.
Definition nocopy.hpp:38
Adapter to connect parameters and data buffers to an external processing function.
unsigned int uint
Definition integral.hpp:29
std::optional< BuffHandle > OptionalBuff
Steam-Layer implementation namespace root.
Abstraction interface: array-like random access by subscript.
Basic set of definitions and includes commonly used together.
Standard implementation for a Weaving Pattern to connect the input and output data feeds (buffers) in...
MediaWeavingPattern(Several< PortRef > &&pr, Several< BuffDescr > &&dr, uint resultIdx, ARGS &&...args)
forwarding-ctor to provide the detailed input/output connections
friend auto _accessInternal(MediaWeavingPattern &patt)
void weft(Feed &feed, TurnoutSystem &)
Feed mount(TurnoutSystem &turnoutSys)
void shed(Feed &feed, TurnoutSystem &, OptionalBuff outBuff)
BuffHandle fix(Feed &feed, TurnoutSystem &)
void pull(Feed &feed, TurnoutSystem &turnoutSys)
A actual state of a rendering evaluation parametrised for a single job.
Fixed standard setup used in each Port of the Render Node to generate data.