Lumiera  0.pre.03
»edit your freedom«
nodewiring-obsolete.hpp
1 /*
2  NODEWIRING.hpp - Implementation of the node network and operation control
3 
4  Copyright (C)
5  2008, Hermann Vosseler <Ichthyostega@web.de>
6 
7   **Lumiera** is free software; you can redistribute it and/or modify it
8   under the terms of the GNU General Public License as published by the
9   Free Software Foundation; either version 2 of the License, or (at your
10   option) any later version. See the file COPYING for further details.
11 
12 */
13 
14 
23 #ifndef ENGINE_NODEWIRING_OBSOLETE_H
24 #define ENGINE_NODEWIRING_OBSOLETE_H
25 
26 
29 #include "lib/ref-array.hpp"
30 #include "lib/util-foreach.hpp"
31 #include "lib/nocopy.hpp"
32 
33 #include <memory>
34 
35 
36 
37 namespace steam {
38 namespace engine {
39 
40 
41  class WiringFactory;
42 
43  namespace config { class WiringFactoryImpl; }
44 
46  using lib::RefArray;
47 
48 
68  {
69  long flags_;
70  asset::Proc::ProcFunc* function_;
71 
72  public: /* === API for querying collected data === */
74  makeOutDescriptor() const
75  {
76  UNIMPLEMENTED ("build new output descriptors for the node under construction");
77  }
78 
80  makeInDescriptor() const
81  {
82  UNIMPLEMENTED ("build new input descriptors for the node under construction");
83  }
84 
85  Connectivity::ProcFunc*
86  resolveProcessingFunction() const
87  {
88  REQUIRE (function_);
89  return function_;
90  }
91 
92  lumiera::NodeID const&
93  createNodeID() const
94  {
95  UNIMPLEMENTED ("initiate generation of a new unique node-ID"); // see rendergraph.cpp
96  }
97 
98 
99 
100  public: /* === API for specifying the desired wiring === */
101 
107  : flags_(0)
108  , function_(0)
109  {
110  UNIMPLEMENTED ("representation of the intended wiring");
111  }
112 
113 
117  WiringSituation (PNode predecessor)
118  : flags_(0)
119  , function_(0)
120  {
121  UNIMPLEMENTED ("wiring representation; hook up connections 1:1");
122  REQUIRE (predecessor);
123 
125  // for_each (predecessor->outputs(), ..... see also Ticket 183 (invoking member fun in for_each)
126 
127  }
128 
129 
132  defineInput (uint inPin, PNode pred, uint outPin)
133  {
134  UNIMPLEMENTED ("wiring representation; define new connection");
135  return *this;
136  }
137 
141  defineInput (PNode pred, uint outPin)
142  {
143  UNIMPLEMENTED ("wiring representation; define new connection");
144  return *this;
145  }
146 
150  defineInput (uint inPin, PNode pred)
151  {
152  UNIMPLEMENTED ("wiring representation; define new connection");
153  return *this;
154  }
155 
156 
159  setFlag (long code)
160  {
161  flags_ |= code;
162  return *this;
163  }
164 
165  long getFlags () const { return flags_; }
166 
167 
170  resolveProcessor (asset::Proc const& procAsset)
171  {
172  function_ = procAsset.resolveProcessor();
173  ENSURE (function_);
174  }
175 
176  };
178 
179 
180 
181 
191  template<class STATE>
193  : public Connectivity
194  {
195 
196  public:
198  : Connectivity(setup.makeOutDescriptor(),
199  setup.makeInDescriptor(),
200  setup.resolveProcessingFunction(),
201  setup.createNodeID())
202  { }
203 
204  private:
205  virtual BuffHandle
206  callDown (StateClosure_OBSOLETE& currentProcess, uint requestedOutputNr) const
207  {
208  STATE thisStep (currentProcess, *this, requestedOutputNr);
209  return thisStep.retrieve (); // fetch or calculate results
210  }
211  };
212 
213 
214 
216  {
217  lib::AllocationCluster& alloc_;
218  std::unique_ptr<config::WiringFactoryImpl> pImpl_;
219 
220  public:
222  ~WiringFactory ();
223 
224  Connectivity&
225  operator() (WiringSituation const& setup);
226  };
227 
228 
229 
230 }} // namespace steam::engine
231 #endif
Abstraction: Array of const references.
Definition: ref-array.hpp:42
WiringSituation(PNode predecessor)
Continue the wiring by hooking directly into the output of an existing predecessor node...
Actual implementation of the link between nodes, also acting as "track switch" for the execution path...
Memory management for the low-level model (render nodes network).
Any copy and copy construction prohibited.
Definition: nocopy.hpp:37
WiringSituation & defineInput(uint inPin, PNode pred, uint outPin)
set up a connection leading to a specific input pin of the new node
WiringSituation & setFlag(long code)
set detail flags regarding the desired node operation mode
Steam-Layer implementation namespace root.
Abstraction to access the state of a currently ongoing render/calculation process, as it is tied to the supporting facilities of the vault layer.
Mix-Ins to allow or prohibit various degrees of copying and cloning.
key abstraction: data processing asset
Definition: proc.hpp:63
Abstraction interface: array-like access by subscript.
A pile of objects sharing common allocation and lifecycle.
WiringSituation & resolveProcessor(asset::Proc const &procAsset)
trigger resolving of the actual processing function
Handle for a buffer for processing data, abstracting away the actual implementation.
Definition: buffhandle.hpp:111
Interface: Description of the input and output ports, processing function and predecessor nodes for a...
auto setup(FUN &&workFun)
Helper: setup a Worker-Pool configuration for the test.
WiringSituation & defineInput(PNode pred, uint outPin)
set up the next input connection, originating at a specific output pin of the predecessor ...
Identification tuple for denoting render nodes unambiguously.
Definition: frameid.hpp:45
Key abstraction of the Render Engine: A Data processing Node.
WiringSituation()
A default WiringSituation doesn&#39;t specify any connections.
virtual ProcFunc * resolveProcessor() const =0
resolve any plugin and configuration info to yield the actual media data processing function...
WiringSituation & defineInput(uint inPin, PNode pred)
set up the next input connection to a specific input pin, originating at a the next/sole output pin o...
Perform operations "for each element" of a collection.
Finding out about a concrete way of wiring up a ProcNode about to be built.
virtual BuffHandle callDown(StateClosure_OBSOLETE &currentProcess, uint requestedOutputNr) const
the wiring-dependent part of the node operation.