/* NODEWIRING.hpp - Implementation of the node network and operation control Copyright (C) Lumiera.org 2008, Hermann Vosseler This program 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. 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. 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. */ #ifndef ENGINE_NODEWIRING_H #define ENGINE_NODEWIRING_H #include "proc/engine/procnode.hpp" #include "lib/allocationcluster.hpp" #include "proc/engine/nodewiring-def.hpp" //#include #include //#include namespace engine { class WiringFactory; namespace config { class WiringFactoryImpl; } using lib::RefArray; /** * 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 NodeWiring : public WiringDescriptor { NodeWiring(WiringSituation& setup) : WiringDescriptor(setup.makeOutDescriptor(), setup.makeInDescriptor(), setup.resolveProcessingFunction(), setup.createNodeID()) { } friend class WiringFactory; protected: virtual BuffHandle callDown (State& currentProcess, uint requestedOutputNr) const { STATE thisStep (currentProcess, *this, requestedOutputNr); return thisStep.retrieve (); // fetch or calculate results } }; class WiringFactory { lib::AllocationCluster& alloc_; boost::scoped_ptr pImpl_; public: WiringFactory (lib::AllocationCluster& a); WiringDescriptor& operator() (WiringSituation& setup, bool cache); //////////////////TODO: of course this will accept *all* the relevant flags (not only "cache") }; } // namespace engine #endif