2009-09-04 17:43:53 +02:00
|
|
|
/*
|
2024-07-04 23:54:13 +02:00
|
|
|
NODE-BUILDER.hpp - Setup of render nodes connectivity
|
2010-12-17 23:28:49 +01:00
|
|
|
|
2009-09-04 17:43:53 +02:00
|
|
|
Copyright (C) Lumiera.org
|
|
|
|
|
2009, Hermann Vosseler <Ichthyostega@web.de>
|
2024-07-05 23:36:41 +02:00
|
|
|
2024, Hermann Vosseler <Ichthyostega@web.de>
|
2010-12-17 23:28:49 +01:00
|
|
|
|
2009-09-04 17:43:53 +02:00
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
|
modify it under the terms of the GNU General Public License as
|
2010-12-17 23:28:49 +01:00
|
|
|
published by the Free Software Foundation; either version 2 of
|
|
|
|
|
the License, or (at your option) any later version.
|
|
|
|
|
|
2009-09-04 17:43:53 +02:00
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU General Public License for more details.
|
2010-12-17 23:28:49 +01:00
|
|
|
|
2009-09-04 17:43:53 +02:00
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
|
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
2010-12-17 23:28:49 +01:00
|
|
|
|
2009-09-04 17:43:53 +02:00
|
|
|
*/
|
|
|
|
|
|
2024-07-04 23:54:13 +02:00
|
|
|
/** @file node-builder.hpp
|
2024-07-05 23:36:41 +02:00
|
|
|
** Specialised shorthand notation for building the Render Node network.
|
|
|
|
|
** During the Builder run, the render nodes network will be constructed by gradually
|
|
|
|
|
** refining the connectivity structure derived from interpreting the »high-level model«
|
|
|
|
|
** from the current Session. At some point, it is essentially clear what data streams
|
|
|
|
|
** must be produced and what media processing functionality from external libraries
|
|
|
|
|
** will be utilised to achieve this goal. This is when the fluent builder notation
|
|
|
|
|
** defined in this header comes into play, allowing to package the fine grained and
|
|
|
|
|
** in part quite confusing details of parameter wiring and invocation preparation into
|
|
|
|
|
** some goal oriented building blocks, that can be combined and directed with greater
|
|
|
|
|
** clarity by the control structure to govern the build process.
|
2009-09-04 17:43:53 +02:00
|
|
|
**
|
2024-07-05 23:36:41 +02:00
|
|
|
** # Levels of connectivity building
|
|
|
|
|
**
|
|
|
|
|
** The actual node connectivity is established by a process of gradual refinement,
|
|
|
|
|
** operating over several levels of abstraction. Each of these levels uses its associated
|
|
|
|
|
** builder and descriptor records to collect information, which is then emitted by a
|
|
|
|
|
** _terminal invocation_ to produce the result; the higher levels thereby rely on the
|
|
|
|
|
** lower levels to fill in and elaborate the details.
|
|
|
|
|
** - Level-1 is the preparation of an actual frame processing operation; the Level-1-builder
|
|
|
|
|
** is in fact the implementation class sitting behind a Render Node's _Port._ It is called
|
|
|
|
|
** a _Turnout_ and contains a preconfigured »blue print« for the data structure layout
|
|
|
|
|
** used for the invocation; its purpose is to generate the actual data structure on the
|
|
|
|
|
** stack, holding all the necessary buffers and parameters ready for invoking the external
|
|
|
|
|
** library functions. Since the actual data processing is achieved by a _pull processing,_
|
|
|
|
|
** originating at the top level exit nodes and propagating down towards the data sources,
|
|
|
|
|
** all the data feeds at all levels gradually link together, forming a _TurnoutSystem._
|
|
|
|
|
** - Level-2 generates the actual network of Render Nodes, which in turn will have the
|
|
|
|
|
** Turnout instances for Level-1 embedded into its internal ports. Conceptually, a
|
|
|
|
|
** _Port_ is where data production can be requested, and the processing will then
|
|
|
|
|
** retrieve its prerequisite data from the ports of the _Leads,_ which are the
|
|
|
|
|
** prerequisite nodes situated one level below or one step closer to the source.
|
|
|
|
|
** - Level-3 establishes the processing steps and data retrieval links between them;
|
|
|
|
|
** at this level, thus the outline of possible processing pathways is established.
|
|
|
|
|
** After spelling out the desired connectivity at a high level, the so called »Level-3 build
|
|
|
|
|
** walk« is triggered by invoking the [terminal builder operation](\ref ProcBuilder::build()
|
|
|
|
|
** on the [processing builder](\ref ProcBuilder) corresponding to the topmost node. This
|
|
|
|
|
** build walk will traverse the connectivity graph depth-first, and then start invoking the
|
|
|
|
|
** Level-2 builder operations bottom-up to generate and wire up the corresponding Render Nodes.
|
|
|
|
|
**
|
|
|
|
|
** @todo WIP-WIP-WIP 7/2024 Node-Invocation is reworked from ground up -- some parts can not be
|
|
|
|
|
** spelled out completely yet, since we have to build this tightly interlocked system of
|
|
|
|
|
** code moving bottom up, and then filling in further details later working top-down.
|
2024-06-21 16:14:24 +02:00
|
|
|
**
|
2018-11-15 23:59:23 +01:00
|
|
|
** @see steam::engine::NodeFactory
|
2009-09-04 17:43:53 +02:00
|
|
|
** @see nodewiring.hpp
|
|
|
|
|
** @see node-basic-test.cpp
|
|
|
|
|
**
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
2024-07-04 23:54:13 +02:00
|
|
|
#ifndef ENGINE_NODE_BUILDER_H
|
|
|
|
|
#define ENGINE_NODE_BUILDER_H
|
2009-09-04 17:43:53 +02:00
|
|
|
|
|
|
|
|
|
2024-06-29 04:23:55 +02:00
|
|
|
#include "steam/engine/proc-node.hpp"
|
2018-03-24 05:35:13 +01:00
|
|
|
#include "lib/nocopy.hpp"
|
2009-09-04 17:43:53 +02:00
|
|
|
|
2024-07-02 23:33:23 +02:00
|
|
|
#include <utility>
|
2009-09-04 17:43:53 +02:00
|
|
|
|
|
|
|
|
|
2018-11-15 23:55:13 +01:00
|
|
|
namespace steam {
|
2009-09-04 17:43:53 +02:00
|
|
|
namespace engine {
|
|
|
|
|
|
2024-07-02 23:33:23 +02:00
|
|
|
using std::move;
|
|
|
|
|
|
2024-06-24 23:49:55 +02:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET #1367 : Rebuild the Node Invocation
|
2009-09-04 17:43:53 +02:00
|
|
|
|
2024-07-05 13:41:01 +02:00
|
|
|
class PortBuilder
|
2024-06-24 23:49:55 +02:00
|
|
|
: util::MoveOnly
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
|
2024-07-05 13:41:01 +02:00
|
|
|
PortBuilder
|
2024-07-02 23:33:23 +02:00
|
|
|
inSlots (uint s)
|
|
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED ("define number of predecessor-source slots");
|
|
|
|
|
return move(*this);
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-05 13:41:01 +02:00
|
|
|
PortBuilder
|
2024-07-02 23:33:23 +02:00
|
|
|
outSlots (uint r)
|
|
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED ("define number of result slots");
|
|
|
|
|
return move(*this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template<class ILA, typename...ARGS>
|
2024-07-05 13:41:01 +02:00
|
|
|
PortBuilder
|
2024-07-02 23:33:23 +02:00
|
|
|
createBuffers (ARGS&& ...args)
|
|
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED ("define builder for all buffers to use");
|
|
|
|
|
return move(*this);
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-05 13:41:01 +02:00
|
|
|
/****************************************************//**
|
|
|
|
|
* Terminal: complete the Port wiring and return to the node level.
|
|
|
|
|
*/
|
|
|
|
|
void //////////////////////////////////////////////////////////OOO return type
|
|
|
|
|
completePort()
|
|
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED("finish and link-in port definition");
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class NodeBuilder
|
|
|
|
|
: util::MoveOnly
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
NodeBuilder
|
2024-07-05 23:36:41 +02:00
|
|
|
addLead (ProcNode const& lead)
|
2024-07-05 13:41:01 +02:00
|
|
|
{
|
2024-07-05 23:36:41 +02:00
|
|
|
UNIMPLEMENTED ("append the given predecessor node to the sequence of leads");
|
2024-07-05 13:41:01 +02:00
|
|
|
return move(*this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void //////////////////////////////////////////////////////////OOO return type
|
|
|
|
|
preparePort ()
|
|
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED ("recursively enter detailed setup of a single processing port");
|
|
|
|
|
// return move(*this);
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-24 23:49:55 +02:00
|
|
|
/****************************************************//**
|
|
|
|
|
* Terminal: complete the Connectivity defined thus far.
|
|
|
|
|
*/
|
2024-06-29 04:23:55 +02:00
|
|
|
Connectivity
|
2024-06-24 23:49:55 +02:00
|
|
|
build()
|
|
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED("Node-Connectivity Setup");
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2024-07-05 23:36:41 +02:00
|
|
|
/**
|
|
|
|
|
* Entrance point for building actual Render Node Connectivity (Level-2)
|
|
|
|
|
*/
|
|
|
|
|
inline auto
|
|
|
|
|
prepareNode()
|
|
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED("start building a new Render Node at Level-2");
|
|
|
|
|
return NodeBuilder{};
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-24 23:49:55 +02:00
|
|
|
|
2024-07-05 13:41:01 +02:00
|
|
|
class ProcBuilder
|
|
|
|
|
: util::MoveOnly
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
void //////////////////////////////////////////////////////////OOO return type
|
|
|
|
|
requiredSources ()
|
|
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED ("enumerate all source feeds required");
|
|
|
|
|
// return move(*this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void //////////////////////////////////////////////////////////OOO return type
|
|
|
|
|
retrieve (void* streamType)
|
|
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED ("recursively define a predecessor feed");
|
|
|
|
|
// return move(*this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/****************************************************//**
|
|
|
|
|
* Terminal: trigger the Level-3 build walk to produce a ProcNode network.
|
|
|
|
|
*/
|
|
|
|
|
void //////////////////////////////////////////////////////////OOO return type
|
|
|
|
|
build()
|
|
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED("Level-3 build-walk");
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class LinkBuilder
|
|
|
|
|
: util::MoveOnly
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
void //////////////////////////////////////////////////////////OOO return type
|
|
|
|
|
from (void* procAsset)
|
|
|
|
|
{
|
|
|
|
|
UNIMPLEMENTED ("recursively enter definition of processor node to produce this feed link");
|
|
|
|
|
// return move(*this);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2024-07-05 23:36:41 +02:00
|
|
|
|
2024-06-24 23:49:55 +02:00
|
|
|
/**
|
2024-07-05 23:36:41 +02:00
|
|
|
* Entrance point for defining data flows and processing steps.
|
2024-06-24 23:49:55 +02:00
|
|
|
*/
|
2024-07-05 23:36:41 +02:00
|
|
|
inline auto
|
|
|
|
|
retrieve(void* streamType)
|
2024-06-24 23:49:55 +02:00
|
|
|
{
|
2024-07-05 23:36:41 +02:00
|
|
|
UNIMPLEMENTED("start a connectivity definition at Level-3");
|
2024-07-05 13:41:01 +02:00
|
|
|
return NodeBuilder{};
|
2024-06-24 23:49:55 +02:00
|
|
|
}
|
2009-09-04 17:43:53 +02:00
|
|
|
|
|
|
|
|
|
2018-11-15 23:55:13 +01:00
|
|
|
}} // namespace steam::engine
|
2024-07-04 23:54:13 +02:00
|
|
|
#endif /*ENGINE_NODE_BUILDER_H*/
|