6#include "../global.hpp"
58 return !(*
this == other);
66 friend class CompositeStreamBase;
84 : flowInfos_{flowInfos}
111 if (flowBuffers.size() != flowInfos_.size())
116 std::transform(flowBuffers.begin(), flowBuffers.end(), flowInfos_.begin(), flows.begin(),
117 [](
void *pBuffer,
FlowInfo info)
mutable { return Cvb::Flow{info.Size, pBuffer}; });
118 flowSets_.push_back(flows);
138 return flowSets_.size();
148 flowSets_.reserve(flowSets);
158 return flowSets_.cbegin();
168 return flowSets_.begin();
198 return flowSets_.cend();
208 return flowSets_.end();
238 return flowSets_.crbegin();
248 return flowSets_.rbegin();
278 return flowSets_.crend();
288 return flowSets_.rend();
314 releaseThis_ = [flowSetPool = flowSetPoolPtr]()
mutable { flowSetPool.reset(); };
319 userCallback_ = userCallback;
322 std::vector<CExports::CVDFlowSet> ToNativeStruct()
324 std::vector<CExports::CVDFlowSet> flowSetPool(flowSets_.size());
325 std::transform(flowSets_.begin(), flowSets_.end(), flowSetPool.begin(), [
this](std::vector<Cvb::Flow> &flows) {
326 return CExports::CVDFlowSet{0, flowInfos_.size(), reinterpret_cast<CExports::CVDFlow *>(flows.data())};
331 static CExports::cvbres_t __stdcall OnReleaseCallback(
void *pPrivate)
333 auto flowSetPool =
reinterpret_cast<FlowSetPool *
>(pPrivate);
336 flowSetPool->userCallback_();
340 flowSetPool->releaseThis_();
341 return CExports::CVC_E_ERROR;
344 flowSetPool->releaseThis_();
345 return CExports::CVC_E_OK;
351 using Driver::FlowInfo;
FlowSetPool class to set external buffers as set of flows.
Definition flow_set_pool.hpp:65
auto CREnd() const noexcept
Iterator access.
Definition flow_set_pool.hpp:276
auto REnd() const noexcept
Iterator access.
Definition flow_set_pool.hpp:286
virtual void PushBack(const std::vector< void * > &flowBuffers)
Sets a flow to the flow set pool.
Definition flow_set_pool.hpp:109
void push_back(const std::vector< void * > &flows)
Sets a flow to the flow set pool.
Definition flow_set_pool.hpp:127
auto cend() const noexcept
Iterator access.
Definition flow_set_pool.hpp:216
auto begin() noexcept
Iterator access.
Definition flow_set_pool.hpp:186
auto CRBegin() const noexcept
Iterator access.
Definition flow_set_pool.hpp:236
auto crend() const noexcept
Iterator access.
Definition flow_set_pool.hpp:296
static FlowSetPoolPtr Create(const std::vector< FlowInfo > &flowInfos)
Creates a new flow set pool.
Definition flow_set_pool.hpp:99
auto crbegin() const noexcept
Iterator access.
Definition flow_set_pool.hpp:256
auto rend() noexcept
Iterator access.
Definition flow_set_pool.hpp:306
size_t PoolSize() const noexcept
Gets the size of the flow set pool.
Definition flow_set_pool.hpp:136
auto End() noexcept
Iterator access.
Definition flow_set_pool.hpp:206
auto end() noexcept
Iterator access.
Definition flow_set_pool.hpp:226
auto RBegin() noexcept
Iterator access.
Definition flow_set_pool.hpp:246
auto CBegin() const noexcept
Iterator access.
Definition flow_set_pool.hpp:156
auto rbegin() noexcept
Iterator access.
Definition flow_set_pool.hpp:266
FlowSetPool(const std::vector< FlowInfo > &flowInfos, ProtectedTag) noexcept
Flow set pool constructor.
Definition flow_set_pool.hpp:83
void Reserve(int flowSets) noexcept
Reserve flow sets in the flow set pool.
Definition flow_set_pool.hpp:146
auto Begin() noexcept
Iterator access.
Definition flow_set_pool.hpp:166
auto CEnd() const noexcept
Iterator access.
Definition flow_set_pool.hpp:196
auto cbegin() const noexcept
Iterator access.
Definition flow_set_pool.hpp:176
Namespace for driver or device related operations.
Definition decl_composite.hpp:27
std::shared_ptr< FlowSetPool > FlowSetPoolPtr
Convenience shared pointer for FlowSetPool.
Definition driver.hpp:28
Root namespace for the Image Manager interface.
Definition c_bayer_to_rgb.h:17
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:56
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