BufferProvider: provide basic type definitions through buffhandle.hpp
Gradually, the header buffhandle.hpp became the minimal include to use basic `BufferProvider` functionality, since `BuffHandle` provides proxy functionality to lock and access a data buffer. The whole compound connected to the `BufferProvider` has evolved into a cohesive yet central connection hub related to buffer memory; it should thus be extracted, moved down to »Vault« layer and used 4as a foundation for various high-level tasks. In preparation of this step, relevant marker typedefs are re-arranged; notably ''Stream Type'' now includes `buffhandle.hpp`
This commit is contained in:
parent
cc9dbd8a40
commit
994a4cf557
11 changed files with 22 additions and 26 deletions
|
|
@ -58,7 +58,7 @@
|
|||
#include "lib/hash-value.h"
|
||||
#include "lib/util-foreach.hpp"
|
||||
#include "include/logging.h"
|
||||
#include "steam/streamtype.hpp"
|
||||
#include "steam/engine/buffhandle.hpp"
|
||||
#include "steam/engine/type-handler.hpp"
|
||||
#include "steam/engine/buffer-local-tag.hpp"
|
||||
#include "lib/nocopy.hpp"
|
||||
|
|
@ -76,8 +76,6 @@ namespace engine {
|
|||
namespace error = lumiera::error;
|
||||
|
||||
namespace metadata {
|
||||
using Buff = StreamType::ImplFacade::DataBuffer;
|
||||
|
||||
class Key;
|
||||
class Entry;
|
||||
}
|
||||
|
|
@ -636,7 +634,7 @@ namespace engine {
|
|||
* @note might create/register a new Entry as a side-effect
|
||||
*/
|
||||
Key const&
|
||||
key (Key const& parentKey, metadata::Buff* concreteBuffer, LocalTag const& specifics =LocalTag::UNKNOWN)
|
||||
key (Key const& parentKey, Buff* concreteBuffer, LocalTag const& specifics =LocalTag::UNKNOWN)
|
||||
{
|
||||
Key derivedKey = Key::forEntry (parentKey, concreteBuffer, specifics);
|
||||
Entry* existing = table_.fetch (derivedKey);
|
||||
|
|
@ -671,7 +669,7 @@ namespace engine {
|
|||
*/
|
||||
Entry&
|
||||
lock (Key const& parentKey
|
||||
,metadata::Buff* concreteBuffer
|
||||
,Buff* concreteBuffer
|
||||
,LocalTag const& specifics =LocalTag::UNKNOWN
|
||||
,bool onlyNew =false)
|
||||
{
|
||||
|
|
@ -751,7 +749,7 @@ namespace engine {
|
|||
* created, but is marked as FREE
|
||||
*/
|
||||
Entry&
|
||||
markLocked (Key const& parentKey, metadata::Buff* buffer, LocalTag const& specifics =LocalTag::UNKNOWN)
|
||||
markLocked (Key const& parentKey, Buff* buffer, LocalTag const& specifics =LocalTag::UNKNOWN)
|
||||
{
|
||||
if (!buffer)
|
||||
throw error::Fatal{"Attempt to lock for a NULL buffer. Allocation floundered?"
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@
|
|||
#include "lib/symbol.hpp"
|
||||
#include "lib/hash-value.h"
|
||||
#include "steam/engine/buffer-provider.hpp"
|
||||
//#include "steam/engine/engine-ctx.hpp"
|
||||
#include "lib/nocopy.hpp"
|
||||
|
||||
#include <utility>
|
||||
|
|
|
|||
|
|
@ -191,8 +191,6 @@ namespace engine {
|
|||
BuffDescr buildDescriptor (HashVal);
|
||||
bool was_created_by_this_provider (BuffDescr const&) const;
|
||||
|
||||
using Buff = StreamType::ImplFacade::DataBuffer; ///< marker type for an actual data buffer
|
||||
|
||||
|
||||
class BufferStage
|
||||
: util::NonCopyable
|
||||
|
|
|
|||
|
|
@ -51,7 +51,6 @@
|
|||
|
||||
#include "lib/error.hpp"
|
||||
#include "lib/hash-value.h"
|
||||
#include "steam/streamtype.hpp"
|
||||
|
||||
|
||||
namespace steam {
|
||||
|
|
@ -63,6 +62,13 @@ namespace engine {
|
|||
class BuffHandle;
|
||||
class BufferProvider;
|
||||
|
||||
/**
|
||||
* Placeholder type for the contents of a data buffer.
|
||||
* @remark The actual buffer will always be provided by a library implementation;
|
||||
* throughout the engine, this implementation type is represented as BuffDescr.
|
||||
* A `Buff*` represents the fact that there is a memory block managed by some library.
|
||||
*/
|
||||
struct Buff { };
|
||||
|
||||
|
||||
/**
|
||||
|
|
@ -110,8 +116,6 @@ namespace engine {
|
|||
*/
|
||||
class BuffHandle
|
||||
{
|
||||
using Buff = StreamType::ImplFacade::DataBuffer; ///< marker type for an actual data buffer
|
||||
|
||||
BuffDescr descriptor_;
|
||||
Buff* pBuffer_;
|
||||
|
||||
|
|
|
|||
|
|
@ -35,11 +35,8 @@
|
|||
|
||||
namespace steam {
|
||||
namespace engine {
|
||||
|
||||
namespace error = lumiera::error;
|
||||
|
||||
using Buff = StreamType::ImplFacade::DataBuffer; ///////////TODO consider to define that marker type at some suitable central location
|
||||
|
||||
class HeapMemBufferStore; //////////////////////////////OOO fällt dann weg nach dem Umbau
|
||||
class BufferDiagnostic;
|
||||
|
||||
|
|
|
|||
|
|
@ -35,10 +35,8 @@ using lib::ScopedPtrVect;
|
|||
|
||||
namespace steam {
|
||||
namespace engine {
|
||||
|
||||
namespace error = lumiera::error;
|
||||
|
||||
using Buff = StreamType::ImplFacade::DataBuffer;
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////////////////////////TICKET 1410 : need to question what implementation structures are needed, after »tracking« was extracted...
|
||||
|
|
|
|||
|
|
@ -99,6 +99,7 @@
|
|||
#include "lib/error.hpp"
|
||||
#include "lib/nocopy.hpp"
|
||||
#include "lib/hash-value.h"
|
||||
#include "include/limits.hpp"
|
||||
#include "steam/engine/buffhandle.hpp"
|
||||
#include "steam/engine/turnout-system.hpp"
|
||||
#include "lib/format-string.hpp"
|
||||
|
|
|
|||
|
|
@ -33,10 +33,8 @@
|
|||
|
||||
namespace steam {
|
||||
namespace engine {
|
||||
|
||||
namespace error = lumiera::error;
|
||||
|
||||
using metadata::Buff;
|
||||
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
#include "lib/symbol.hpp"
|
||||
//#include "vessel/query.hpp"
|
||||
#include "lib/idi/entry-id.hpp"
|
||||
#include "steam/engine/buffhandle.hpp"
|
||||
|
||||
|
||||
|
||||
|
|
@ -104,12 +105,11 @@ namespace steam {
|
|||
class TypeTag ;
|
||||
|
||||
/**
|
||||
* placeholder type for the contents of a data buffer.
|
||||
* The actual buffer will always be provided by a
|
||||
* library implementation; throughout the engine,
|
||||
* it's just hidden behind a DataBuffer pointer.
|
||||
* placeholder marker for the contents of a data buffer.
|
||||
* The actual buffer will always be provided by a library implementation;
|
||||
* Access is coordinated by a BufferProvider.
|
||||
*/
|
||||
struct DataBuffer { };
|
||||
using DataBuffer = steam::engine::Buff;
|
||||
|
||||
|
||||
virtual bool operator== (ImplFacade const& other) const =0;
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
#include "test/run.hpp"
|
||||
#include "test/test-frame.hpp"
|
||||
#include "test/test-helper.hpp"
|
||||
#include "steam/engine/buffhandle.hpp"
|
||||
#include "steam/engine/buffer-metadata.hpp"
|
||||
#include "lib/util.hpp"
|
||||
|
||||
|
|
@ -55,10 +56,10 @@ namespace test {
|
|||
}
|
||||
|
||||
template<typename X>
|
||||
metadata::Buff*
|
||||
Buff*
|
||||
mark_as_Buffer(X& something)
|
||||
{
|
||||
return reinterpret_cast<metadata::Buff*> (std::addressof(something));
|
||||
return reinterpret_cast<Buff*> (std::addressof(something));
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@
|
|||
#include "steam/asset/meta/time-grid.hpp"
|
||||
#include "lib/time/timequant.hpp"
|
||||
#include "lib/time/timecode.hpp"
|
||||
#include "lib/symbol.hpp"
|
||||
#include "lib/util.hpp"
|
||||
|
||||
#include <array>
|
||||
|
|
@ -34,6 +35,7 @@ using lib::time::Time;
|
|||
using lib::time::QuTime;
|
||||
using lib::time::FrameNr;
|
||||
using lib::time::FrameCnt;
|
||||
using lib::Symbol;
|
||||
using util::isnil;
|
||||
using util::isSameObject;
|
||||
using test::TestFrame;
|
||||
|
|
|
|||
Loading…
Reference in a new issue