The intention is to build the tracking functionality from scratch, while wrapping the old implementation as delegate. Hopefully this allows to reduce the complexity of the existing implementation step by step, until I'm ''able to grasp what this implementation does''. This old implementation works, but is highly problematic code. The Git history shows that I had already problems to understand this code while building the DiagnosticOutputSlot, one year later. To my defense, in both cases (2011 and 2012), I had no clear idea yet how the processing within the engine would work, and thus I considered that Buffer Type registry a mere implementation detail, that can be lumped into the »code behind«.
70 lines
1.8 KiB
C++
70 lines
1.8 KiB
C++
/*
|
||
DiagnosticBufferProvider - helper for testing against the BufferProvider interface
|
||
|
||
Copyright (C)
|
||
2011, 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 diagnostic-buffer-provider.cpp
|
||
** Implementation details of unit test support regarding internals of the render engine.
|
||
**
|
||
** @todo WIP from 2013, half finished, stalled
|
||
** @see buffer-provider-protocol-test.cpp
|
||
*/
|
||
|
||
|
||
//#include "lib/error.hpp"
|
||
//#include "include/logging.h"
|
||
//#include "lib/meta/function.hpp"
|
||
|
||
#include "steam/engine/diagnostic-buffer-provider.hpp"
|
||
#include "steam/engine/heap-mem-provider.hpp"
|
||
|
||
|
||
namespace steam {
|
||
namespace engine {
|
||
|
||
|
||
DiagnosticBufferProvider::DiagnosticBufferProvider()
|
||
: BufferProvider{"Diagnostic_HeapAllocated"}
|
||
{ }
|
||
|
||
DiagnosticBufferProvider::~DiagnosticBufferProvider()
|
||
{
|
||
// INFO (proc_mem, "discarding %zu diagnostic buffer entries", outSeq_.size()); ////////////OOO implement based on dedicated tracking information in-object
|
||
}
|
||
|
||
|
||
|
||
|
||
/* === diagnostic API === */
|
||
|
||
bool
|
||
BufferDiagnostic::buffer_was_used (uint bufferID)
|
||
{
|
||
return dbp_.heapMemProvider_.access_emitted(bufferID).was_used();
|
||
}
|
||
|
||
|
||
bool
|
||
BufferDiagnostic::buffer_was_closed (uint bufferID)
|
||
{
|
||
return dbp_.heapMemProvider_.access_emitted(bufferID).was_closed();
|
||
}
|
||
|
||
|
||
void*
|
||
BufferDiagnostic::accessMemory (uint bufferID)
|
||
{
|
||
return dbp_.heapMemProvider_.access_emitted(bufferID).accessMemory();
|
||
}
|
||
|
||
|
||
}} // namespace engine
|