CVB++ 15.0
Loading...
Searching...
No Matches
decl_server.hpp
1#pragma once
2
3#include <atomic>
4#include <iostream>
5#include <mutex>
6#include <thread>
7
8#include "../../exception.hpp"
9#include "../../global.hpp"
10#include "../../size_2d.hpp"
11#include "../../utilities/system_info.hpp"
12#include "../logical_network_interface.hpp"
13
14#include "../../driver/driver.hpp"
15#include "../_decl/decl_server_base.hpp"
16
17#include "../_detail/detail_server_base.hpp"
18
19#include "../gevserver.hpp"
20#include "../../pfnc_format.hpp"
21
22namespace Cvb
23{
24 CVB_BEGIN_INLINE_NS
25
26 template <>
27 inline HandleGuard<GevServer::Server>::HandleGuard(void *handle) noexcept
28 : HandleGuard<GevServer::Server>(handle, [](void *handle) { CVB_CALL_CAPI(ReleaseObject(handle)); })
29 {
30 }
31 namespace GevServer
32 {
36 class Server : public ServerBase
37 {
38 public:
39 using GuardType = HandleGuard<Server>;
40
56
70 static ServerPtr CreateWithConstSize(Size2D<int> size, PfncFormat pixelFormat,
72
92 static ServerPtr CreateWithConstSize(Size2D<int> size, ColorModel colorModel, DataType dataType,
94
115 static ServerPtr CreateWithVariableSize(Size2D<int> maxSize, ColorModel colorModel, DataType dataType,
117
132 static ServerPtr CreateWithVariableSize(Size2D<int> maxSize, PfncFormat pixelFormat,
134
135 Server(HandleGuard<Server> &&guard, bool hasStream, ProtectedTag)
136 : handle_(std::move(guard))
137 , ServerBase(hasStream)
138 {
139 RegisterEvents();
140 }
141
142 void *Handle() const noexcept override
143 {
144 return handle_.Handle();
145 }
146
147 StreamPtr Stream() const;
148
149 private:
150 mutable Internal::AsyncRef<GevServer::Stream> gsStream_;
151 HandleGuard<Server> handle_;
152 };
153 } // namespace GevServer
154 CVB_END_INLINE_NS
155} // namespace Cvb
Data type description for an image plane.
Definition data_type.hpp:23
static ServerPtr CreateNonStreaming()
Creates a non-streaming GigE Vision server object.
Definition detail_server.hpp:17
static ServerPtr CreateWithVariableSize(Size2D< int > maxSize, ColorModel colorModel, DataType dataType, GevServer::DriverType driverType=GevServer::DriverType::Auto)
Creates a new Server object with a client configurable width, height and offsets.
Definition detail_server.hpp:57
void * Handle() const noexcept override
Returns the internal handle of this server object.
Definition decl_server.hpp:142
static ServerPtr CreateWithConstSize(Size2D< int > size, PfncFormat pixelFormat, GevServer::DriverType driverType=GevServer::DriverType::Auto)
Creates a new Server object with a constant width and height.
Definition detail_server.hpp:24
The stream to send Images or other data.
Definition decl_stream.hpp:20
Stores a pair of numbers that represents the width and the height of a subject, typically a rectangle...
Definition size_2d.hpp:20
cvbbool_t ReleaseObject(OBJ &Object)
T move(T... args)
Namespace for GevServer based device configuration.
Definition decl_int_swiss_knife_node.hpp:11
std::shared_ptr< Stream > StreamPtr
Convenience shared pointer for Stream.
Definition gevserver.hpp:64
DriverType
GigE Vision driver to use for communication and streaming.
Definition gevserver.hpp:167
@ Auto
Auto select driver type.
Definition gevserver.hpp:168
std::shared_ptr< Server > ServerPtr
Convenience shared pointer for GevServer.
Definition gevserver.hpp:43
PfncFormat
GenICam Pixel Format Naming Convention (PFNC) format values.
Definition pfnc_format.hpp:34
Root namespace for the Image Manager interface.
Definition version.hpp:11
ColorModel
Color model that this image is using.
Definition global.hpp:176