33#ifndef STEAM_ENGINE_TRACKING_HEAP_BLOCK_PROVIDER_H
34#define STEAM_ENGINE_TRACKING_HEAP_BLOCK_PROVIDER_H
42#include <unordered_map>
56 using std::unique_ptr;
93 REQUIRE (
storage_,
"Block was never prepared for use");
106 using PoolTable = std::unordered_map<HashVal,BlockPool>;
141 template<
typename TY>
163 template<
typename TY>
168 throw error::Invalid (
"Buffer with the given ID not yet emitted");
171 TY* converted = std::launder (
reinterpret_cast<TY*
> (memoryBlock.
accessMemory()));
Abstraction to represent buffer management and lifecycle within the render engine.
Simple vector based collection of pointers, managing lifecycle of the pointed-to objects.
placeholder type for the contents of a data buffer.
Handle for a buffer for processing data, abstracting away the actual implementation.
Interface: a facility providing and managing working buffers for media calculations.
an opaque mark to be used by the BufferProvider implementation.
simple BufferProvider implementation with additional allocation tracking.
size_t emittedCnt() const
diagn::Block * locateBlock(HashVal typeID, void *)
virtual void mark_emitted(HashVal, LocalTag const &) override
unique_ptr< diagn::PoolTable > pool_
TY & accessAs(uint bufferID)
convenience shortcut: access the buffer with the given number, then try to convert the raw memory to ...
bool withinOutputSequence(uint bufferID) const
TrackingHeapBlockProvider()
virtual uint prepareBuffers(uint count, HashVal typeID) override
virtual BuffHandle provideLockedBuffer(HashVal typeID) override
virtual void detachBuffer(HashVal, LocalTag const &, Buff &) override
mark a buffer as officially discarded
ScopedPtrVect< diagn::Block > outSeq_
virtual ~TrackingHeapBlockProvider()
diagn::Block * searchInOutSeqeuence(void *storage)
diagn::Block & access_emitted(uint bufferID)
diagn::BlockPool & getBlockPoolFor(HashVal typeID)
Helper for implementing a diagnostic BufferProvider: A block of heap allocated storage,...
void * accessMemory() const
unique_ptr< char[]> storage_
Any copy and copy construction prohibited.
Lumiera error handling (C++ interface).
Hash value types and utilities.
size_t HashVal
a STL compatible hash value
LumieraError< LERR_(INVALID)> Invalid
std::unordered_map< HashVal, BlockPool > PoolTable
Steam-Layer implementation namespace root.
Managing lifecycle for a collection of objects.