Lumiera  0.pre.03
»edit your freedom«
nodewiring-config.hpp File Reference

Go to the source code of this file.

Description

Sometimes we need to choose a different implementation for dealing with some special cases.

While for simple cases, just testing a flag or using a switch statement will do the job, matters get more difficult when we have to employ a completely different execution path for each of the different cases, while using a set of common building blocks.

In the Lumiera render engine, right on the critical path, we need some glue code for invoking the predecessor nodes when pulling a given processing node. The actual sequence is quite dependent on the specific situation each node is wired up, regarding buffer allocation, cache querying and the possible support for GPU processing and render farms. The solution is to define specialisations of a Strategy template using the specific configuration as template argument. Based on these, we can create a collection of factories, which in turn will build the internal wiring for the individual ProcNode instances in accordance to the situation determined for this node, expressed as a set of flags. As a net result, each node has an individual configuration (as opposed to creating a lot of hand-written individual ProcNode subclasses), but parts of this configuration assembly is done already at compile time, allowing for additional checks by typing and for possible optimisation.
See also
steam::engine::config::Strategy
nodewiring.hpp
configflags.hpp
config-flags-test.cpp

Definition in file nodewiring-config.hpp.

#include "lib/meta/configflags.hpp"
#include "lib/meta/util.hpp"
#include "lib/util.hpp"
#include <functional>
#include <bitset>
#include <map>

Classes

class  ConfigSelector< Factory, FUNC, PAR >
 Helper for fabricating ProcNode Wiring configurations. More...
 
struct  ConfigSelector< Factory, FUNC, PAR >::FactoryHolder< FAC >
 < impl type erasure More...
 
struct  ConfigSelector< Factory, FUNC, PAR >::FactoryTableBuilder
 Helper: a visitor usable with FlagInfo. More...
 
struct  Instantiation< _CandidateTemplate_ >
 Helper template for semi-automatic detection if instantiation is possible. More...
 
class  Instantiation< _CandidateTemplate_ >::Test< X >
 

Typedefs

typedef size_t IxID
 

Namespaces

 steam
 Steam-Layer implementation namespace root.
 
 steam::engine
 Lumiera's render engine core and operational control.
 
 steam::engine::config
 Policies, definitions and tweaks to control the actual setup and behaviour of the render engine, and the way, render nodes are wired and instantiated.
 

Class Documentation

◆ steam::engine::config::Instantiation

struct steam::engine::config::Instantiation
+ Collaboration diagram for Instantiation< _CandidateTemplate_ >: