Lumiera  0.pre.03
»edit your freedom«
nodewiring.hpp
Go to the documentation of this file.
1 /*
2  NODEWIRING.hpp - Implementation of the node network and operation control
3 
4  Copyright (C) Lumiera.org
5  2008, Hermann Vosseler <Ichthyostega@web.de>
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of
10  the License, or (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 
21 */
22 
23 
30 #ifndef ENGINE_NODEWIRING_H
31 #define ENGINE_NODEWIRING_H
32 
33 
37 
38 #include <memory>
39 
40 
41 
42 namespace steam {
43 namespace engine {
44 
45 
46  class WiringFactory;
47 
48  namespace config { class WiringFactoryImpl; }
49 
50  using lib::RefArray;
51 
52 
53 
54 
64  template<class STATE>
65  class NodeWiring
66  : public WiringDescriptor
67  {
68 
69  public:
71  : WiringDescriptor(setup.makeOutDescriptor(),
72  setup.makeInDescriptor(),
73  setup.resolveProcessingFunction(),
74  setup.createNodeID())
75  { }
76 
77  private:
78  virtual BuffHandle
79  callDown (State& currentProcess, uint requestedOutputNr) const
80  {
81  STATE thisStep (currentProcess, *this, requestedOutputNr);
82  return thisStep.retrieve (); // fetch or calculate results
83  }
84 
85  };
86 
87 
88 
90  {
91  lib::AllocationCluster& alloc_;
92  std::unique_ptr<config::WiringFactoryImpl> pImpl_;
93 
94  public:
96  ~WiringFactory ();
97 
99  operator() (WiringSituation const& setup);
100  };
101 
102 
103 
104 }} // namespace steam::engine
105 #endif
Interface to the processing nodes and the render nodes network.
Abstraction to access the state of a currently ongoing render/calculation process, as it is tied to the supporting facilities of the vault layer.
Definition: state.hpp:59
Abstraction: Array of const references.
Definition: ref-array.hpp:48
Actual implementation of the link between nodes, also acting as "track switch" for the execution path...
Definition: nodewiring.hpp:65
Helper for defining the desired wiring and operation mode for a render node.
Memory management for the low-level model (render nodes network).
Steam-Layer implementation namespace root.
virtual BuffHandle callDown(State &currentProcess, uint requestedOutputNr) const
the wiring-dependent part of the node operation.
Definition: nodewiring.hpp:79
A pile of objects sharing common allocation and lifecycle.
Handle for a buffer for processing data, abstracting away the actual implementation.
Definition: buffhandle.hpp:115
auto setup(FUN &&workFun)
Helper: setup a Worker-Pool configuration for the test.
Interface: Description of the input and output ports, processing function and predecessor nodes for a...
Definition: procnode.hpp:78
Finding out about a concrete way of wiring up a ProcNode about to be built.