lumiera_/src/proc/engine/nodeoperation.hpp

73 lines
2.1 KiB
C++
Raw Normal View History

/*
NODEOPERATION.hpp - Specify how the nodes call each other and how processing is organized
Copyright (C) Lumiera.org
2008, Hermann Vosseler <Ichthyostega@web.de>
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_NODEOPERATION_H
#define ENGINE_NODEOPERATION_H
#include "proc/engine/procnode.hpp"
namespace engine {
/**
* Adapter to shield the ProcNode from the actual buffer management,
* allowing the processing function within ProcNode to use logical
* buffer IDs. StateAdapter is created on the stack for each pull()
* call, using setup/wiring data preconfigured by the builder.
* Its job is to provide the actual implementation of the Cache
* push / fetch and recursive downcall to render the source frames.
*/
class StateAdapter
: public State
{
State& parent_;
State& current_;
protected:
StateAdapter (State& callingProcess, WiringDescriptor const&)
: parent_ (callingProcess),
current_(callingProcess.getCurrentImplementation())
{ }
friend class ProcNode; // both are sharing implementation details...
virtual State& getCurrentImplementation () { return current_; }
/** contains the details of Cache query and recursive calls
* to the predecessor node(s), eventually followed by the
* ProcNode::process() callback
*/
void retrieve();
};
} // namespace engine
#endif