6#include "../global.hpp"
59 return !(*
this == other);
78 struct ProtectedTag {};
85 : flowInfos_{ flowInfos }
102 return std::make_shared<FlowSetPool>(flowInfos, ProtectedTag{});
112 if (flowBuffers.size() != flowInfos_.size())
117 std::transform(flowBuffers.begin(), flowBuffers.end(), flowInfos_.begin(), flows.begin(), [](
void* pBuffer,
FlowInfo info)
mutable
119 return Cvb::Flow { info.Size, pBuffer };
121 flowSets_.push_back(flows);
141 return flowSets_.size();
151 flowSets_.reserve(flowSets);
161 return flowSets_.cbegin();
171 return flowSets_.begin();
201 return flowSets_.cend();
211 return flowSets_.end();
241 return flowSets_.crbegin();
251 return flowSets_.rbegin();
281 return flowSets_.crend();
291 return flowSets_.rend();
317 releaseThis_ = [flowSetPool = flowSetPoolPtr]()
mutable
325 userCallback_ = userCallback;
331 std::transform(flowSets_.begin(), flowSets_.end(), flowSetPool.begin(), [
this](
std::vector<Cvb::Flow>& flows)
333 return CExports::CVDFlowSet{ 0, flowInfos_.size(), reinterpret_cast<CExports::CVDFlow*>(flows.data()) };
338 static CExports::cvbres_t __stdcall OnReleaseCallback(
void* pPrivate)
340 auto flowSetPool =
reinterpret_cast<FlowSetPool*
>(pPrivate);
343 flowSetPool->userCallback_();
347 flowSetPool->releaseThis_();
351 flowSetPool->releaseThis_();
358 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:67
auto CREnd() const noexcept
Iterator access.
Definition: flow_set_pool.hpp:279
auto REnd() const noexcept
Iterator access.
Definition: flow_set_pool.hpp:289
virtual void PushBack(const std::vector< void * > &flowBuffers)
Sets a flow to the flow set pool.
Definition: flow_set_pool.hpp:110
void push_back(const std::vector< void * > &flows)
Sets a flow to the flow set pool.
Definition: flow_set_pool.hpp:130
auto cend() const noexcept
Iterator access.
Definition: flow_set_pool.hpp:219
auto begin() noexcept
Iterator access.
Definition: flow_set_pool.hpp:189
auto CRBegin() const noexcept
Iterator access.
Definition: flow_set_pool.hpp:239
auto crend() const noexcept
Iterator access.
Definition: flow_set_pool.hpp:299
static FlowSetPoolPtr Create(const std::vector< FlowInfo > &flowInfos)
Creates a new flow set pool.
Definition: flow_set_pool.hpp:100
auto crbegin() const noexcept
Iterator access.
Definition: flow_set_pool.hpp:259
auto rend() noexcept
Iterator access.
Definition: flow_set_pool.hpp:309
size_t PoolSize() const noexcept
Gets the size of the flow set pool.
Definition: flow_set_pool.hpp:139
auto End() noexcept
Iterator access.
Definition: flow_set_pool.hpp:209
auto end() noexcept
Iterator access.
Definition: flow_set_pool.hpp:229
auto RBegin() noexcept
Iterator access.
Definition: flow_set_pool.hpp:249
auto CBegin() const noexcept
Iterator access.
Definition: flow_set_pool.hpp:159
auto rbegin() noexcept
Iterator access.
Definition: flow_set_pool.hpp:269
FlowSetPool(const std::vector< FlowInfo > &flowInfos, ProtectedTag) noexcept
Flow set pool constructor.
Definition: flow_set_pool.hpp:84
void Reserve(int flowSets) noexcept
Reserve flow sets in the flow set pool.
Definition: flow_set_pool.hpp:149
auto Begin() noexcept
Iterator access.
Definition: flow_set_pool.hpp:169
auto CEnd() const noexcept
Iterator access.
Definition: flow_set_pool.hpp:199
auto cbegin() const noexcept
Iterator access.
Definition: flow_set_pool.hpp:179
@ 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
bool operator!=(const FlowInfo &other) const noexcept
Compares to an other flow set info.
Definition: flow_set_pool.hpp:57
bool operator==(const FlowInfo &other) const noexcept
Compares to an other flow set info.
Definition: flow_set_pool.hpp:45
FlowInfo(size_t size, size_t alignment)
Construct a flow.
Definition: flow_set_pool.hpp:33