CVB++ 15.0
Loading...
Searching...
No Matches
detail_stream_gev3.hpp
1#pragma once
2
3#include "../_decl/decl_stream_gev3.hpp"
4
5
7 std::function<void(size_t)> onSendComplete)
8{
9 auto parentServerGev3 = std::dynamic_pointer_cast<ServerGev3>(parent_);
10 if (!parentServerGev3)
11 throw std::runtime_error("parent server pointer is not valid or not a ServerGev3 ptr");
12
13 if (index >= parentServerGev3->GetRegisteredFlowSetPoolSize())
14 throw std::out_of_range("FlowSet index out of range");
15
16 if (actualSendSizes.size() != parentServerGev3->GetRegisteredFlowSetInfo().size())
17 throw std::length_error("Actual send sizes must match flow infos size");
18 auto pPrivate =
19 new std::function<void(void)>([onSendComplete, index]() mutable // NOLINT(cppcoreguidelines-owning-memory)
20 {
21 try
22 {
23 onSendComplete(index);
24 }
25 catch (...)
26 {
27
28 }
29 });
30 CExports::CVGSSendStatus status = CExports::CVGSSendStatus::GVGSSS_Timeout;
31 try
32 {
33 CVB_CALL_CAPI_CHECKED(CVGSServerSendFlowSet(parentServerGev3->Handle(), index, actualSendSizes.data(),
34 actualSendSizes.size(), &SendDispatcher, pPrivate, status));
35 }
36 catch (const std::exception &)
37 {
38 delete pPrivate;
39 throw;
40 }
41 return static_cast<SendStatus>(status);
42}
43
44
45
SendStatus SendFlowSet(size_t index, std::vector< size_t > actualSendSizes, std::function< void(size_t)> onSendComplete)
With this method a flow set at given index sent to the remote client. If the filled size is smaller t...
Definition detail_stream_gev3.hpp:6
SendStatus
Status after waiting for an image to be returned.
Definition gevserver.hpp:175
T dynamic_pointer_cast(T... args)