LUMIERA.clone/src/steam/engine/nodewiring-obsolete.hpp
Ichthyostega 806db414dd Copyright: clarify and simplify the file headers
* Lumiera source code always was copyrighted by individual contributors
 * there is no entity "Lumiera.org" which holds any copyrights
 * Lumiera source code is provided under the GPL Version 2+

== Explanations ==
Lumiera as a whole is distributed under Copyleft, GNU General Public License Version 2 or above.
For this to become legally effective, the ''File COPYING in the root directory is sufficient.''

The licensing header in each file is not strictly necessary, yet considered good practice;
attaching a licence notice increases the likeliness that this information is retained
in case someone extracts individual code files. However, it is not by the presence of some
text, that legally binding licensing terms become effective; rather the fact matters that a
given piece of code was provably copyrighted and published under a license. Even reformatting
the code, renaming some variables or deleting parts of the code will not alter this legal
situation, but rather creates a derivative work, which is likewise covered by the GPL!

The most relevant information in the file header is the notice regarding the
time of the first individual copyright claim. By virtue of this initial copyright,
the first author is entitled to choose the terms of licensing. All further
modifications are permitted and covered by the License. The specific wording
or format of the copyright header is not legally relevant, as long as the
intention to publish under the GPL remains clear. The extended wording was
based on a recommendation by the FSF. It can be shortened, because the full terms
of the license are provided alongside the distribution, in the file COPYING.
2024-11-17 23:42:55 +01:00

231 lines
7 KiB
C++
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
NODEWIRING.hpp - Implementation of the node network and operation control
Copyright (C)
2008, Hermann Vosseler <Ichthyostega@web.de>
  **Lumiera** is free software; you can redistribute it and/or modify it
  under the terms of the GNU General Public License as published by the
  Free Software Foundation; either version 2 of the License, or (at your
  option) any later version. See the file COPYING for further details.
*/
/** @file nodewiring.hpp
** Mechanism to wire ProcNode instances for a render network
** @todo unfinished draft from 2009 regarding the render process
** @deprecated 2024 this header will likely be obsoleted
** @see node-wiring-builder.hpp for the rewritten node-builder
*/
#ifndef ENGINE_NODEWIRING_OBSOLETE_H
#define ENGINE_NODEWIRING_OBSOLETE_H
#include "steam/engine/connectivity-obsolete.hpp"
#include "lib/allocation-cluster.hpp"
#include "lib/ref-array.hpp"
#include "lib/util-foreach.hpp"
#include "lib/nocopy.hpp"
#include <memory>
namespace steam {
namespace engine {
class WiringFactory;
namespace config { class WiringFactoryImpl; }
/////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1367 : inlined here and then dropped in node-wiring-builder.hpp
using lib::RefArray;
/**
* Finding out about a concrete way of wiring up a
* ProcNode about to be built. Such a (temporary) setup object
* is used while building the low-level model. It is loaded with
* information concerning the intended connections to be made
* and then used to initialise the wiring descriptor, which
* in turn allows us to setup the ProcNode.
*
* \par intended usage pattern
* The goal is to describe the constellation of a new node to be built.
* Thus, we start with one or several existing nodes, specifying which
* output should go to which input pin of the yet-to-be created new node.
* When intending to create a source node, a default WiringSituation
* should be used, without adding any connection information.
*
* @deprecated WIP-WIP-WIP 2024 Node-Invocation is reworked from ground up for the »Playback Vertical Slice«
*/
class WiringSituation
: util::NonCopyable
{
long flags_;
asset::Proc::ProcFunc* function_;
public: /* === API for querying collected data === */
RefArray<ChannelDescriptor>&
makeOutDescriptor() const
{
UNIMPLEMENTED ("build new output descriptors for the node under construction"); //////////TODO: where to get the information about the output channels???
}
RefArray<InChanDescriptor>&
makeInDescriptor() const
{
UNIMPLEMENTED ("build new input descriptors for the node under construction");
}
Connectivity::ProcFunc*
resolveProcessingFunction() const
{
REQUIRE (function_);
return function_;
}
lumiera::NodeID const&
createNodeID() const
{
UNIMPLEMENTED ("initiate generation of a new unique node-ID"); // see rendergraph.cpp
}
public: /* === API for specifying the desired wiring === */
/** A default WiringSituation doesn't specify any connections.
* It can be used as-is for building a source node, or augmented
* with connection information later on.
*/
WiringSituation()
: flags_(0)
, function_(0)
{
UNIMPLEMENTED ("representation of the intended wiring");
}
/** Continue the wiring by hooking directly into the output
* of an existing predecessor node
*/
WiringSituation (PNode predecessor)
: flags_(0)
, function_(0)
{
UNIMPLEMENTED ("wiring representation; hook up connections 1:1");
REQUIRE (predecessor);
//////////////////////////TODO: see Ticket 254
// for_each (predecessor->outputs(), ..... see also Ticket 183 (invoking member fun in for_each)
}
/** set up a connection leading to a specific input pin of the new node */
WiringSituation&
defineInput (uint inPin, PNode pred, uint outPin)
{
UNIMPLEMENTED ("wiring representation; define new connection");
return *this;
}
/** set up the next input connection,
* originating at a specific output pin of the predecessor */
WiringSituation&
defineInput (PNode pred, uint outPin)
{
UNIMPLEMENTED ("wiring representation; define new connection");
return *this;
}
/** set up the next input connection to a specific input pin,
* originating at a the next/sole output pin of the predecessor */
WiringSituation&
defineInput (uint inPin, PNode pred)
{
UNIMPLEMENTED ("wiring representation; define new connection");
return *this;
}
/** set detail flags regarding the desired node operation mode */
WiringSituation&
setFlag (long code)
{
flags_ |= code;
return *this;
}
long getFlags () const { return flags_; }
/** trigger resolving of the actual processing function */
WiringSituation&
resolveProcessor (asset::Proc const& procAsset)
{
function_ = procAsset.resolveProcessor();
ENSURE (function_);
}
};
/////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1367 : (END)inlined here and then dropped in node-wiring-builder.hpp
/**
* Actual implementation of the link between nodes,
* also acting as "track switch" for the execution path
* chosen while operating the node network for rendering.
* @param STATE Invocation state object controlling the
* behaviour of callDown() while rendering.
* @see StateAdapter
* @see NodeFactory
*/
template<class STATE>
class NodeWiring
: public Connectivity
{
public:
NodeWiring(WiringSituation const& setup)
: Connectivity(setup.makeOutDescriptor(),
setup.makeInDescriptor(),
setup.resolveProcessingFunction(),
setup.createNodeID())
{ }
private:
virtual BuffHandle
callDown (StateClosure_OBSOLETE& currentProcess, uint requestedOutputNr) const
{
STATE thisStep (currentProcess, *this, requestedOutputNr);
return thisStep.retrieve (); // fetch or calculate results
}
};
class WiringFactory
{
lib::AllocationCluster& alloc_;
std::unique_ptr<config::WiringFactoryImpl> pImpl_;
public:
WiringFactory (lib::AllocationCluster& a);
~WiringFactory ();
Connectivity&
operator() (WiringSituation const& setup);
};
}} // namespace steam::engine
#endif