6#include "../global.hpp"
55 struct ProtectedTag {};
62 : flowInfos_{ flowInfos }
79 return std::make_shared<FlowSetPool>(flowInfos, ProtectedTag{});
89 if (flowBuffers.size() != flowInfos_.size())
94 std::transform(flowBuffers.begin(), flowBuffers.end(), flowInfos_.begin(), flows.begin(), [](
void* pBuffer,
FlowInfo info)
mutable
96 return Cvb::Flow { info.Size, pBuffer };
98 flowSets_.push_back(flows);
118 return flowSets_.size();
128 flowSets_.reserve(flowSets);
138 return flowSets_.cbegin();
148 return flowSets_.begin();
178 return flowSets_.cend();
188 return flowSets_.end();
218 return flowSets_.crbegin();
228 return flowSets_.rbegin();
258 return flowSets_.crend();
268 return flowSets_.rend();
294 releaseThis_ = [flowSetPool = flowSetPoolPtr]()
mutable
302 userCallback_ = userCallback;
308 std::transform(flowSets_.begin(), flowSets_.end(), flowSetPool.begin(), [
this](
std::vector<Cvb::Flow>& flows)
310 return CExports::CVDFlowSet{ 0, flowInfos_.size(), reinterpret_cast<CExports::CVDFlow*>(flows.data()) };
315 static CExports::cvbres_t __stdcall OnReleaseCallback(
void* pPrivate)
317 auto flowSetPool =
reinterpret_cast<FlowSetPool*
>(pPrivate);
320 flowSetPool->userCallback_();
324 flowSetPool->releaseThis_();
328 flowSetPool->releaseThis_();
335 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:256
auto REnd() const noexcept
Iterator access.
Definition: flow_set_pool.hpp:266
virtual void PushBack(const std::vector< void * > &flowBuffers)
Sets a flow to the flow set pool.
Definition: flow_set_pool.hpp:87
void push_back(const std::vector< void * > &flows)
Sets a flow to the flow set pool.
Definition: flow_set_pool.hpp:107
auto cend() const noexcept
Iterator access.
Definition: flow_set_pool.hpp:196
auto begin() noexcept
Iterator access.
Definition: flow_set_pool.hpp:166
auto CRBegin() const noexcept
Iterator access.
Definition: flow_set_pool.hpp:216
auto crend() const noexcept
Iterator access.
Definition: flow_set_pool.hpp:276
static FlowSetPoolPtr Create(const std::vector< FlowInfo > &flowInfos)
Creates a new flow set pool.
Definition: flow_set_pool.hpp:77
auto crbegin() const noexcept
Iterator access.
Definition: flow_set_pool.hpp:236
auto rend() noexcept
Iterator access.
Definition: flow_set_pool.hpp:286
size_t PoolSize() const noexcept
Gets the size of the flow set pool.
Definition: flow_set_pool.hpp:116
auto End() noexcept
Iterator access.
Definition: flow_set_pool.hpp:186
auto end() noexcept
Iterator access.
Definition: flow_set_pool.hpp:206
auto RBegin() noexcept
Iterator access.
Definition: flow_set_pool.hpp:226
auto CBegin() const noexcept
Iterator access.
Definition: flow_set_pool.hpp:136
auto rbegin() noexcept
Iterator access.
Definition: flow_set_pool.hpp:246
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:126
auto Begin() noexcept
Iterator access.
Definition: flow_set_pool.hpp:146
auto CEnd() const noexcept
Iterator access.
Definition: flow_set_pool.hpp:176
auto cbegin() const noexcept
Iterator access.
Definition: flow_set_pool.hpp:156
@ CVC_E_OK
No Error occurred.
Definition: CVCError.h:58
@ CVC_E_ERROR
Definition: CVCError.h:61
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