CVB++ 15.0
Loading...
Searching...
No Matches
decl_stream_base.hpp
1#pragma once
2
3#include "../../global.hpp"
4
5#include "../../image.hpp"
6
7#include "../chunk_image_buffer_description.hpp"
8#include "../gevserver.hpp"
9
10namespace Cvb
11{
12 CVB_BEGIN_INLINE_NS
13 namespace GevServer
14 {
16
19 {
20 protected:
25 explicit StreamBase(const ServerBasePtr &parent)
26 : parent_(parent)
27 {
28 if (!parent_)
29 throw std::runtime_error("Server for stream creation must not be null");
30 }
31
32 public:
33 virtual ~StreamBase() {}
34 StreamBase(const StreamBase &other) noexcept = delete;
35 StreamBase(StreamBase &&) noexcept = delete;
36 StreamBase &operator=(StreamBase &&) noexcept = delete;
37 StreamBase &operator=(const StreamBase &) noexcept = delete;
38
56 virtual bool IsRunning() const;
57
67 virtual std::int64_t ResendBuffersCount() const;
68
82 virtual void SetResendBuffersCount(const std::int64_t &numBuffers);
83
84 protected:
85 static void __stdcall SendDispatcher(void *pPrivate)
86 {
87 // Call thread context of Send function
88 if (auto pFunction = reinterpret_cast<std::function<void(void)> *>(pPrivate))
89 {
90 try
91 {
92 (*pFunction)();
93 }
94 catch (...)
95 {
96 }
97 delete pFunction;
98 }
99 }
100
101 ServerBasePtr parent_;
102 };
103 } // namespace GevServer
104 CVB_END_INLINE_NS
105} // namespace Cvb
Base class of all streams.
Definition stream_base.hpp:19
Base class for a stream.
Definition decl_stream_base.hpp:19
StreamBase(const ServerBasePtr &parent)
Creates the stream from the given parent server.
Definition decl_stream_base.hpp:25
virtual void SetResendBuffersCount(const std::int64_t &numBuffers)
Sets the number of resend buffers.
Definition detail_stream_base.hpp:29
virtual std::int64_t ResendBuffersCount() const
Gets the number of resend buffers.
Definition detail_stream_base.hpp:22
virtual bool IsRunning() const
Gets whether this stream is running.
Definition detail_stream_base.hpp:17
Namespace for GevServer based device configuration.
Definition decl_int_swiss_knife_node.hpp:11
std::shared_ptr< ServerBase > ServerBasePtr
Convenience shared pointer for GevServer.
Definition gevserver.hpp:39
Root namespace for the Image Manager interface.
Definition version.hpp:11