6#include "../global.hpp"
55 struct ProtectedTag {};
62 : flowInfos_{ flowInfos }
75 return std::make_shared<FlowSetPool>(flowInfos, ProtectedTag{});
85 if (flowBuffers.size() != flowInfos_.size())
90 std::transform(flowBuffers.begin(), flowBuffers.end(), flowInfos_.begin(), flows.begin(), [](
void* pBuffer,
FlowInfo info)
mutable
92 return Cvb::Flow { info.Size, pBuffer };
94 flowSets_.push_back(flows);
114 return flowSets_.size();
124 flowSets_.reserve(flowSets);
134 return flowSets_.cbegin();
144 return flowSets_.begin();
174 return flowSets_.cend();
184 return flowSets_.end();
214 return flowSets_.crbegin();
224 return flowSets_.rbegin();
254 return flowSets_.crend();
264 return flowSets_.rend();
290 releaseThis_ = [flowSetPool = flowSetPoolPtr]()
mutable
298 userCallback_ = userCallback;
304 std::transform(flowSets_.begin(), flowSets_.end(), flowSetPool.begin(), [
this](
std::vector<Cvb::Flow>& flows)
306 return CExports::CVDFlowSet{ 0, flowInfos_.size(), reinterpret_cast<CExports::CVDFlow*>(flows.data()) };
311 static CExports::cvbres_t __stdcall OnReleaseCallback(
void* pPrivate)
313 auto flowSetPool =
reinterpret_cast<FlowSetPool*
>(pPrivate);
316 flowSetPool->userCallback_();
320 flowSetPool->releaseThis_();
321 return CExports::CVC_E_ERROR;
324 flowSetPool->releaseThis_();
325 return CExports::CVC_E_OK;
331 using Driver::FlowInfo;
Base class of all composite based streams.
Definition: decl_composite_stream_base.hpp:32
FlowSetPool class to set external buffers as set of flows.
Definition: flow_set_pool.hpp:44
auto CREnd() const noexcept
Iterator access.
Definition: flow_set_pool.hpp:252
auto REnd() const noexcept
Iterator access.
Definition: flow_set_pool.hpp:262
virtual void PushBack(const std::vector< void * > &flowBuffers)
Sets a flow to the flow set pool.
Definition: flow_set_pool.hpp:83
void push_back(const std::vector< void * > &flows)
Sets a flow to the flow set pool.
Definition: flow_set_pool.hpp:103
auto cend() const noexcept
Iterator access.
Definition: flow_set_pool.hpp:192
auto begin() noexcept
Iterator access.
Definition: flow_set_pool.hpp:162
auto CRBegin() const noexcept
Iterator access.
Definition: flow_set_pool.hpp:212
auto crend() const noexcept
Iterator access.
Definition: flow_set_pool.hpp:272
static FlowSetPoolPtr Create(const std::vector< FlowInfo > &flowInfos)
Creates a new flow set pool.
Definition: flow_set_pool.hpp:73
auto crbegin() const noexcept
Iterator access.
Definition: flow_set_pool.hpp:232
auto rend() noexcept
Iterator access.
Definition: flow_set_pool.hpp:282
size_t PoolSize() const noexcept
Gets the size of the flow set pool.
Definition: flow_set_pool.hpp:112
auto End() noexcept
Iterator access.
Definition: flow_set_pool.hpp:182
auto end() noexcept
Iterator access.
Definition: flow_set_pool.hpp:202
auto RBegin() noexcept
Iterator access.
Definition: flow_set_pool.hpp:222
auto CBegin() const noexcept
Iterator access.
Definition: flow_set_pool.hpp:132
auto rbegin() noexcept
Iterator access.
Definition: flow_set_pool.hpp:242
FlowSetPool(const std::vector< FlowInfo > &flowInfos, ProtectedTag) noexcept
Flow set pool constructor.
Definition: flow_set_pool.hpp:61
void Reserve(int flowSets) noexcept
Reserve flow sets in the flow set pool.
Definition: flow_set_pool.hpp:122
auto Begin() noexcept
Iterator access.
Definition: flow_set_pool.hpp:142
auto CEnd() const noexcept
Iterator access.
Definition: flow_set_pool.hpp:172
auto cbegin() const noexcept
Iterator access.
Definition: flow_set_pool.hpp:152
Root namespace for the Image Manager interface.
Definition: c_barcode.h:24
Struct handling the size, alignment and number of flows per set.
Definition: flow_set_pool.hpp:19
size_t Size
Flow size in bytes.
Definition: flow_set_pool.hpp:21
size_t Alignment
Flow alignment in bytes.
Definition: flow_set_pool.hpp:24
FlowInfo(size_t size, size_t alignment)
Construct a flow.
Definition: flow_set_pool.hpp:33