start stubbing some of the functionality planned thus far
This commit is contained in:
parent
c473784fe3
commit
ca615b9933
4 changed files with 129 additions and 1 deletions
|
|
@ -77,6 +77,9 @@ namespace engine {
|
|||
virtual BuffHandle lockBufferFor (BufferDescriptor const&) =0;
|
||||
virtual void releaseBuffer (BuffHandle const&) =0;
|
||||
|
||||
template<typename BU>
|
||||
BuffHandle lockBufferFor ();
|
||||
|
||||
|
||||
/** describe the kind of buffer managed by this provider */
|
||||
BufferDescriptor getDefaultDescriptor(); //////////////TODO really? there is no sensible "default"
|
||||
|
|
@ -87,7 +90,25 @@ namespace engine {
|
|||
bool verifyValidity (BufferDescriptor const&);
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/* === Implementation === */
|
||||
|
||||
/** convenience shortcut:
|
||||
* prepare and claim ("lock") a buffer suitable
|
||||
* to hold an object of the given type.
|
||||
* @return a handle embedding a suitably configured
|
||||
* buffer descriptor. The corresponding buffer
|
||||
* has been allocated and marked for exclusive use
|
||||
*/
|
||||
template<typename BU>
|
||||
BuffHandle
|
||||
BufferProvider::lockBufferFor()
|
||||
{
|
||||
UNIMPLEMENTED ("convenience shortcut to announce and lock for a specific object type");
|
||||
}
|
||||
|
||||
|
||||
} // namespace engine
|
||||
|
|
|
|||
|
|
@ -132,6 +132,10 @@ namespace engine {
|
|||
// using standard copy operations
|
||||
|
||||
|
||||
template<typename BU>
|
||||
BU& create();
|
||||
|
||||
|
||||
Buff&
|
||||
operator* () const
|
||||
{
|
||||
|
|
@ -146,9 +150,30 @@ namespace engine {
|
|||
&& descriptor_.verifyValidity();
|
||||
}
|
||||
|
||||
size_t
|
||||
size() const
|
||||
{
|
||||
UNIMPLEMENTED ("forward to the buffer provider for storage size diagnostics");
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
/* === Implementation details === */
|
||||
|
||||
/** convenience shortcut: place and maintain an object within the buffer.
|
||||
* This operation performs the necessary steps to attach an object;
|
||||
* if the buffer isn't locked yet, it will do so. Moreover, the created
|
||||
* object will be owned by the buffer management facilities, i.e. the
|
||||
* destructor is registered as cleanup function.
|
||||
*/
|
||||
template<typename BU>
|
||||
BU&
|
||||
BuffHandle::create()
|
||||
{
|
||||
UNIMPLEMENTED ("convenience shortcut to attach/place an object in one sway");
|
||||
}
|
||||
|
||||
|
||||
|
||||
} // namespace engine
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@
|
|||
#include "lib/test/test-helper.hpp"
|
||||
#include "lib/util-foreach.hpp"
|
||||
//#include "proc/play/diagnostic-output-slot.hpp"
|
||||
#include "proc/engine/testframe.hpp"
|
||||
#include "proc/engine/diagnostic-buffer-provider.hpp"
|
||||
#include "proc/engine/buffhandle.hpp"
|
||||
#include "proc/engine/bufftable.hpp"
|
||||
|
|
@ -77,7 +78,6 @@ namespace test {
|
|||
void
|
||||
verifySimpleUsage()
|
||||
{
|
||||
#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #829
|
||||
// Create Test fixture.
|
||||
// In real usage, a suitable memory/frame/buffer provider
|
||||
// will be preconfigured, depending on the usage context
|
||||
|
|
@ -88,6 +88,7 @@ namespace test {
|
|||
CHECK (sizeof(TestFrame) <= buff.size());
|
||||
buff.create<TestFrame>() = testData(0);
|
||||
|
||||
#if false /////////////////////////////////////////////////////////////////////////////////////////////////////////////UNIMPLEMENTED :: TICKET #829
|
||||
TestFrame* storage = *buff;
|
||||
CHECK (testData(0) == *storage);
|
||||
|
||||
|
|
|
|||
81
tests/components/proc/engine/testframe.hpp
Normal file
81
tests/components/proc/engine/testframe.hpp
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
/*
|
||||
TESTFRAME.hpp - test data frame (stub) for checking Render engine functionality
|
||||
|
||||
Copyright (C) Lumiera.org
|
||||
2011, 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 PROC_ENGINE_TESTFRAME_H
|
||||
#define PROC_ENGINE_TESTFRAME_H
|
||||
|
||||
|
||||
//#include "lib/time/timevalue.hpp"
|
||||
|
||||
//#include <string>
|
||||
|
||||
|
||||
//using std::tr1::shared_ptr;
|
||||
//using std::string;
|
||||
|
||||
|
||||
namespace engine {
|
||||
namespace test {
|
||||
|
||||
|
||||
//class TestPlacement;
|
||||
|
||||
/**
|
||||
* Mock data frame for simulated rendering.
|
||||
* A test frame can be created and placed instead of a real data frame.
|
||||
* It doesn't depend on any external libraries and will be self-maintaining.
|
||||
* Placeholder functions are provided for assignment (simulating the actual
|
||||
* calculations); additional diagnostic functions allow to verify the
|
||||
* performed operations after-the fact
|
||||
*
|
||||
* @todo WIP-WIP-WIP 9/11
|
||||
*
|
||||
*/
|
||||
class TestFrame
|
||||
{
|
||||
|
||||
public:
|
||||
};
|
||||
|
||||
|
||||
|
||||
TestFrame
|
||||
testData (uint seqNr)
|
||||
{
|
||||
UNIMPLEMENTED ("build, memorise and expose test data frames on demand");
|
||||
}
|
||||
|
||||
TestFrame
|
||||
testData (uint chanNr, uint seqNr)
|
||||
{
|
||||
UNIMPLEMENTED ("build, memorise and expose test data frames on demand (multi-channel)");
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* == some test data to check == */
|
||||
// extern const lib::time::Duration LENGTH_TestClip;
|
||||
|
||||
|
||||
}} // namespace engine::test
|
||||
#endif
|
||||
Loading…
Reference in a new issue