From 83067aa318139bfe5cda709c8c3a4f5a60ed3982 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Mon, 31 Aug 2009 12:16:47 +0200 Subject: [PATCH] WIP: ...to do so, some considerations regarding the entrance point.. --- src/lib/streamtype.hpp | 2 +- src/proc/Makefile.am | 1 + src/proc/engine/buffhandle.hpp | 2 +- src/proc/engine/nodeinvocation.hpp | 4 +- src/proc/engine/render-invocation.cpp | 86 +++++++++++++++++++++++++++ src/proc/engine/render-invocation.hpp | 17 ++++-- src/proc/state.hpp | 14 ++++- 7 files changed, 114 insertions(+), 12 deletions(-) create mode 100644 src/proc/engine/render-invocation.cpp diff --git a/src/lib/streamtype.hpp b/src/lib/streamtype.hpp index fe5bbeb41..bde5e8e94 100644 --- a/src/lib/streamtype.hpp +++ b/src/lib/streamtype.hpp @@ -125,7 +125,7 @@ namespace lumiera { /** - * Special case of an implementation type being only partialiy specified + * Special case of an implementation type being only partially specified * Besides requiring some aspect of the implementation type, there is the * promise to fill in defaults to build a complete implementation type * if necessary. diff --git a/src/proc/Makefile.am b/src/proc/Makefile.am index 2882546c2..848f595d2 100644 --- a/src/proc/Makefile.am +++ b/src/proc/Makefile.am @@ -77,6 +77,7 @@ liblumiprocengine_la_SOURCES = \ $(liblumiprocengine_la_srcdir)/renderengine.cpp \ $(liblumiprocengine_la_srcdir)/source.cpp \ $(liblumiprocengine_la_srcdir)/stateproxy.cpp \ + $(liblumiprocengine_la_srcdir)/render-invocation.cpp \ $(liblumiprocengine_la_srcdir)/trafo.cpp diff --git a/src/proc/engine/buffhandle.hpp b/src/proc/engine/buffhandle.hpp index afe3470be..40a5d1996 100644 --- a/src/proc/engine/buffhandle.hpp +++ b/src/proc/engine/buffhandle.hpp @@ -68,7 +68,7 @@ namespace engine { return *pBuffer_; } - protected: + private: PBuff pBuffer_; long sourceID_; }; diff --git a/src/proc/engine/nodeinvocation.hpp b/src/proc/engine/nodeinvocation.hpp index 849e5ca30..13dbbd383 100644 --- a/src/proc/engine/nodeinvocation.hpp +++ b/src/proc/engine/nodeinvocation.hpp @@ -88,7 +88,7 @@ namespace engine { - public: /* === proxying the State interface === */ + private: /* === proxying the State interface === */ virtual void releaseBuffer (BuffHandle& bh) { current_.releaseBuffer (bh); } @@ -176,7 +176,7 @@ namespace engine { : Invocation(sta, w, outCh) {} virtual BuffHandle - allocateBuffer (BufferDescriptor const& bd) { return parent_.allocateBuffer(bd); } + allocateBuffer (BufferDescriptor const& bd) { return parent_.allocateBuffer(bd); } ////////////TODO: actually implement the "allocate from parent" logic! }; struct AllocBufferFromCache ///< using the global current State, which will delegate to Cache diff --git a/src/proc/engine/render-invocation.cpp b/src/proc/engine/render-invocation.cpp new file mode 100644 index 000000000..0fae10cfe --- /dev/null +++ b/src/proc/engine/render-invocation.cpp @@ -0,0 +1,86 @@ +/* + RenderInvocation - Interface for creating processing nodes of various kinds + + 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. + +* *****************************************************/ + + +#include "proc/engine/render-invocation.hpp" + +namespace engine { + + namespace { // Details... + + + } // (END) Details... + + +// using mobject::Placement; +// using mobject::session::Effect; + + + /** @internal */ + BuffHandle + RenderInvocation::allocateBuffer (BufferDescriptor const&) + { + UNIMPLEMENTED ("allocate a suitable buffer to hold a frame of the denoted type"); + } + + + + void + RenderInvocation::releaseBuffer (BuffHandle& bh) + { + UNIMPLEMENTED ("free a buffer"); + } + + + + BuffHandle + RenderInvocation::fetch (FrameID const& fID) + { + UNIMPLEMENTED ("fetch a buffer with input data"); + } + + + + void + RenderInvocation::is_calculated (BuffHandle const& bh) + { + UNIMPLEMENTED ("declare a buffer as fully calculated and done"); + } + + + + FrameID const& + RenderInvocation::genFrameID (NodeID const&, uint chanNo) + { + UNIMPLEMENTED ("derive/generate an ID to denote this specific fame+Node position in the graph"); + } + + + + BuffTableStorage& + RenderInvocation::getBuffTableStorage() /////////////TODO need somehow to denote the specific storage requirements + { + UNIMPLEMENTED ("allocate a chunk of storage suitable for holding the buffer pointer tables"); + } + + +} // namespace engine diff --git a/src/proc/engine/render-invocation.hpp b/src/proc/engine/render-invocation.hpp index 963df8058..d26d87c4f 100644 --- a/src/proc/engine/render-invocation.hpp +++ b/src/proc/engine/render-invocation.hpp @@ -58,19 +58,24 @@ namespace engine { RenderInvocation() { } - virtual State& getCurrentImplementation () { return current_; } + private: /* === top-level implementation of the State interface === */ - public: /* === proxying the State interface === */ + BuffHandle allocateBuffer (BufferDescriptor const&); -// virtual void releaseBuffer (BuffHandle& bh) { current_.releaseBuffer (bh); } + void releaseBuffer (BuffHandle& bh); -// virtual void is_calculated (BuffHandle const& bh) { current_.is_calculated (bh); } + BuffHandle fetch (FrameID const& fID); -// virtual BuffHandle fetch (FrameID const& fID) { return current_.fetch (fID); } + void is_calculated (BuffHandle const& bh); - // note: allocateBuffer() is chosen specifically based on the actual node wiring + FrameID const& genFrameID (NodeID const&, uint chanNo); + + BuffTableStorage& getBuffTableStorage(); + + virtual State& getCurrentImplementation () { return *this; } + }; diff --git a/src/proc/state.hpp b/src/proc/state.hpp index 0f4e182c9..a37e85933 100644 --- a/src/proc/state.hpp +++ b/src/proc/state.hpp @@ -42,6 +42,16 @@ namespace engine { class StateAdapter; class BuffTableStorage; + + /** + * Abstraction denoting the state of a currently ongoing render/calculation + * process, as it is tied to the supporting facilities of the backend. + * An State (subclass) instance is the sole connection for the render node + * to invoke services of the backend needed to carry out the calculations. + * + * @see engine::RenderInvocation top-level entrance point + * @see nodeinvocation.hpp impl. used from \em within the nodes + */ class State { public: @@ -75,8 +85,8 @@ namespace engine { */ virtual FrameID const& genFrameID (NodeID const&, uint chanNo) =0; - /** try to fetch an existing buffer containing the denoted frame from - * a cache or similar backing system (e.g. peer over the network). + /** try to fetch an existing buffer containing the denoted frame + * from a cache or similar backing system (e.g. network peer). * @return either a handle to a readonly buffer, or a null handle * @note the client is responsible for not modifying the provided data */