* 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.
158 lines
4.1 KiB
C++
158 lines
4.1 KiB
C++
/*
|
||
BUFFTABLE.hpp - Table of buffer pointers to be used by the render nodes
|
||
|
||
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 bufftable.hpp
|
||
** helper for organisation of render data buffers
|
||
** Used during the process of _"pulling"_ a render node, which recursively might
|
||
** pull further nodes. Any node has a _render calculation function,_ which in turn
|
||
** needs input and output buffers
|
||
** @see buffer-provider.hpp
|
||
*/
|
||
|
||
|
||
#ifndef ENGINE_BUFFHTABLE_H
|
||
#define ENGINE_BUFFHTABLE_H
|
||
|
||
|
||
#include "lib/error.hpp"
|
||
#include "steam/engine/buffhandle.hpp"
|
||
#include "steam/engine/proc-node.hpp"
|
||
#include "lib/iter-adapter.hpp"
|
||
|
||
#include <vector>
|
||
#include <utility>
|
||
|
||
|
||
|
||
namespace steam {
|
||
namespace engine {
|
||
|
||
using std::pair;
|
||
using std::vector;
|
||
|
||
|
||
/**
|
||
* Tables of buffer handles and corresponding dereferenced buffer pointers.
|
||
* Used within the invocation of a processing node to calculate data.
|
||
* The tables are further differentiated into input data buffers and output
|
||
* data buffers. The tables are supposed to be implemented as bare "C" arrays,
|
||
* thus the array of real buffer pointers can be fed directly to the
|
||
* processing function of the respective node.
|
||
*
|
||
* @todo this whole design is a first attempt and rather clumsy. It should be reworked
|
||
* to use a single contiguous memory area and just layer the object structure on top
|
||
* (by using placement new). Yet the idea of an stack-like organisation should be retained
|
||
*/
|
||
struct BuffTable
|
||
{
|
||
typedef BuffHandle * PHa;
|
||
typedef BuffHandle::PBuff * PBu;
|
||
|
||
struct StorageChunk
|
||
{ };
|
||
|
||
template<uint count>
|
||
struct Storage
|
||
{
|
||
enum{size = count * sizeof(StorageChunk)};
|
||
};
|
||
|
||
class Builder
|
||
{
|
||
public:
|
||
Builder& announce (uint count, BuffDescr const& type);
|
||
BuffTable& build();
|
||
};
|
||
|
||
static Builder& prepare (const size_t STORAGE_SIZE, void* storage);
|
||
|
||
void lockBuffers();
|
||
void releaseBuffers();
|
||
|
||
typedef vector<BuffHandle> BuffHandleTable;
|
||
typedef lib::RangeIter<BuffHandleTable::iterator> iterator;
|
||
|
||
iterator buffers();
|
||
iterator inBuffers();
|
||
iterator outBuffers();
|
||
};
|
||
|
||
|
||
|
||
|
||
/* === Implementation === */
|
||
|
||
inline BuffTable::Builder&
|
||
BuffTable::prepare (const size_t STORAGE_SIZE, void* storage)
|
||
{
|
||
UNIMPLEMENTED ("expose a builder object for outfitting a buffer pointer table");
|
||
}
|
||
|
||
|
||
inline BuffTable::Builder&
|
||
BuffTable::Builder::announce (uint count, BuffDescr const& type)
|
||
{
|
||
UNIMPLEMENTED ("accept announcement of additional buffer table entries required");
|
||
}
|
||
|
||
|
||
inline BuffTable&
|
||
BuffTable::Builder::build()
|
||
{
|
||
UNIMPLEMENTED ("finally drop off the newly configured buffer pointer table");
|
||
}
|
||
|
||
|
||
inline void
|
||
BuffTable::lockBuffers()
|
||
{
|
||
UNIMPLEMENTED ("convenience shortcut: lock all preconfigured buffers within this table through the underlying buffer provider");
|
||
}
|
||
|
||
|
||
inline void
|
||
BuffTable::releaseBuffers()
|
||
{
|
||
UNIMPLEMENTED ("convenience shortcut: release all the buffers managed through this buffer table, by forwarding to the underlying buffer provider");
|
||
}
|
||
|
||
|
||
|
||
inline BuffTable::iterator
|
||
BuffTable::buffers()
|
||
{
|
||
UNIMPLEMENTED ("expose an iterator to yield all prepared buffers within this buffer table");
|
||
}
|
||
|
||
|
||
inline BuffTable::iterator
|
||
BuffTable::inBuffers()
|
||
{
|
||
UNIMPLEMENTED ("expose an iterator to access all the input buffer slots of this buffer table");
|
||
}
|
||
|
||
|
||
inline BuffTable::iterator
|
||
BuffTable::outBuffers()
|
||
{
|
||
UNIMPLEMENTED ("expose an iterator to access all the output buffer slots of this buffer table");
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
|
||
}} // namespace steam::engine
|
||
#endif
|