Lumiera  0.pre.03
»edit your freedom«
nodewiring.cpp
Go to the documentation of this file.
1 /*
2  NodeWiring - 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 
34 
36 
37 
38 namespace steam {
39 namespace engine {
40 
41  namespace config {
42 
43  using lib::meta::Flags;
46  using lib::meta::Apply;
47  using lib::meta::Filter;
48 
50 
51 
52  typedef Flags<CACHING,PROCESS,INPLACE>::Tuple AllFlags;
53 
56 
59 
62 
63 
64 
65  // internal details: setting up a factory for each required configuration
66 
67 
68 
73  template<class CONF>
75  {
76  AllocationCluster& alloc_;
77 
78  /* ==== pick actual wiring code ==== */
81 
82  // the concrete implementation of the glue code...
84 
85 
86  public:
88  : alloc_(a) {}
89 
91  operator() (WiringSituation const& intendedWiring)
92  {
93  return alloc_.create<ActualWiring> (intendedWiring);
94  }
95  };
96 
99 
102  , FunctionType
105 
106 
108  {
109  WiringSelector selector;
110 
112  : selector(config::PossibleConfigs::List(), alloc)
113  { }
114  };
115 
116  } // (END) internals (namespace config)
117 
118 
119 
120 
131  : alloc_(a),
132  pImpl_(new config::WiringFactoryImpl (alloc_))
133  { }
134 
135 
136  WiringFactory::~WiringFactory () {}
137 
138 
139 
140 
152  {
153  long config = setup.getFlags();
154  return pImpl_->selector[config] (setup);
155  }
156 
157 
158 }} // namespace steam::engine
Interface to the processing nodes and the render nodes network.
Fabricating a WiringDescriptor tailored for a specific node wiring situation.
Definition: nodewiring.cpp:74
Actual implementation of the link between nodes, also acting as "track switch" for the execution path...
Definition: nodewiring.hpp:65
WiringFactory(lib::AllocationCluster &a)
As the WiringFactory (and all the embedded factories for the specific wiring situations) use the Allo...
Definition: nodewiring.cpp:130
WiringDescriptor & operator()(WiringSituation const &setup)
create and configure a concrete wiring descriptor to tie a ProcNode to its predecessor nodes...
Definition: nodewiring.cpp:151
Steam-Layer implementation namespace root.
ConfigSelector< WiringDescriptorFactory, FunctionType, AllocationCluster &> WiringSelector
preconfigured table of all possible factories
Definition: nodewiring.cpp:104
CombineFlags< AllFlags > AllFlagCombinations
build the list of all possible flag combinations
Definition: nodewiring.cpp:55
Apply< AllFlagCombinations::List, DefineConfigByFlags > AllConfigs
build a configuration type for each of those flag combinations
Definition: nodewiring.cpp:58
Mechanism to wire ProcNode instances for a render network.
WiringDescriptor &() FunctionType(WiringSituation const &)
invocation signature of the factories
Definition: nodewiring.cpp:98
< using the parent StateAdapter for buffer allocations
generate all possible on-off combinations of the given flags
Helper for fabricating ProcNode Wiring configurations.
A pile of objects sharing common allocation and lifecycle.
filter away those types which don&#39;t fulfil a predicate metafunction
auto setup(FUN &&workFun)
Helper: setup a Worker-Pool configuration for the test.
Chunks of operation for invoking the rendernodes.
Metaprogramming: Helpers for manipulating lists-of-types.
create a configuration type for the given list-of-flags
Interface: Description of the input and output ports, processing function and predecessor nodes for a...
Definition: procnode.hpp:78
The real invocation context state implementation.
Filter< AllConfigs::List, Instantiation< Strategy >::Test > PossibleConfigs
filter those configurations which actually define a wiring strategy
Definition: nodewiring.cpp:61
apply a transformation (template) to each type in the list
Sometimes we need to choose a different implementation for dealing with some special cases...
Finding out about a concrete way of wiring up a ProcNode about to be built.