diff --git a/src/vault/out/output-buffer-proxy.hpp b/src/vault/out/output-buffer-proxy.hpp index aff638871..344ca4ded 100644 --- a/src/vault/out/output-buffer-proxy.hpp +++ b/src/vault/out/output-buffer-proxy.hpp @@ -66,15 +66,15 @@ namespace out { * - callback functors for the lifecycle stages related to the client's access * @todo 3/2026 this is prototyping code and was retained for demonstration purposes. */ - template + template class OutputBufferProxy - : util::NonCopyable + : public BufferProviderSetup { - class ProxyBufferStore + class OutputBufferStore : public BufferProviderSetup::Store - , private CONF { + HUB& output_; Buff* asBuffer (LocalTag targetMarker) @@ -86,8 +86,7 @@ namespace out { uint prepareBuffers (HashVal,uint,size_t) override { - WARN (engine, "Announce invoked on a Proxy Buffer Provider; " - "Implies misuse as generic BufferProvider"); + NOTREACHED ("This is not a general purpose BufferProvider"); return 1; } @@ -95,67 +94,57 @@ namespace out { provideBuffer (HashVal,size_t siz,LocalTag targetMarker) override { BuffAlloc storageSlot{asBuffer(targetMarker), siz, targetMarker}; - CONF::on_lock (storageSlot); + TODO ("delegate buffer lock"); return storageSlot; } void mark_emitted (HashVal, BuffAlloc storageSlot) override { - CONF::on_emit (storageSlot); + TODO ("delegate buffer emit"); } void detachBuffer (HashVal, BuffAlloc storageSlot) override { - CONF::on_release (storageSlot); + TODO ("delegate buffer release"); } public: - ProxyBufferStore (CONF policy) - : CONF{move(policy)} + OutputBufferStore(HUB& outputHub) + : output_{outputHub} { } }; struct Setup - : CONF - { - auto buildStage() { return std::make_unique("OutputBufferProxy"); } - auto buildStore() { return std::make_unique (move(*this)); } - }; // Note: possible since Setup does not use CONF - - class PassThroughBufferProvider - : public BufferProviderSetup { + HUB& outputHub_; - public: - PassThroughBufferProvider (Setup setup) - : BufferProviderSetup{setup} - { } - - BuffDescr - registerBuffer (void* buff, size_t siz) - { - REQUIRE (siz); - REQUIRE (buff); - auto& typeKey = bufferStage_->defineBufferType (siz, TypeHandler::RAW, LocalTag(buff)); - return buildDescriptor (typeKey); - } + auto buildStage() { return std::make_unique("OutputBufferProxy"); } + auto buildStore() { return std::make_unique (outputHub_); } }; - PassThroughBufferProvider proxyProvider_; - + BuffDescr + registerBuffer (void* buff, size_t siz) + { + REQUIRE (siz); + REQUIRE (buff); + auto& typeKey = bufferStage_->defineBufferType (siz, TypeHandler::RAW, LocalTag(buff)); + return buildDescriptor (typeKey); + } + public: - OutputBufferProxy(CONF policy) - : proxyProvider_{Setup{move(policy)}} + OutputBufferProxy(HUB& outputHub) + : BufferProviderSetup{Setup{outputHub}} { } + template BuffDescr getDescriptorFor (TAR& dataBlock) { - return proxyProvider_.registerBuffer(&dataBlock, sizeof(TAR)); + return registerBuffer(&dataBlock, sizeof(TAR)); } template diff --git a/src/vault/out/output-slot-connection.hpp b/src/vault/out/output-slot-connection.hpp index 8454602a5..66e75eee7 100644 --- a/src/vault/out/output-slot-connection.hpp +++ b/src/vault/out/output-slot-connection.hpp @@ -130,6 +130,9 @@ namespace out { Connections connections_; + OutputBufferProxy proxyBufferProvider_; + + /* == Allocation Interface == */ @@ -173,6 +176,7 @@ namespace out { template AllocState(uint numChannels, CTOR&& populator) : connections_(numChannels, std::forward(populator)) + , proxyBufferProvider_{*this} { } diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 8bb94cd39..2be086577 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -138099,7 +138099,8 @@ StM_bind(Builder<R1> b1, Extension<R1,R2> extension) - + + @@ -138172,7 +138173,37 @@ StM_bind(Builder<R1> b1, Extension<R1,R2> extension) - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +