3#include "../../_cexports/c_gev_server.h"
4#include "../_decl/decl_node_map.hpp"
5#include "../_decl/decl_server_base.hpp"
6#include "../_decl/decl_stream_base.hpp"
7#include "../../driver/flow_set_pool.hpp"
8#include "../../driver/gendc_descriptor.hpp"
9#include "../logical_network_interface.hpp"
18 return nodeMap_.AtomicGet([
this]() {
30 CExports::TDriver driverType = CExports::DT_Auto;
31 NativeCall([&]() {
return CVB_CALL_CAPI(GSDriverType(
Handle(), driverType)); });
43 [&]() {
return CExports::GSSetInfoAsStringTyped(
Handle(), CExports::GSI_ServerUserVersion, value.c_str()); });
48 CExports::gsipv4 ip = 0;
49 CExports::gsport port = 0;
50 NativeCall([&]() {
return CVB_CALL_CAPI(GSGetLocalIPv4(
Handle(), ip, port)); });
56 CExports::gsipv4 ip = 0;
57 CExports::gsport port = 0;
58 CVB_CALL_CAPI(GSGetRemoteIPv4(
Handle(), ip, port));
67 state_ = GevServer::State::Disconnected;
73 NativeCall([&]() {
return CVB_CALL_CAPI(GSStartIPv4(
Handle(), address)); });
74 state_ = GevServer::State::Disconnected;
80 NativeCall([&]() {
return CVB_CALL_CAPI(GSStop(
Handle())); });
81 state_ = GevServer::State::Configuration;
84 inline String ServerBase::GetInfoAsString(
Info command)
const
86 auto bufferSize = NativeCall<size_t>([&](
size_t &size) {
87 return CExports::GSGetInfoAsStringTyped(
Handle(),
static_cast<CExports::TGSInfo
>(command),
88 reinterpret_cast<Char *
>(0), size);
91 bufferSize +=
sizeof(
Char);
95 return CExports::GSGetInfoAsStringTyped(
Handle(),
static_cast<CExports::TGSInfo
>(command), buffer.data(),
107 inline void ServerBase::RegisterEvents()
109 std::size_t dummy{0};
111 return CVB_CALL_CAPI(
112 GSRegisterEvent(
Handle(), CExports::TServerEvent::SE_Connected, &ServerBase::OnConnected,
this, dummy));
115 return CVB_CALL_CAPI(
116 GSRegisterEvent(
Handle(), CExports::TServerEvent::SE_Disconnected, &OnDisconnected,
this, dummy));
119 return CVB_CALL_CAPI(
120 GSRegisterEvent(
Handle(), CExports::TServerEvent::SE_AcquisitionStart, &OnAcquisitionStart,
this, dummy));
123 return CVB_CALL_CAPI(
124 GSRegisterEvent(
Handle(), CExports::TServerEvent::SE_AcquisitionStop, &OnAcquisitionStop,
this, dummy));
virtual String UserVersion() const
Gets the user defined version that is appended to the device version.
Definition detail_server_base.hpp:35
virtual void Stop()
Stops this server.
Definition detail_server_base.hpp:77
virtual void SetUserVersion(const String &value)
Sets the user defined version that is appended to the device version.
Definition detail_server_base.hpp:40
virtual GevServer::DriverType DriverType()
Gets the GigE Vision driver used by this server object.
Definition detail_server_base.hpp:28
virtual Cvb::NetworkConnection LocalEndpoint() const
Gets the local end point this server is bound to.
Definition detail_server_base.hpp:46
virtual void * Handle() const noexcept=0
Returns the internal handle of this server object.
virtual void Start(const Cvb::NetworkConnection::IPAddress &address)
Starts this server and binds it to the given address .
Definition detail_server_base.hpp:62
virtual GevServer::State State()
Gets the the current state this server is in.
Definition detail_server_base.hpp:23
virtual NodeMapPtr NodeMap() const
Returns the GenApi node map of this server.
Definition detail_server_base.hpp:16
virtual Cvb::NetworkConnection RemoteEndpoint() const
Gets the remote end point this server is connected to.
Definition detail_server_base.hpp:54
Namespace for GevServer based device configuration.
Definition decl_int_swiss_knife_node.hpp:11
Info
General version and acquisition information.
Definition gevserver.hpp:231
@ ServerUserVersion
User version of the server.
Definition gevserver.hpp:235
State
These enum entries model the states the server can be in.
Definition decl_server_base.hpp:28
DriverType
GigE Vision driver to use for communication and streaming.
Definition gevserver.hpp:167
std::shared_ptr< NodeMap > NodeMapPtr
Convenience shared pointer for NodeMap.
Definition gevserver.hpp:56
@ String
Node is a string node (no reg).
Definition gevserver.hpp:218
Root namespace for the Image Manager interface.
Definition version.hpp:11
char Char
Character type for wide characters or unicode characters.
Definition string.hpp:63
T const_pointer_cast(T... args)
Basic network connection operations.
Definition network_connection.hpp:15
static IPAddressUInt ToIPAddressUInt(const IPAddress &ip)
Creates an uint ip . from the given IPAddress
Definition network_connection.hpp:68