CVB++ 15.0
c_gev_server.h
1#pragma once
2
3#include "../namespace.hpp"
4
5#include "../string.hpp"
6#include "c_img.h"
7
8namespace Cvb
9{
10
11CVB_BEGIN_INLINE_NS
12
13namespace CExports
14{
15typedef void* GEVSRV;
16typedef void* GEVIFACELIST;
17typedef void* GSNODE;
18
19typedef cvbuint32_t gsipv4;
20typedef cvbuint16_t gsport;
21
22typedef void(__stdcall* TFGEVSrv)(void* pPrivate);
23typedef void(__stdcall* TFGEVSrvStatus)(cvbres_t& status, void* pPrivate);
24
25enum TGSServerInitType
26{
27 GSSI_FixedSize = 1,
28 GSSI_DynamicSize = 2
29};
30
31enum TDriver
32{
33 DT_Auto = -1,
34 DT_Socket = 0,
35 DT_Filter
36};
37
38enum TAcquisitionMode
39{
40 AM_None = -1,
41 AM_Automatic = 0,
42 AM_Manual
43};
44
45enum TServerEvent
46{
47 SE_Connected,
48 SE_Disconnected,
49 SE_AcquisitionStart,
50 SE_AcquisitionStop,
51 SE_ImageSnapped
52};
53
54enum TGSNamespace
55{
56 GSNS_Standard,
57 GSNS_Custom,
58 GSNS_Private
59};
60
61enum TGSNodeEvent
62{
63 GSNE_Read,
64 GSNE_Write
65};
66
67enum TGSNodeType
68{
69 GSNT_Invalid = -1,
70 GSNT_Unknown = 0,
71 GSNT_Category,
72 GSNT_IntReg,
73 GSNT_StringReg,
74 GSNT_Integer,
75 GSNT_Boolean,
76 GSNT_Command,
77 GSNT_Enumeration,
78 GSNT_EnumEntry,
79 GSNT_IntSwissKnife,
80 GSNT_String,
81 GSNT_Float,
82 GSNT_FloatReg
83};
84
85enum TGSInfo
86{
87 GSI_XMLVersionMajor = 0,
88 GSI_XMLVersionMinor,
89 GSI_XMLVersionSubMinor,
90 GSI_ServerUserVersion,
91 GSI_AcquisitionActive
92};
93
94enum TGSNodeInfo
95{
96 GSNI_Name = 0,
97 GSNI_DisplayName,
98 GSNI_AccessMode,
99 GSNI_Max,
100 GSNI_Min,
101 GSNI_Increment,
102 GSNI_NumEnumEntries,
103 GSNI_Streamable,
104 GSNI_CachingMode,
105 GSNI_Tooltip,
106 GSNI_Description,
107 GSNI_Visibility,
108 GSNI_PollingTime,
109 GSNI_EventID,
110 GSNI_Namespace,
111 GSNI_RegisterLength,
112 GSNI_RegisterAddress,
113 GSNI_NumberRepresentation,
114 GSNI_Value,
115 GSNI_OnValue,
116
117 GSNI_OffValue,
118 GSNI_Formula,
119 GSNI_ImposedAccessMode,
120 GSNI_IsImplemented,
121 GSNI_IsAvailable,
122 GSNI_IsLocked,
123 GSNI_Alias,
124 GSNI_Sign,
125 GSNI_Unit,
126 GSNI_DisplayPrecision,
127 GSNI_Last
128};
129
130enum TGSNumberRepresentation
131{
132 GSNR_None = -1,
133 GSNR_Linear = 0,
134 GSNR_Logarithmic,
135 GSNR_Boolean,
136 GSNR_PureNumber,
137 GSNR_HexNumber
138};
139
140enum TGSNumberSign
141{
142 GSNS_Unsigned = 0,
143 GSNS_Signed
144};
145
146enum TGSNodeList
147{
148 GSNL_Child,
149
150 GSNL_Selected,
151 GSNL_Invalidator,
152 GSNL_Addresses
153};
154
155enum TGSPayloadType
156{
157 GSPT_Image = 1,
158 GSPT_File = 2,
159
160 GSPT_ChunkImage = 0x4001
161};
162
163enum TGSPixelFormat
164{
165 GSPF_Mono8 = 0x01080001,
166 GSPF_Mono10 = 0x01100003,
167 GSPF_Mono12 = 0x01100005,
168 GSPF_Mono14 = 0x01100025,
169 GSPF_Mono16 = 0x01100007,
170 GSPF_RGB8 = 0x02180014,
171 GSPF_BGR8 = 0x02180015,
172 GSPF_RGBA8 = 0x02200016,
173 GSPF_BGRA8 = 0x02200017
174};
175
176enum NodeList
177{
178 Child, // Node accesses the child nodes:
179 // Category: Nodes in category
180 // Enumeration: EnumEntry nodes
181 // SwissKnifes: Variables (Ex version only)
182 Selected, // Node accesses the selected nodes
183 Invalidator, // Node accesses the invalidator nodes
184 Addresses // Node accesses the register address nodes (not constants)
185};
186
187// MAC Address
188#pragma pack(push, 1)
189struct ILMAC
190{
191 cvbuint8_t Address[6]; // NOLINT(cppcoreguidelines-avoid-c-arrays)
192};
193#pragma pack(pop)
194
195#pragma pack(push, 4)
196struct GSDataBlock
197{
198 cvbuint32_t PayloadType;
199};
200#pragma pack(pop)
201
202#pragma pack(push, 4)
203struct GSImageDataBlock
204{
205 GSDataBlock Header;
206 cvbuint32_t PixelFormat;
207 cvbuint32_t Width;
208 cvbuint32_t Height;
209 cvbuint32_t XOffset;
210 cvbuint32_t YOffset;
211 cvbuint32_t XPadding;
212 cvbuint32_t YPadding;
213 cvbuint32_t ActualHeight;
214};
215#pragma pack(pop)
216
217#pragma pack(push, 4)
218struct GSExtendedChunkDataBlock
219{
220 GSImageDataBlock ImageData;
221 cvbuint32_t ChunkPayloadSize;
222 cvbuint32_t ChunkLayoutID;
223};
224#pragma pack(pop)
225
226#pragma pack(push, 4)
227struct GSFileDataBlock
228{
229 GSDataBlock Header;
230 const char* Filename;
231};
232#pragma pack(pop)
233
234#pragma pack(push, 4)
235struct GSInitInfo
236{
237 cvbuint32_t InitType;
238};
239#pragma pack(pop)
240
241#pragma pack(push, 4)
242struct GSFixedSizeInitInfo
243{
244 TGSServerInitType initType;
245 cvbuint32_t PixelFormat;
246 const char* PixelFormatName;
247 cvbuint32_t Width;
248 cvbuint32_t Height;
249 intptr_t PayloadSize;
250};
251#pragma pack(pop)
252
253#pragma pack(push, 4)
254struct GSDynamicSizeInitInfo
255{
256 GSFixedSizeInitInfo Header;
257 cvbuint32_t MaxWidth;
258 cvbuint32_t MaxHeight;
259};
260#pragma pack(pop)
261
262CVB_DEF_CAPI(GEVIFACELIST, CreateInterfaceList, (void));
263CVB_DEF_CAPI_X(cvbbool_t, IsInterfaceList, (GEVIFACELIST List));
264CVB_DEF_CAPI(size_t, ILCount, (GEVIFACELIST List));
265CVB_DEF_CAPI(cvbres_t,
266 ILIPv4Address,
267 (GEVIFACELIST List, size_t Index, gsipv4& IPv4));
268CVB_DEF_CAPI(cvbres_t,
269 ILIPv4SubnetMask,
270 (GEVIFACELIST List, size_t Index, gsipv4& SubnetMask));
271CVB_DEF_CAPI(cvbres_t,
272 ILMACAddress,
273 (GEVIFACELIST List, size_t Index, ILMAC& MACAddress));
274
275CVB_DEF_CAPI(GEVSRV, CreateGevServer, (void));
276CVB_DEF_CAPI(GEVSRV, CreateGevServerEx, (TDriver DriverType));
277
278CVB_DEF_CAPI(cvbres_t, GSSetImage, (GEVSRV Server, IMG Image));
279CVB_DEF_CAPI(cvbres_t, GSGetImage, (GEVSRV Server, IMG& Image));
280CVB_DEF_CAPI(cvbres_t,
281 GSSetAcquisitionMode,
282 (GEVSRV Server, TAcquisitionMode Mode));
283CVB_DEF_CAPI(cvbres_t,
284 GSGetAcquisitionMode,
285 (GEVSRV Server, TAcquisitionMode& Mode));
286
287CVB_DEF_CAPI(GEVSRV,
288 CreateGevServer2,
289 (TDriver DriverType, const GSInitInfo& InitInfo));
290
291CVB_DEF_CAPI(cvbbool_t, GSDriverTypePresent, (TDriver DriverType));
292CVB_DEF_CAPI_X(cvbbool_t, IsGevServer, (GEVSRV Server));
293CVB_DEF_CAPI(cvbres_t, GSDriverType, (GEVSRV Server, TDriver& DriverType));
294CVB_DEF_CAPI(cvbres_t, GSStartIPv4, (GEVSRV Server, gsipv4 IPv4));
295CVB_DEF_CAPI(cvbres_t, GSStartIPv4Ex, (GEVSRV Server, gsipv4 IPv4, gsport Port));
296CVB_DEF_CAPI(cvbres_t,
297 GSStartIPv4List,
298 (GEVSRV Server, const gsipv4* IPv4List, size_t IPv4ListLength));
299CVB_DEF_CAPI(cvbres_t, GSStop, (GEVSRV Server));
300
301CVB_DEF_CAPI(cvbres_t,
302 GSGetLocalIPv4,
303 (GEVSRV Server, gsipv4& IPv4, gsport& Port));
304CVB_DEF_CAPI(cvbres_t,
305 GSGetRemoteIPv4,
306 (GEVSRV Server, gsipv4& IPv4, gsport& Port));
307CVB_DEF_CAPI(cvbres_t, GSSendCurrentImage, (GEVSRV Server));
308CVB_DEF_CAPI(cvbres_t, GSSendImage, (GEVSRV Server, IMG Image));
309CVB_DEF_CAPI(
310 cvbres_t,
311 GSSendImageCB,
312 (GEVSRV Server, IMG Image, TFGEVSrv ImageBlockRelease, void* pPrivate));
313CVB_DEF_CAPI(cvbres_t,
314 GSSendBlock,
315 (GEVSRV Server,
316 const GSDataBlock& BlockInfo,
317 const cvbuint8_t* pBlock,
318 size_t BlockSize,
319 TFGEVSrv BlockRelease,
320 void* pPrivate));
321
322CVB_DEF_CAPI(cvbres_t,
323 GSRegisterGenApiEvent,
324 (GEVSRV Server,
325 const char* EventName,
326 TGSNamespace Namespace,
327 cvbuint16_t& eventID));
328CVB_DEF_CAPI(cvbres_t,
329 GSRegisterGenApiEventW,
330 (GEVSRV Server,
331 const wchar_t* EventName,
332 TGSNamespace Namespace,
333 cvbuint16_t& eventID));
334CVB_DEF_CAPI(cvbres_t,
335 GSIsGenApiEventActive,
336 (GEVSRV, cvbuint16_t eventID, cvbbool_t& active));
337CVB_DEF_CAPI(cvbres_t, GSSendEvent, (GEVSRV Server, cvbuint16_t eventID));
338CVB_DEF_CAPI(
339 cvbres_t,
340 GSSendEventData,
341 (GEVSRV Server, cvbuint16_t eventID, const cvbuint8_t* pData, size_t DataSize));
342
343CVB_DEF_CAPI(cvbres_t,
344 GSRegisterEvent,
345 (GEVSRV Server,
346 TServerEvent EventID,
347 TFGEVSrv Callback,
348 void* pPrivate,
349 size_t& CallbackID));
350CVB_DEF_CAPI(cvbres_t,
351 GSUnregisterEvent,
352 (GEVSRV Server, TServerEvent EventID, size_t CallbackID));
353
354CVB_DEF_CAPI(cvbres_t,
355 GSGetPacketResendBuffers,
356 (GEVSRV Server, cvbval_t& NumResends));
357CVB_DEF_CAPI(cvbres_t,
358 GSSetPacketResendBuffers,
359 (GEVSRV Server, cvbval_t NumResends));
360
361CVB_DEF_CAPI(cvbres_t,
362 GSGetInfoAsInteger,
363 (GEVSRV Server, TGSInfo Cmd, cvbint64_t& Info));
364CVB_DEF_CAPI(cvbres_t,
365 GSSetInfoAsInteger,
366 (GEVSRV Server, TGSInfo Cmd, cvbint64_t Info));
367CVB_DEF_CAPI(cvbres_t,
368 GSGetInfoAsString,
369 (GEVSRV Server, TGSInfo Cmd, char* Info, size_t& Length));
370CVB_DEF_CAPI(cvbres_t,
371 GSGetInfoAsStringW,
372 (GEVSRV Server, TGSInfo Cmd, wchar_t* Info, size_t& Length));
373CVB_DEF_CAPI(cvbres_t,
374 GSSetInfoAsString,
375 (GEVSRV Server, TGSInfo Cmd, const char* Info));
376CVB_DEF_CAPI(cvbres_t,
377 GSSetInfoAsStringW,
378 (GEVSRV Server, TGSInfo Cmd, const wchar_t* Info));
379
380CVB_DEF_CAPI(cvbres_t,
381 GSGetNode,
382 (GEVSRV Server, const char* NodeName, GSNODE& Node));
383CVB_DEF_CAPI(cvbres_t,
384 GSGetNodeW,
385 (GEVSRV Server, const wchar_t* NodeName, GSNODE& Node));
386CVB_DEF_CAPI(cvbres_t, GSAddNode, (GEVSRV Server, GSNODE Node));
387CVB_DEF_CAPI(cvbres_t, GSRemoveNode, (GEVSRV Server, GSNODE Node));
388CVB_DEF_CAPI(cvbres_t, GSNodeCount, (GEVSRV Server, size_t& NodeCount));
389CVB_DEF_CAPI(cvbres_t,
390 GSNodeList,
391 (GEVSRV Server, size_t Index, char* EntryName, size_t& EntryLength));
392CVB_DEF_CAPI(cvbres_t,
393 GSNodeListW,
394 (GEVSRV Server, size_t Index, wchar_t* EntryName, size_t& EntryLength));
395
396CVB_DEF_CAPI(GSNODE,
397 CreateGSBooleanNode,
398 (const char* NodeName, TGSNamespace Namespace));
399CVB_DEF_CAPI(GSNODE,
400 CreateGSBooleanNodeW,
401 (const wchar_t* NodeName, TGSNamespace Namespace));
402CVB_DEF_CAPI(GSNODE,
403 CreateGSCategoryNode,
404 (const char* NodeName, TGSNamespace Namespace));
405CVB_DEF_CAPI(GSNODE, CreateGSCategoryNodeW, (const wchar_t *NodeName, TGSNamespace Namespace));
406CVB_DEF_CAPI(GSNODE,
407 CreateGSCommandNode,
408 (const char* NodeName, TGSNamespace Namespace));
409CVB_DEF_CAPI(GSNODE, CreateGSCommandNodeW, (const wchar_t *NodeName, TGSNamespace Namespace));
410CVB_DEF_CAPI(GSNODE,
411 CreateGSEnumerationNode,
412 (const char* NodeName, TGSNamespace Namespace));
413CVB_DEF_CAPI(GSNODE, CreateGSEnumerationNodeW, (const wchar_t *NodeName, TGSNamespace Namespace));
414CVB_DEF_CAPI(GSNODE,
415 CreateGSEnumEntryNode,
416 (const char* NodeName, TGSNamespace Namespace));
417CVB_DEF_CAPI(GSNODE, CreateGSEnumEntryNodeW, (const wchar_t *NodeName, TGSNamespace Namespace));
418CVB_DEF_CAPI(GSNODE,
419 CreateGSStringRegNode,
420 (const char* NodeName, TGSNamespace Namespace, cvbint64_t Address, cvbint64_t Length));
421CVB_DEF_CAPI(GSNODE,
422 CreateGSStringRegNodeW,
423 (const wchar_t* NodeName, TGSNamespace Namespace, cvbint64_t Address, cvbint64_t Length));
424CVB_DEF_CAPI(GSNODE, CreateGSStringNodeEx, (const char* NodeName, TGSNamespace Namespace));
425CVB_DEF_CAPI(GSNODE, CreateGSStringNodeWEx, (const wchar_t* NodeName, TGSNamespace Namespace));
426CVB_DEF_CAPI(GSNODE,
427 CreateGSIntegerNode,
428 (const char* NodeName, TGSNamespace Namespace));
429CVB_DEF_CAPI(GSNODE, CreateGSIntegerNodeW, (const wchar_t *NodeName, TGSNamespace Namespace));
430CVB_DEF_CAPI(GSNODE, CreateGSFloatNode, (const char* NodeName, TGSNamespace Namespace));
431CVB_DEF_CAPI(GSNODE, CreateGSFloatNodeW, (const wchar_t * NodeName, TGSNamespace Namespace));
432CVB_DEF_CAPI(GSNODE,
433 CreateGSIntSwissKnifeNode,
434 (const char* NodeName, TGSNamespace Namespace));
435CVB_DEF_CAPI(GSNODE, CreateGSIntSwissKnifeNodeW, (const wchar_t *NodeName, TGSNamespace Namespace));
436CVB_DEF_CAPI(GSNODE,
437 CreateGSInt32Node,
438 (const char* NodeName, TGSNamespace Namespace, cvbint64_t Address));
439CVB_DEF_CAPI(GSNODE, CreateGSInt32NodeW, (const wchar_t *NodeName, TGSNamespace Namespace, cvbint64_t Address));
440CVB_DEF_CAPI(GSNODE, CreateGSFloat32Node, (const char *NodeName, TGSNamespace Namespace, cvbint64_t Address));
441CVB_DEF_CAPI(GSNODE, CreateGSFloat32NodeW, (const wchar_t *NodeName, TGSNamespace Namespace, cvbint64_t Address));
442CVB_DEF_CAPI(GSNODE,
443 CreateGSInt64Node,
444 (const char* NodeName, TGSNamespace Namespace, cvbint64_t Address));
445CVB_DEF_CAPI(GSNODE, CreateGSInt64NodeW, (const wchar_t *NodeName, TGSNamespace Namespace, cvbint64_t Address));
446CVB_DEF_CAPI(GSNODE, CreateGSFloat64Node, (const char *NodeName, TGSNamespace Namespace, cvbint64_t Address));
447CVB_DEF_CAPI(GSNODE, CreateGSFloat64NodeW, (const wchar_t *NodeName, TGSNamespace Namespace, cvbint64_t Address));
448CVB_DEF_CAPI(GSNODE,
449 CreateGSIntRegNode,
450 (const char* NodeName,
451 TGSNamespace Namespace,
452 cvbint64_t Address,
453 cvbint64_t Length));
454CVB_DEF_CAPI(GSNODE,
455 CreateGSIntRegNodeW,
456 (const wchar_t *NodeName, TGSNamespace Namespace, cvbint64_t Address, cvbint64_t Length));
457CVB_DEF_CAPI(GSNODE,
458 CreateGSFloatRegNode,
459 (const char* NodeName,
460 TGSNamespace Namespace,
461 cvbint64_t Address,
462 cvbint64_t Length));
463CVB_DEF_CAPI(GSNODE,
464 CreateGSFloatRegNodeW,
465 (const wchar_t *NodeName, TGSNamespace Namespace, cvbint64_t Address, cvbint64_t Length));
466CVB_DEF_CAPI(cvbres_t, GSNType, (GSNODE Node, TGSNodeType& Type));
467CVB_DEF_CAPI_X(cvbbool_t, IsGSNode, (GSNODE Node));
468
469CVB_DEF_CAPI(cvbres_t,
470 GSNRegisterEvent,
471 (GSNODE Node,
472 TGSNodeEvent EventID,
473 TFGEVSrv Callback,
474 void* pPrivate,
475 size_t& CallbackID));
476CVB_DEF_CAPI(cvbres_t,
477 GSNRegisterEventWithStatus,
478 (GSNODE Node,
479 TGSNodeEvent EventID,
480 TFGEVSrvStatus Callback,
481 void* pPrivate,
482 size_t& CallbackID));
483CVB_DEF_CAPI(cvbres_t,
484 GSNUnregisterEvent,
485 (GSNODE Node, TGSNodeEvent EventID, size_t CallbackID));
486CVB_DEF_CAPI(cvbres_t,
487 GSNGetInfoAsInteger,
488 (GSNODE Node, TGSNodeInfo Cmd, cvbint64_t& Info));
489CVB_DEF_CAPI(cvbres_t,
490 GSNSetInfoAsInteger,
491 (GSNODE Node, TGSNodeInfo Cmd, cvbint64_t Info));
492CVB_DEF_CAPI(cvbres_t,
493 GSNGetInfoAsString,
494 (GSNODE Node, TGSNodeInfo Cmd, char* Info, size_t& Length));
495CVB_DEF_CAPI(cvbres_t, GSNGetInfoAsFloat, (GSNODE Node, TGSNodeInfo Cmd, double& Info));
496CVB_DEF_CAPI(cvbres_t, GSNSetInfoAsFloat, (GSNODE Node, TGSNodeInfo Cmd, double Info));
497CVB_DEF_CAPI(cvbres_t, GSNGetInfoAsStringW, (GSNODE Node, TGSNodeInfo Cmd, wchar_t *Info, size_t &Length));
498CVB_DEF_CAPI(cvbres_t,
499 GSNSetInfoAsString,
500 (GSNODE Node, TGSNodeInfo Cmd, const char* Info));
501CVB_DEF_CAPI(cvbres_t, GSNSetInfoAsStringW, (GSNODE Node, TGSNodeInfo Cmd, const wchar_t *Info));
502CVB_DEF_CAPI(cvbres_t,
503 GSNGetInfoAsNode,
504 (GSNODE Node, TGSNodeInfo Cmd, GSNODE& ValueNode));
505CVB_DEF_CAPI(cvbres_t,
506 GSNSetInfoAsNode,
507 (GSNODE Node, TGSNodeInfo Cmd, GSNODE ValueNode));
508
509CVB_DEF_CAPI(cvbres_t, GSNAddNode, (GSNODE Node, TGSNodeList Cmd, GSNODE ToAdd));
510CVB_DEF_CAPI(cvbres_t,
511 GSNAddNodeEx,
512 (GSNODE Node, TGSNodeList Cmd, const char* Key, GSNODE ToAdd));
513CVB_DEF_CAPI(cvbres_t, GSNAddNodeExW, (GSNODE Node, TGSNodeList Cmd, const wchar_t *Key, GSNODE ToAdd));
514CVB_DEF_CAPI(
515 cvbres_t,
516 GSNGetNode,
517 (GSNODE Node, TGSNodeList Cmd, const char* NodeName, GSNODE& ChildNode));
518CVB_DEF_CAPI(cvbres_t, GSNGetNodeW, (GSNODE Node, TGSNodeList Cmd, const wchar_t *NodeName, GSNODE &ChildNode));
519CVB_DEF_CAPI(cvbres_t,
520 GSNRemoveNode,
521 (GSNODE Node, TGSNodeList Cmd, GSNODE ToRemove));
522CVB_DEF_CAPI(cvbres_t,
523 GSNRemoveNodeEx,
524 (GSNODE Node, TGSNodeList Cmd, const char* Key));
525CVB_DEF_CAPI(cvbres_t, GSNRemoveNodeExW, (GSNODE Node, TGSNodeList Cmd, const wchar_t *Key));
526CVB_DEF_CAPI(cvbres_t,
527 GSNListCount,
528 (GSNODE Node, TGSNodeList Cmd, size_t& NodeCoGSNListunt));
529CVB_DEF_CAPI(cvbres_t,
530 GSNList,
531 (GSNODE Node,
532 TGSNodeList Cmd,
533 size_t Index,
534 char* EntryName,
535 size_t& EntryLength));
536CVB_DEF_CAPI(cvbres_t, GSNListW, (GSNODE Node, TGSNodeList Cmd, size_t Index, wchar_t *EntryName, size_t &EntryLength));
537CVB_DEF_CAPI(cvbres_t,
538 GSNListEx,
539 (GSNODE Node,
540 TGSNodeList Cmd,
541 size_t Index,
542 char* EntryName,
543 size_t& EntryLength,
544 char* KeyName,
545 size_t& KeyLength));
546CVB_DEF_CAPI(cvbres_t,
547 GSNListExW,
548 (GSNODE Node,
549 TGSNodeList Cmd,
550 size_t Index,
551 wchar_t *EntryName,
552 size_t &EntryLength,
553 wchar_t *KeyName,
554 size_t &KeyLength));
555
556CVB_DEF_CAPI(cvbres_t, GSNGetAsBoolean, (GSNODE Node, cvbbool_t& Value));
557CVB_DEF_CAPI(cvbres_t, GSNGetAsInteger, (GSNODE Node, cvbint64_t& Value));
558CVB_DEF_CAPI(cvbres_t, GSNGetAsFloat, (GSNODE Node, double& Value));
559CVB_DEF_CAPI(cvbres_t,
560 GSNGetAsString,
561 (GSNODE Node, char* Value, size_t& ValueSize));
562CVB_DEF_CAPI(cvbres_t, GSNGetAsStringW, (GSNODE Node, wchar_t *Value, size_t &ValueSize));
563CVB_DEF_CAPI(cvbres_t, GSNSetAsBoolean, (GSNODE Node, cvbbool_t Value));
564CVB_DEF_CAPI(cvbres_t, GSNSetAsInteger, (GSNODE Node, cvbint64_t Value));
565CVB_DEF_CAPI(cvbres_t, GSNSetAsFloat, (GSNODE Node, double Value));
566CVB_DEF_CAPI(cvbres_t, GSNSetAsString, (GSNODE Node, const char* Value));
567CVB_DEF_CAPI(cvbres_t, GSNSetAsStringW, (GSNODE Node, const wchar_t* Value));
568
569CVB_DEF_CAPI_X(cvbres_t, GSGetLastErrorString, (char* Error, size_t& Length));
570CVB_DEF_CAPI(cvbres_t,
571 GSIPv4ToString,
572 (gsipv4 IPv4, char* IPString, size_t& Length));
573CVB_DEF_CAPI(cvbres_t, GSStringToIPv4, (const char* IPString, gsipv4& IPv4));
574CVB_DEF_CAPI(cvbres_t,
575 GSMACToString,
576 (ILMAC MACAddress, char* MACString, size_t& Length));
577CVB_DEF_CAPI(cvbres_t, GSStringToMAC, (const char* MACString, ILMAC& MACAddress));
578
579
580
581
582inline cvbres_t
583GSRegisterGenApiEventTyped(GEVSRV Server, const char *EventName, TGSNamespace Namespace, cvbuint16_t &eventID)
584{
585 return CVB_CALL_CAPI(GSRegisterGenApiEvent(Server, EventName, Namespace, eventID));
586}
587
588inline cvbres_t
589GSRegisterGenApiEventTyped(GEVSRV Server, const wchar_t *EventName, TGSNamespace Namespace, cvbuint16_t &eventID)
590{
591 return CVB_CALL_CAPI(GSRegisterGenApiEventW(Server, EventName, Namespace, eventID));
592}
593
594inline cvbres_t GSGetInfoAsStringTyped(GEVSRV Server, TGSInfo Cmd, char* Info, size_t& Length)
595{
596 return CVB_CALL_CAPI(GSGetInfoAsString(Server, Cmd, Info, Length));
597}
598
599inline cvbres_t GSGetInfoAsStringTyped(GEVSRV Server, TGSInfo Cmd, wchar_t* Info, size_t& Length)
600{
601 return CVB_CALL_CAPI(GSGetInfoAsStringW(Server, Cmd, Info, Length));
602}
603
604inline cvbres_t GSSetInfoAsStringTyped(GEVSRV Server, TGSInfo Cmd, const char* Info)
605{
606 return CVB_CALL_CAPI(GSSetInfoAsString(Server, Cmd, Info));
607}
608
609inline cvbres_t GSSetInfoAsStringTyped(GEVSRV Server, TGSInfo Cmd, const wchar_t* Info)
610{
611 return CVB_CALL_CAPI(GSSetInfoAsStringW(Server, Cmd, Info));
612}
613
614inline cvbres_t GSGetNodeTyped(GEVSRV Server, const char* NodeName, GSNODE& Node)
615{
616 return CVB_CALL_CAPI(GSGetNode(Server, NodeName, Node));
617}
618
619inline cvbres_t GSGetNodeTyped(GEVSRV Server, const wchar_t* NodeName, GSNODE& Node)
620{
621 return CVB_CALL_CAPI(GSGetNodeW(Server, NodeName, Node));
622}
623
624inline cvbres_t GSNodeListTyped(GEVSRV Server, size_t Index, char* EntryName, size_t& EntryLength)
625{
626 return CVB_CALL_CAPI(GSNodeList(Server, Index, EntryName, EntryLength));
627}
628
629inline cvbres_t GSNodeListTyped(GEVSRV Server, size_t Index, wchar_t *EntryName, size_t &EntryLength)
630{
631 return CVB_CALL_CAPI(GSNodeListW(Server, Index, EntryName, EntryLength));
632}
633
634inline GSNODE CreateGSBooleanNodeTyped(const char* NodeName, TGSNamespace Namespace)
635{
636 return CVB_CALL_CAPI(CreateGSBooleanNode(NodeName, Namespace));
637}
638
639inline GSNODE CreateGSBooleanNodeTyped(const wchar_t *NodeName, TGSNamespace Namespace)
640{
641 return CVB_CALL_CAPI(CreateGSBooleanNodeW(NodeName, Namespace));
642}
643
644inline GSNODE CreateGSCategoryNodeTyped(const char* NodeName, TGSNamespace Namespace)
645{
646 return CVB_CALL_CAPI(CreateGSCategoryNode(NodeName, Namespace));
647}
648
649inline GSNODE CreateGSCategoryNodeTyped(const wchar_t *NodeName, TGSNamespace Namespace)
650{
651 return CVB_CALL_CAPI(CreateGSCategoryNodeW(NodeName, Namespace));
652}
653
654inline GSNODE CreateGSCommandNodeTyped(const char* NodeName, TGSNamespace Namespace)
655{
656 return CVB_CALL_CAPI(CreateGSCommandNode(NodeName, Namespace));
657}
658
659inline GSNODE CreateGSCommandNodeTyped(const wchar_t *NodeName, TGSNamespace Namespace)
660{
661 return CVB_CALL_CAPI(CreateGSCommandNodeW(NodeName, Namespace));
662}
663
664inline GSNODE CreateGSEnumerationNodeTyped(const char* NodeName, TGSNamespace Namespace)
665{
666 return CVB_CALL_CAPI(CreateGSEnumerationNode(NodeName, Namespace));
667}
668
669inline GSNODE CreateGSEnumerationNodeTyped(const wchar_t *NodeName, TGSNamespace Namespace)
670{
671 return CVB_CALL_CAPI(CreateGSEnumerationNodeW(NodeName, Namespace));
672}
673
674inline GSNODE CreateGSEnumEntryNodeTyped(const char* NodeName, TGSNamespace Namespace)
675{
676 return CVB_CALL_CAPI(CreateGSEnumEntryNode(NodeName, Namespace));
677}
678
679inline GSNODE CreateGSEnumEntryNodeTyped(const wchar_t *NodeName, TGSNamespace Namespace)
680{
681 return CVB_CALL_CAPI(CreateGSEnumEntryNodeW(NodeName, Namespace));
682}
683
684inline GSNODE CreateGSStringNodeExTyped(const char* NodeName, TGSNamespace Namespace)
685{
686 return CVB_CALL_CAPI(CreateGSStringNodeEx(NodeName, Namespace));
687}
688
689inline GSNODE CreateGSStringNodeExTyped(const wchar_t* NodeName, TGSNamespace Namespace)
690{
691 return CVB_CALL_CAPI(CreateGSStringNodeWEx(NodeName, Namespace));
692}
693
694inline GSNODE CreateGSStringRegNodeTyped(const char* NodeName, TGSNamespace Namespace, cvbint64_t Address, cvbint64_t Length)
695{
696 return CVB_CALL_CAPI(CreateGSStringRegNode(NodeName, Namespace, Address, Length));
697}
698
699inline GSNODE CreateGSStringRegNodeTyped(const wchar_t* NodeName, TGSNamespace Namespace, cvbint64_t Address, cvbint64_t Length)
700{
701 return CVB_CALL_CAPI(CreateGSStringRegNodeW(NodeName, Namespace, Address, Length));
702}
703
704inline GSNODE CreateGSIntegerNodeTyped(const char* NodeName, TGSNamespace Namespace)
705{
706 return CVB_CALL_CAPI(CreateGSIntegerNode(NodeName, Namespace));
707}
708
709inline GSNODE CreateGSIntegerNodeTyped(const wchar_t *NodeName, TGSNamespace Namespace)
710{
711 return CVB_CALL_CAPI(CreateGSIntegerNodeW(NodeName, Namespace));
712}
713
714inline GSNODE CreateGSFloatNodeTyped(const char* NodeName, TGSNamespace Namespace)
715{
716 return CVB_CALL_CAPI(CreateGSFloatNode(NodeName, Namespace));
717}
718
719inline GSNODE CreateGSFloatNodeTyped(const wchar_t *NodeName, TGSNamespace Namespace)
720{
721 return CVB_CALL_CAPI(CreateGSFloatNodeW(NodeName, Namespace));
722}
723
724inline GSNODE CreateGSIntSwissKnifeNodeTyped(const char* NodeName, TGSNamespace Namespace)
725{
726 return CVB_CALL_CAPI(CreateGSIntSwissKnifeNode(NodeName, Namespace));
727}
728
729inline GSNODE CreateGSIntSwissKnifeNodeTyped(const wchar_t *NodeName, TGSNamespace Namespace)
730{
731 return CVB_CALL_CAPI(CreateGSIntSwissKnifeNodeW(NodeName, Namespace));
732}
733
734inline GSNODE CreateGSInt32NodeTyped(const char* NodeName, TGSNamespace Namespace, cvbint64_t Address)
735{
736 return CVB_CALL_CAPI(CreateGSInt32Node(NodeName, Namespace, Address));
737}
738
739inline GSNODE CreateGSInt32NodeTyped(const wchar_t *NodeName, TGSNamespace Namespace, cvbint64_t Address)
740{
741 return CVB_CALL_CAPI(CreateGSInt32NodeW(NodeName, Namespace, Address));
742}
743
744inline GSNODE CreateGSInt64NodeTyped(const char* NodeName, TGSNamespace Namespace, cvbint64_t Address)
745{
746 return CVB_CALL_CAPI(CreateGSInt64Node(NodeName, Namespace, Address));
747}
748
749inline GSNODE CreateGSInt64NodeTyped(const wchar_t *NodeName, TGSNamespace Namespace, cvbint64_t Address)
750{
751 return CVB_CALL_CAPI(CreateGSInt64NodeW(NodeName, Namespace, Address));
752}
753
754inline GSNODE CreateGSFloat32NodeTyped(const char *NodeName, TGSNamespace Namespace, cvbint64_t Address)
755{
756 return CVB_CALL_CAPI(CreateGSFloat32Node(NodeName, Namespace, Address));
757}
758
759inline GSNODE CreateGSFloat32NodeTyped(const wchar_t *NodeName, TGSNamespace Namespace, cvbint64_t Address)
760{
761 return CVB_CALL_CAPI(CreateGSFloat32NodeW(NodeName, Namespace, Address));
762}
763
764inline GSNODE CreateGSFloat64NodeTyped(const char *NodeName, TGSNamespace Namespace, cvbint64_t Address)
765{
766 return CVB_CALL_CAPI(CreateGSFloat64Node(NodeName, Namespace, Address));
767}
768
769inline GSNODE CreateGSFloat64NodeTyped(const wchar_t *NodeName, TGSNamespace Namespace, cvbint64_t Address)
770{
771 return CVB_CALL_CAPI(CreateGSFloat64NodeW(NodeName, Namespace, Address));
772}
773
774inline GSNODE CreateGSIntRegNodeTyped(const char* NodeName, TGSNamespace Namespace, cvbint64_t Address, cvbint64_t Length)
775{
776 return CVB_CALL_CAPI(CreateGSIntRegNode(NodeName, Namespace, Address, Length));
777}
778
779inline GSNODE
780CreateGSIntRegNodeTyped(const wchar_t *NodeName, TGSNamespace Namespace, cvbint64_t Address, cvbint64_t Length)
781{
782 return CVB_CALL_CAPI(CreateGSIntRegNodeW(NodeName, Namespace, Address, Length));
783}
784
785inline GSNODE
786CreateGSFloatRegNodeTyped(const char *NodeName, TGSNamespace Namespace, cvbint64_t Address, cvbint64_t Length)
787{
788 return CVB_CALL_CAPI(CreateGSFloatRegNode(NodeName, Namespace, Address, Length));
789}
790
791inline GSNODE
792CreateGSFloatRegNodeTyped(const wchar_t *NodeName, TGSNamespace Namespace, cvbint64_t Address, cvbint64_t Length)
793{
794 return CVB_CALL_CAPI(CreateGSFloatRegNodeW(NodeName, Namespace, Address, Length));
795}
796
797inline cvbres_t GSNGetInfoAsStringTyped(GSNODE Node, TGSNodeInfo Cmd, char* Info, size_t& Length)
798{
799 return CVB_CALL_CAPI(GSNGetInfoAsString(Node, Cmd, Info, Length));
800}
801
802inline cvbres_t GSNGetInfoAsStringTyped(GSNODE Node, TGSNodeInfo Cmd, wchar_t *Info, size_t &Length)
803{
804 return CVB_CALL_CAPI(GSNGetInfoAsStringW(Node, Cmd, Info, Length));
805}
806
807inline cvbres_t GSNSetInfoAsStringTyped(GSNODE Node, TGSNodeInfo Cmd, const char* Info)
808{
809 return CVB_CALL_CAPI(GSNSetInfoAsString(Node, Cmd, Info));
810}
811
812inline cvbres_t GSNSetInfoAsStringTyped(GSNODE Node, TGSNodeInfo Cmd, const wchar_t *Info)
813{
814 return CVB_CALL_CAPI(GSNSetInfoAsStringW(Node, Cmd, Info));
815}
816
817inline cvbres_t GSNAddNodeExTyped(GSNODE Node, TGSNodeList Cmd, const char* Key, GSNODE ToAdd)
818{
819 return CVB_CALL_CAPI(GSNAddNodeEx(Node, Cmd, Key, ToAdd));
820}
821
822inline cvbres_t GSNAddNodeExTyped(GSNODE Node, TGSNodeList Cmd, const wchar_t *Key, GSNODE ToAdd)
823{
824 return CVB_CALL_CAPI(GSNAddNodeExW(Node, Cmd, Key, ToAdd));
825}
826
827inline cvbres_t GSNGetNodeTyped(GSNODE Node, TGSNodeList Cmd, const char* NodeName, GSNODE& ChildNode)
828{
829 return CVB_CALL_CAPI(GSNGetNode(Node, Cmd, NodeName, ChildNode));
830}
831
832inline cvbres_t GSNGetNodeTyped(GSNODE Node, TGSNodeList Cmd, const wchar_t *NodeName, GSNODE &ChildNode)
833{
834 return CVB_CALL_CAPI(GSNGetNodeW(Node, Cmd, NodeName, ChildNode));
835}
836
837inline cvbres_t GSNRemoveNodeExTyped(GSNODE Node, TGSNodeList Cmd, const char* Key)
838{
839 return CVB_CALL_CAPI(GSNRemoveNodeEx(Node, Cmd, Key));
840}
841
842inline cvbres_t GSNRemoveNodeExTyped(GSNODE Node, TGSNodeList Cmd, const wchar_t *Key)
843{
844 return CVB_CALL_CAPI(GSNRemoveNodeExW(Node, Cmd, Key));
845}
846
847inline cvbres_t GSNListTyped(GSNODE Node, TGSNodeList Cmd, size_t Index, char* EntryName, size_t& EntryLength)
848{
849 return CVB_CALL_CAPI(GSNList(Node, Cmd, Index, EntryName, EntryLength));
850}
851
852inline cvbres_t GSNListTyped(GSNODE Node, TGSNodeList Cmd, size_t Index, wchar_t *EntryName, size_t &EntryLength)
853{
854 return CVB_CALL_CAPI(GSNListW(Node, Cmd, Index, EntryName, EntryLength));
855}
856
857inline cvbres_t GSNListExTyped
858(GSNODE Node,
859 TGSNodeList Cmd,
860 size_t Index,
861 char* EntryName,
862 size_t& EntryLength,
863 char* KeyName,
864 size_t& KeyLength)
865{
866 return CVB_CALL_CAPI(GSNListEx(Node, Cmd, Index, EntryName, EntryLength, KeyName, KeyLength));
867}
868
869inline cvbres_t GSNListExTyped(GSNODE Node,
870 TGSNodeList Cmd,
871 size_t Index,
872 wchar_t *EntryName,
873 size_t &EntryLength,
874 wchar_t *KeyName,
875 size_t &KeyLength)
876{
877 return CVB_CALL_CAPI(GSNListExW(Node, Cmd, Index, EntryName, EntryLength, KeyName, KeyLength));
878}
879
880inline cvbres_t GSNSetAsStringTyped(GSNODE Node, const char* Value)
881{
882 return CVB_CALL_CAPI(GSNSetAsString(Node, Value));
883}
884
885inline cvbres_t GSNSetAsStringTyped(GSNODE Node, const wchar_t *Value)
886{
887 return CVB_CALL_CAPI(GSNSetAsStringW(Node, Value));
888}
889
890inline cvbres_t GSNGetAsStringTyped(GSNODE Node, char* Value, size_t& ValueSize)
891{
892 return CVB_CALL_CAPI(GSNGetAsString(Node, Value, ValueSize));
893}
894
895inline cvbres_t GSNGetAsStringTyped(GSNODE Node, wchar_t *Value, size_t &ValueSize)
896{
897 return CVB_CALL_CAPI(GSNGetAsStringW(Node, Value, ValueSize));
898}
899
900inline cvbres_t ListNodeNameOnNode(const GSNODE &node, const NodeList &cmd, const size_t &index, String &name)
901{
902 size_t size = 0;
903 cvbres_t result =
904 CExports::GSNListTyped(node, static_cast<TGSNodeList>(cmd), index, reinterpret_cast<Char *>(0), size);
905 if (result < 0 || static_cast<std::int32_t>(size) == 0)
906 {
907 name.clear();
908 return result;
909 }
910
911 size += sizeof(Char);
912 std::vector<Char> buffer(static_cast<std::int32_t>(size));
913 result = CExports::GSNListTyped(node, static_cast<TGSNodeList>(cmd), index, buffer.data(), size);
914
915 if (result >= 0)
916 name = String(buffer.data());
917 else
918 name.clear();
919
920 return result;
921}
922
923inline cvbres_t NodeListName(const GEVSRV &server, const size_t &index, String &name)
924{
925 size_t size = 0;
926 auto result = CExports::GSNodeListTyped(server, index, reinterpret_cast<Char *>(0), size);
927 if (result < 0 || static_cast<std::int32_t>(size) == 0)
928 {
929 name.clear();
930 return result;
931 }
932
933 std::vector<Char> buffer(size);
934 result = CExports::GSNodeListTyped(server, index, buffer.data(), size);
935 if (result >= 0)
936 name = String(buffer.data());
937 else
938 name.clear();
939
940 return result;
941}
942
943inline static cvbres_t ListNodeNameOnNode(const GSNODE &node,
944 const TGSNodeList &cmd,
945 const size_t &index,
946 String &entryName,
947 String &keyName)
948{
949 std::size_t nameSize = 0, keySize = 0;
950 auto result = CExports::
951 GSNListExTyped(node, cmd, index, reinterpret_cast<Char *>(0), nameSize, reinterpret_cast<Char *>(0), keySize);
952 if (result < 0 || static_cast<std::int32_t>(nameSize) == 0 || static_cast<std::int32_t>(keySize) == 0)
953 {
954 entryName.clear();
955 keyName.clear();
956 return result;
957 }
958
959 nameSize += sizeof(Char);
960 keySize += sizeof(Char);
961 std::vector<Char> nameBuffer(nameSize);
962 std::vector<Char> keyBuffer(keySize);
963 result = CExports::GSNListExTyped(node, cmd, index, nameBuffer.data(), nameSize, keyBuffer.data(), keySize);
964 if (result >= 0)
965 {
966 entryName = String(nameBuffer.data());
967 keyName = String(keyBuffer.data());
968 }
969 else
970 {
971 entryName.clear();
972 keyName.clear();
973 }
974 return result;
975}
976
977inline cvbres_t GSStartIPv4Typed(GEVSRV Server, gsipv4 IPv4, gsport Port)
978{
979 return GSStartIPv4Ex(Server, IPv4, Port);
980}
981
982inline cvbres_t GSStartIPv4Typed(GEVSRV Server, const gsipv4 *IPv4List, size_t IPv4ListLength)
983{
984 return GSStartIPv4List(Server, IPv4List, IPv4ListLength);
985}
986
987
988}
989CVB_END_INLINE_NS
990}
Root namespace for the Image Manager interface.
Definition c_bayer_to_rgb.h:17
char Char
Character type for wide characters or unicode characters.
Definition string.hpp:63
std::string String
String for wide characters or unicode characters.
Definition string.hpp:49