open62541pp 0.18.0
C++ wrapper of open62541
Loading...
Searching...
No Matches
types.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <initializer_list>
5#include <string_view>
6#include <type_traits>
7#include <utility> // forward, move
8#include <variant>
9
11#include "open62541pp/common.hpp" // AttributeId, ...
12#include "open62541pp/config.hpp"
14#include "open62541pp/detail/traits.hpp" // IsOneOf
15#include "open62541pp/detail/types_conversion.hpp" // toNative, toNativeArray
16#include "open62541pp/detail/types_handling.hpp" // deallocateArray, copyArray
17#include "open62541pp/span.hpp"
18#include "open62541pp/typeregistry.hpp" // getDataType
19#include "open62541pp/types.hpp"
21#include "open62541pp/ua/nodeids.hpp" // ReferenceTypeId
23
24#ifndef UA_DEFAULT_ATTRIBUTES_DEFINED
25#define UA_DEFAULT_ATTRIBUTES_DEFINED
26extern "C" {
34UA_EXPORT extern const UA_ViewAttributes UA_ViewAttributes_default;
35}
36#endif
37
38// NOLINTBEGIN(cppcoreguidelines-macro-usage)
39#define UAPP_GETTER(Type, getterName, member) \
40 Type member() const noexcept { \
41 return handle()->member; \
42 } \
43 /** @deprecated Use @ref member instead */ \
44 [[deprecated("use " #member " instead")]] \
45 Type getterName() const noexcept { \
46 return handle()->member; \
47 }
48
49#define UAPP_GETTER_CAST(Type, getterName, member) \
50 Type member() const noexcept { \
51 return static_cast<Type>(handle()->member); \
52 } \
53 /** @deprecated Use @ref member instead */ \
54 [[deprecated("use " #member " instead")]] \
55 Type getterName() const noexcept { \
56 return static_cast<Type>(handle()->member); \
57 }
58
59#define UAPP_GETTER_WRAPPER_CONST(Type, getterName, member) \
60 const Type& member() const noexcept { \
61 return asWrapper<Type>(handle()->member); \
62 } \
63 /** @deprecated Use @ref member instead */ \
64 [[deprecated("use " #member " instead")]] \
65 const Type& getterName() const noexcept { \
66 return asWrapper<Type>(handle()->member); \
67 }
68#define UAPP_GETTER_WRAPPER_NONCONST(Type, getterName, member) \
69 Type& member() noexcept { \
70 return asWrapper<Type>(handle()->member); \
71 } \
72 /** @deprecated Use @ref member instead */ \
73 [[deprecated("use " #member " instead")]] \
74 Type& getterName() noexcept { \
75 return asWrapper<Type>(handle()->member); \
76 }
77#define UAPP_GETTER_WRAPPER(Type, getterName, member) \
78 UAPP_GETTER_WRAPPER_CONST(Type, getterName, member) \
79 UAPP_GETTER_WRAPPER_NONCONST(Type, getterName, member)
80
81#define UAPP_GETTER_SPAN(Type, getterName, memberArray, memberSize) \
82 Span<const Type> memberArray() const noexcept { \
83 return {handle()->memberArray, handle()->memberSize}; \
84 } \
85 Span<Type> memberArray() noexcept { \
86 return {handle()->memberArray, handle()->memberSize}; \
87 } \
88 /** @deprecated Use @ref memberArray instead */ \
89 [[deprecated("use " #memberArray " instead")]] \
90 Span<const Type> getterName() const noexcept { \
91 return {handle()->memberArray, handle()->memberSize}; \
92 } \
93 /** @deprecated Use @ref memberArray instead */ \
94 [[deprecated("use " #memberArray " instead")]] \
95 Span<Type> getterName() noexcept { \
96 return {handle()->memberArray, handle()->memberSize}; \
97 }
98
99#define UAPP_GETTER_SPAN_WRAPPER(Type, getterName, memberArray, memberSize) \
100 Span<const Type> memberArray() const noexcept { \
101 return {asWrapper<Type>(handle()->memberArray), handle()->memberSize}; \
102 } \
103 Span<Type> memberArray() noexcept { \
104 return {asWrapper<Type>(handle()->memberArray), handle()->memberSize}; \
105 } \
106 /** @deprecated Use @ref memberArray instead */ \
107 [[deprecated("use " #memberArray " instead")]] \
108 Span<const Type> getterName() const noexcept { \
109 return {asWrapper<Type>(handle()->memberArray), handle()->memberSize}; \
110 } \
111 /** @deprecated Use @ref memberArray instead */ \
112 [[deprecated("use " #memberArray " instead")]] \
113 Span<Type> getterName() noexcept { \
114 return {asWrapper<Type>(handle()->memberArray), handle()->memberSize}; \
115 }
116
117// NOLINTEND(cppcoreguidelines-macro-usage)
118
119namespace opcua {
120inline namespace ua {
121
122/// IntegerId.
123/// @see https://reference.opcfoundation.org/Core/Part4/v105/docs/7.19
124using IntegerId = uint32_t;
125
126/**
127 * @addtogroup Wrapper
128 * @{
129 */
130
131/**
132 * UA_EnumValueType wrapper class.
133 * @see https://reference.opcfoundation.org/Core/Part3/v105/docs/8.39
134 */
135class EnumValueType : public TypeWrapper<UA_EnumValueType, UA_TYPES_ENUMVALUETYPE> {
136public:
138
140 handle()->value = value;
141 handle()->displayName = detail::toNative(std::move(displayName));
142 handle()->description = detail::toNative(std::move(description));
143 }
144
148};
149
150/**
151 * Application type.
152 * @see UA_ApplicationType
153 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/7.4
154 */
155enum class ApplicationType : int32_t {
156 Server = 0,
157 Client = 1,
158 ClientAndServer = 2,
159 DiscoveryServer = 3,
160};
161
162/**
163 * UA_ApplicationDescription wrapper class.
164 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/7.2
165 */
167 : public TypeWrapper<UA_ApplicationDescription, UA_TYPES_APPLICATIONDESCRIPTION> {
168public:
169 using TypeWrapper::TypeWrapper;
170
172 std::string_view applicationUri,
173 std::string_view productUri,
174 LocalizedText applicationName,
175 ApplicationType applicationType,
176 std::string_view gatewayServerUri,
177 std::string_view discoveryProfileUri,
178 Span<const String> discoveryUrls
179 ) {
180 handle()->applicationUri = detail::toNative(applicationUri);
181 handle()->productUri = detail::toNative(productUri);
182 handle()->applicationName = detail::toNative(std::move(applicationName));
183 handle()->applicationType = static_cast<UA_ApplicationType>(applicationType);
184 handle()->gatewayServerUri = detail::toNative(gatewayServerUri);
185 handle()->discoveryProfileUri = detail::toNative(discoveryProfileUri);
186 handle()->discoveryUrlsSize = discoveryUrls.size();
187 handle()->discoveryUrls = detail::toNativeArray(discoveryUrls);
188 }
189
190 UAPP_GETTER_WRAPPER(String, getApplicationUri, applicationUri)
191 UAPP_GETTER_WRAPPER(String, getProductUri, productUri)
192 UAPP_GETTER_WRAPPER(LocalizedText, getApplicationName, applicationName)
193 UAPP_GETTER_CAST(ApplicationType, getApplicationType, applicationType)
194 UAPP_GETTER_WRAPPER(String, getGatewayServerUri, gatewayServerUri)
195 UAPP_GETTER_WRAPPER(String, getDiscoveryProfileUri, discoveryProfileUri)
196 UAPP_GETTER_SPAN_WRAPPER(String, getDiscoveryUrls, discoveryUrls, discoveryUrlsSize)
197};
198
199/**
200 * UA_RequestHeader wrapper class.
201 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/7.33
202 */
203class RequestHeader : public TypeWrapper<UA_RequestHeader, UA_TYPES_REQUESTHEADER> {
204public:
205 using TypeWrapper::TypeWrapper;
206
208 NodeId authenticationToken,
209 DateTime timestamp,
210 IntegerId requestHandle,
211 uint32_t returnDiagnostics,
212 std::string_view auditEntryId,
213 uint32_t timeoutHint,
214 ExtensionObject additionalHeader
215 ) {
216 handle()->authenticationToken = detail::toNative(std::move(authenticationToken));
217 handle()->timestamp = timestamp;
218 handle()->requestHandle = requestHandle;
219 handle()->returnDiagnostics = returnDiagnostics;
220 handle()->auditEntryId = detail::toNative(auditEntryId);
221 handle()->timeoutHint = timeoutHint;
222 handle()->additionalHeader = detail::toNative(std::move(additionalHeader));
223 }
224
225 UAPP_GETTER_WRAPPER(NodeId, getAuthenticationToken, authenticationToken)
226 UAPP_GETTER_WRAPPER(DateTime, getTimestamp, timestamp)
227 UAPP_GETTER(IntegerId, getRequestHandle, requestHandle)
228 UAPP_GETTER(uint32_t, getReturnDiagnostics, returnDiagnostics)
229 UAPP_GETTER_WRAPPER(String, getAuditEntryId, auditEntryId)
230 UAPP_GETTER(uint32_t, getTimeoutHint, timeoutHint)
231 UAPP_GETTER_WRAPPER(ExtensionObject, getAdditionalHeader, additionalHeader)
232};
233
234/**
235 * UA_ResponseHeader wrapper class.
236 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/7.34
237 */
238class ResponseHeader : public TypeWrapper<UA_ResponseHeader, UA_TYPES_RESPONSEHEADER> {
239public:
240 using TypeWrapper::TypeWrapper;
241
242 UAPP_GETTER_WRAPPER(DateTime, getTimestamp, timestamp)
243 UAPP_GETTER(IntegerId, getRequestHandle, requestHandle)
244 UAPP_GETTER(StatusCode, getServiceResult, serviceResult)
245 UAPP_GETTER_WRAPPER(DiagnosticInfo, getServiceDiagnostics, serviceDiagnostics)
246 UAPP_GETTER_SPAN_WRAPPER(String, getStringTable, stringTable, stringTableSize)
247 UAPP_GETTER_WRAPPER(ExtensionObject, getAdditionalHeader, additionalHeader)
248};
249
250/**
251 * Message security mode.
252 * @see UA_MessageSecurityMode
253 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/7.20
254 */
255enum class MessageSecurityMode : int32_t {
256 // clang-format off
257 Invalid = 0, ///< Will always be rejected
258 None = 1, ///< No security applied
259 Sign = 2, ///< All messages are signed but not encrypted
260 SignAndEncrypt = 3, ///< All messages are signed and encrypted
261 // clang-format on
262};
263
264/**
265 * User identity token type.
266 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/7.43
267 */
268enum class UserTokenType : int32_t {
269 // clang-format off
270 Anonymous = 0, ///< No token is required
271 Username = 1, ///< A username/password token
272 Certificate = 2, ///< An X.509 v3 certificate token
273 IssuedToken = 3, ///< Any token issued by an authorization service
274 // clang-format on
275};
276
277/**
278 * UA_UserTokenPolicy wrapper class.
279 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/7.42
280 */
281class UserTokenPolicy : public TypeWrapper<UA_UserTokenPolicy, UA_TYPES_USERTOKENPOLICY> {
282public:
283 using TypeWrapper::TypeWrapper;
284
286 std::string_view policyId,
287 UserTokenType tokenType,
288 std::string_view issuedTokenType,
289 std::string_view issuerEndpointUrl,
290 std::string_view securityPolicyUri
291 ) {
292 handle()->policyId = detail::toNative(policyId);
293 handle()->tokenType = static_cast<UA_UserTokenType>(tokenType);
294 handle()->issuedTokenType = detail::toNative(issuedTokenType);
295 handle()->issuerEndpointUrl = detail::toNative(issuerEndpointUrl);
296 handle()->securityPolicyUri = detail::toNative(securityPolicyUri);
297 }
298
299 UAPP_GETTER_WRAPPER(String, getPolicyId, policyId)
300 UAPP_GETTER_CAST(UserTokenType, getTokenType, tokenType)
301 UAPP_GETTER_WRAPPER(String, getIssuedTokenType, issuedTokenType)
302 UAPP_GETTER_WRAPPER(String, getIssuerEndpointUrl, issuerEndpointUrl)
303 UAPP_GETTER_WRAPPER(String, getSecurityPolicyUri, securityPolicyUri)
304};
305
306/**
307 * UA_EndpointDescription wrapper class.
308 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/7.14
309 */
311 : public TypeWrapper<UA_EndpointDescription, UA_TYPES_ENDPOINTDESCRIPTION> {
312public:
313 using TypeWrapper::TypeWrapper;
314
315 UAPP_GETTER_WRAPPER(String, getEndpointUrl, endpointUrl)
317 UAPP_GETTER_WRAPPER(ByteString, getServerCertificate, serverCertificate)
318 UAPP_GETTER_CAST(MessageSecurityMode, getSecurityMode, securityMode)
319 UAPP_GETTER_WRAPPER(String, getSecurityPolicyUri, securityPolicyUri)
321 UserTokenPolicy, getUserIdentityTokens, userIdentityTokens, userIdentityTokensSize
323 UAPP_GETTER_WRAPPER(String, getTransportProfileUri, transportProfileUri)
324 UAPP_GETTER(UA_Byte, getSecurityLevel, securityLevel)
325};
326
327/* --------------------------------------- Node attributes -------------------------------------- */
328
329/**
330 * Node attributes mask.
331 * Bitmask used in the node attributes parameters to specify which attributes are set.
332 * @see UA_NodeAttributesMask
333 */
334enum class NodeAttributesMask : uint32_t {
335 // clang-format off
336 None = 0,
337 AccessLevel = 1,
338 ArrayDimensions = 2,
339 BrowseName = 4,
340 ContainsNoLoops = 8,
341 DataType = 16,
342 Description = 32,
343 DisplayName = 64,
344 EventNotifier = 128,
345 Executable = 256,
346 Historizing = 512,
347 InverseName = 1024,
348 IsAbstract = 2048,
350 NodeClass = 8192,
351 NodeId = 16384,
352 Symmetric = 32768,
353 UserAccessLevel = 65536,
354 UserExecutable = 131072,
355 UserWriteMask = 262144,
356 ValueRank = 524288,
357 WriteMask = 1048576,
358 Value = 2097152,
359 DataTypeDefinition = 4194304,
360 RolePermissions = 8388608,
361 AccessRestrictions = 16777216,
362 All = 33554431,
363 BaseNode = 26501220,
364 Object = 26501348,
365 ObjectType = 26503268,
366 Variable = 26571383,
367 VariableType = 28600438,
368 Method = 26632548,
369 ReferenceType = 26537060,
370 View = 26501356,
371 // clang-format on
372};
373
374constexpr std::true_type isBitmaskEnum(NodeAttributesMask);
375
376// Specifialized macros to generate getters/setters for `UA_*Attribute` classes.
377// The `specifiedAttributes` mask is automatically updated in the setter methods.
378// A fluent interface is used for the setter methods.
379
380// NOLINTBEGIN(cppcoreguidelines-macro-usage)
381#define UAPP_NODEATTR(Type, suffix, member, flag) \
382 UAPP_GETTER(Type, get##suffix, member) \
383 auto& set##suffix(Type member) noexcept { \
384 handle()->specifiedAttributes |= flag; \
385 handle()->member = member; \
386 return *this; \
387 }
388#define UAPP_NODEATTR_BITMASK(Type, suffix, member, flag) \
389 UAPP_GETTER(Type, get##suffix, member) \
390 auto& set##suffix(Type member) noexcept { \
391 handle()->specifiedAttributes |= flag; \
392 handle()->member = member.get(); \
393 return *this; \
394 }
395#define UAPP_NODEATTR_CAST(Type, suffix, member, flag) \
396 UAPP_GETTER_CAST(Type, get##suffix, member) \
397 auto& set##suffix(Type member) noexcept { \
398 handle()->specifiedAttributes |= flag; \
399 handle()->member = static_cast<decltype(handle()->member)>(member); \
400 return *this; \
401 }
402#define UAPP_NODEATTR_WRAPPER(Type, suffix, member, flag) \
403 UAPP_GETTER_WRAPPER_CONST(Type, get##suffix, member) \
404 auto& set##suffix(Type member) { \
405 handle()->specifiedAttributes |= flag; \
406 asWrapper<Type>(handle()->member) = std::move(member); \
407 return *this; \
408 }
409#define UAPP_NODEATTR_ARRAY(Type, suffix, member, memberSize, flag) \
410 UAPP_GETTER_SPAN(Type, get##suffix, member, memberSize) \
411 auto& set##suffix(Span<const Type> member) { \
412 const auto& dataType = opcua::getDataType<Type>(); \
413 handle()->specifiedAttributes |= flag; \
414 detail::deallocateArray(handle()->member, handle()->memberSize, dataType); \
415 handle()->member = detail::copyArray(member.data(), member.size(), dataType); \
416 handle()->memberSize = member.size(); \
417 return *this; \
418 }
419#define UAPP_NODEATTR_COMMON \
420 UAPP_GETTER(Bitmask<NodeAttributesMask>, getSpecifiedAttributes, specifiedAttributes) \
421 UAPP_NODEATTR_WRAPPER( \
422 LocalizedText, DisplayName, displayName, UA_NODEATTRIBUTESMASK_DISPLAYNAME \
423 ) \
424 UAPP_NODEATTR_WRAPPER( \
425 LocalizedText, Description, description, UA_NODEATTRIBUTESMASK_DESCRIPTION \
426 ) \
427 UAPP_NODEATTR_BITMASK( \
428 Bitmask<WriteMask>, WriteMask, writeMask, UA_NODEATTRIBUTESMASK_WRITEMASK \
429 ) \
430 UAPP_NODEATTR_BITMASK( \
431 Bitmask<WriteMask>, UserWriteMask, userWriteMask, UA_NODEATTRIBUTESMASK_USERWRITEMASK \
432 )
433
434// NOLINTEND(cppcoreguidelines-macro-usage)
435
436/**
437 * UA_NodeAttributes wrapper class.
438 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/7.24
439 */
440class NodeAttributes : public TypeWrapper<UA_NodeAttributes, UA_TYPES_NODEATTRIBUTES> {
441public:
442 using TypeWrapper::TypeWrapper;
443
445};
446
447/**
448 * UA_ObjectAttributes wrapper class.
449 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/7.24.2
450 */
451class ObjectAttributes : public TypeWrapper<UA_ObjectAttributes, UA_TYPES_OBJECTATTRIBUTES> {
452public:
453 using TypeWrapper::TypeWrapper;
454
455 /// Construct with default attribute definitions.
458
461 Bitmask<EventNotifier>, EventNotifier, eventNotifier, UA_NODEATTRIBUTESMASK_EVENTNOTIFIER
463};
464
465/**
466 * UA_VariableAttributes wrapper class.
467 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/7.24.3
468 */
469class VariableAttributes : public TypeWrapper<UA_VariableAttributes, UA_TYPES_VARIABLEATTRIBUTES> {
470public:
471 using TypeWrapper::TypeWrapper;
472
473 /// Construct with default attribute definitions.
476
478 UAPP_NODEATTR_WRAPPER(Variant, Value, value, UA_NODEATTRIBUTESMASK_VALUE)
479
480 /// @see Variant::Variant
481 template <typename... Args>
482 auto& setValueScalar(Args&&... args) {
483 return setValue(Variant(std::forward<Args>(args)...));
484 }
485
486 /// @see Variant::Variant
487 template <typename... Args>
488 auto& setValueArray(Args&&... args) {
489 return setValue(Variant(std::forward<Args>(args)...));
490 }
491
492 UAPP_NODEATTR_WRAPPER(NodeId, DataType, dataType, UA_NODEATTRIBUTESMASK_DATATYPE)
493
494 /// @overload
495 /// Deduce the `dataType` from the template type.
496 template <typename T>
497 auto& setDataType() {
498 return setDataType(asWrapper<NodeId>(opcua::getDataType<T>().typeId));
499 }
500
501 UAPP_NODEATTR_CAST(ValueRank, ValueRank, valueRank, UA_NODEATTRIBUTESMASK_VALUERANK)
503 uint32_t,
504 ArrayDimensions,
505 arrayDimensions,
506 arrayDimensionsSize,
507 UA_NODEATTRIBUTESMASK_ARRAYDIMENSIONS
510 Bitmask<AccessLevel>, AccessLevel, accessLevel, UA_NODEATTRIBUTESMASK_ACCESSLEVEL
514 UserAccessLevel,
515 userAccessLevel,
516 UA_NODEATTRIBUTESMASK_USERACCESSLEVEL
519 double,
520 MinimumSamplingInterval,
521 minimumSamplingInterval,
522 UA_NODEATTRIBUTESMASK_MINIMUMSAMPLINGINTERVAL
524 UAPP_NODEATTR(bool, Historizing, historizing, UA_NODEATTRIBUTESMASK_HISTORIZING)
525};
526
527/**
528 * UA_MethodAttributes wrapper class.
529 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/7.24.4
530 */
531class MethodAttributes : public TypeWrapper<UA_MethodAttributes, UA_TYPES_METHODATTRIBUTES> {
532public:
533 using TypeWrapper::TypeWrapper;
534
535 /// Construct with default attribute definitions.
538
540 UAPP_NODEATTR(bool, Executable, executable, UA_NODEATTRIBUTESMASK_EXECUTABLE)
541 UAPP_NODEATTR(bool, UserExecutable, userExecutable, UA_NODEATTRIBUTESMASK_USEREXECUTABLE)
542};
543
544/**
545 * UA_ObjectTypeAttributes wrapper class.
546 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/7.24.5
547 */
549 : public TypeWrapper<UA_ObjectTypeAttributes, UA_TYPES_OBJECTTYPEATTRIBUTES> {
550public:
551 using TypeWrapper::TypeWrapper;
552
553 /// Construct with default attribute definitions.
556
558 UAPP_NODEATTR(bool, IsAbstract, isAbstract, UA_NODEATTRIBUTESMASK_ISABSTRACT)
559};
560
561/**
562 * UA_VariableAttributes wrapper class.
563 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/7.24.6
564 */
566 : public TypeWrapper<UA_VariableTypeAttributes, UA_TYPES_VARIABLETYPEATTRIBUTES> {
567public:
568 using TypeWrapper::TypeWrapper;
569
570 /// Construct with default attribute definitions.
573
575 UAPP_NODEATTR_WRAPPER(Variant, Value, value, UA_NODEATTRIBUTESMASK_VALUE)
576
577 /// @see Variant::Variant
578 template <typename... Args>
579 auto& setValueScalar(Args&&... args) {
580 return setValue(Variant(std::forward<Args>(args)...));
581 }
582
583 /// @see Variant::Variant
584 template <typename... Args>
585 auto& setValueArray(Args&&... args) {
586 return setValue(Variant(std::forward<Args>(args)...));
587 }
588
589 UAPP_NODEATTR_WRAPPER(NodeId, DataType, dataType, UA_NODEATTRIBUTESMASK_DATATYPE)
590
591 /// @overload
592 /// Deduce the `dataType` from the template type.
593 template <typename T>
594 auto& setDataType() {
595 return setDataType(asWrapper<NodeId>(opcua::getDataType<T>().typeId));
596 }
597
598 UAPP_NODEATTR_CAST(ValueRank, ValueRank, valueRank, UA_NODEATTRIBUTESMASK_VALUERANK)
600 uint32_t,
601 ArrayDimensions,
602 arrayDimensions,
603 arrayDimensionsSize,
604 UA_NODEATTRIBUTESMASK_ARRAYDIMENSIONS
606 UAPP_NODEATTR(bool, IsAbstract, isAbstract, UA_NODEATTRIBUTESMASK_ISABSTRACT)
607};
608
609/**
610 * UA_ReferenceTypeAttributes wrapper class.
611 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/7.24.7
612 */
614 : public TypeWrapper<UA_ReferenceTypeAttributes, UA_TYPES_REFERENCETYPEATTRIBUTES> {
615public:
616 using TypeWrapper::TypeWrapper;
617
618 /// Construct with default attribute definitions.
621
623 UAPP_NODEATTR(bool, IsAbstract, isAbstract, UA_NODEATTRIBUTESMASK_ISABSTRACT)
624 UAPP_NODEATTR(bool, Symmetric, symmetric, UA_NODEATTRIBUTESMASK_SYMMETRIC)
626 LocalizedText, InverseName, inverseName, UA_NODEATTRIBUTESMASK_INVERSENAME
628};
629
630/**
631 * UA_DataTypeAttributes wrapper class.
632 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/7.24.8
633 */
634class DataTypeAttributes : public TypeWrapper<UA_DataTypeAttributes, UA_TYPES_DATATYPEATTRIBUTES> {
635public:
636 using TypeWrapper::TypeWrapper;
637
638 /// Construct with default attribute definitions.
641
643 UAPP_NODEATTR(bool, IsAbstract, isAbstract, UA_NODEATTRIBUTESMASK_ISABSTRACT)
644};
645
646/**
647 * UA_ViewAttributes wrapper class.
648 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/7.24.9
649 */
650class ViewAttributes : public TypeWrapper<UA_ViewAttributes, UA_TYPES_VIEWATTRIBUTES> {
651public:
652 using TypeWrapper::TypeWrapper;
653
654 /// Construct with default attribute definitions.
657
659 UAPP_NODEATTR(bool, IsAbstract, containsNoLoops, UA_NODEATTRIBUTESMASK_CONTAINSNOLOOPS)
661 Bitmask<EventNotifier>, EventNotifier, eventNotifier, UA_NODEATTRIBUTESMASK_EVENTNOTIFIER
663};
664
665#undef UAPP_NODEATTR
666#undef UAPP_NODEATTR_WRAPPER
667#undef UAPP_NODEATTR_ARRAY
668#undef UAPP_NODEATTR_COMMON
669
670/* ---------------------------------------------------------------------------------------------- */
671
672/**
673 * UA_UserIdentityToken wrapper class.
674 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/7.41
675 */
676class UserIdentityToken : public TypeWrapper<UA_UserIdentityToken, UA_TYPES_USERIDENTITYTOKEN> {
677public:
678 using TypeWrapper::TypeWrapper;
679
680 UAPP_GETTER_WRAPPER(String, getPolicyId, policyId)
681};
682
683/**
684 * UA_AnonymousIdentityToken wrapper class.
685 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/7.41.3
686 */
688 : public TypeWrapper<UA_AnonymousIdentityToken, UA_TYPES_ANONYMOUSIDENTITYTOKEN> {
689public:
690 using TypeWrapper::TypeWrapper;
691
692 UAPP_GETTER_WRAPPER(String, getPolicyId, policyId)
693};
694
695/**
696 * UA_UserNameIdentityToken wrapper class.
697 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/7.41.4
698 */
700 : public TypeWrapper<UA_UserNameIdentityToken, UA_TYPES_USERNAMEIDENTITYTOKEN> {
701public:
702 using TypeWrapper::TypeWrapper;
703
705 std::string_view userName,
706 std::string_view password,
707 std::string_view encryptionAlgorithm = {}
708 ) {
709 handle()->userName = detail::toNative(userName);
710 handle()->password = detail::toNative(password);
711 handle()->encryptionAlgorithm = detail::toNative(encryptionAlgorithm);
712 }
713
714 UAPP_GETTER_WRAPPER(String, getPolicyId, policyId)
715 UAPP_GETTER_WRAPPER(String, getUserName, userName)
716 UAPP_GETTER_WRAPPER(ByteString, getPassword, password)
717 UAPP_GETTER_WRAPPER(String, getEncryptionAlgorithm, encryptionAlgorithm)
718};
719
720/**
721 * UA_X509IdentityToken wrapper class.
722 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/7.41.5
723 */
724class X509IdentityToken : public TypeWrapper<UA_X509IdentityToken, UA_TYPES_X509IDENTITYTOKEN> {
725public:
726 using TypeWrapper::TypeWrapper;
727
728 explicit X509IdentityToken(ByteString certificateData) {
729 handle()->certificateData = detail::toNative(std::move(certificateData));
730 }
731
732 UAPP_GETTER_WRAPPER(String, getPolicyId, policyId)
733 UAPP_GETTER_WRAPPER(ByteString, getCertificateData, certificateData)
734};
735
736/**
737 * UA_IssuedIdentityToken wrapper class.
738 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/7.41.6
739 */
741 : public TypeWrapper<UA_IssuedIdentityToken, UA_TYPES_ISSUEDIDENTITYTOKEN> {
742public:
743 using TypeWrapper::TypeWrapper;
744
745 explicit IssuedIdentityToken(ByteString tokenData, std::string_view encryptionAlgorithm = {}) {
746 handle()->tokenData = detail::toNative(std::move(tokenData));
747 handle()->encryptionAlgorithm = detail::toNative(encryptionAlgorithm);
748 }
749
750 UAPP_GETTER_WRAPPER(String, getPolicyId, policyId)
751 UAPP_GETTER_WRAPPER(ByteString, getTokenData, tokenData)
752 UAPP_GETTER_WRAPPER(String, getEncryptionAlgorithm, encryptionAlgorithm)
753};
754
755/**
756 * UA_AddNodesItem wrapper class.
757 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/5.7.2
758 */
759class AddNodesItem : public TypeWrapper<UA_AddNodesItem, UA_TYPES_ADDNODESITEM> {
760public:
761 using TypeWrapper::TypeWrapper;
762
764 ExpandedNodeId parentNodeId,
765 NodeId referenceTypeId,
766 ExpandedNodeId requestedNewNodeId,
767 QualifiedName browseName,
768 NodeClass nodeClass,
769 ExtensionObject nodeAttributes,
770 ExpandedNodeId typeDefinition
771 ) {
772 handle()->parentNodeId = detail::toNative(std::move(parentNodeId));
773 handle()->referenceTypeId = detail::toNative(std::move(referenceTypeId));
774 handle()->requestedNewNodeId = detail::toNative(std::move(requestedNewNodeId));
775 handle()->browseName = detail::toNative(std::move(browseName));
776 handle()->nodeClass = static_cast<UA_NodeClass>(nodeClass);
777 handle()->nodeAttributes = detail::toNative(std::move(nodeAttributes));
778 handle()->typeDefinition = detail::toNative(std::move(typeDefinition));
779 }
780
781 UAPP_GETTER_WRAPPER(ExpandedNodeId, getParentNodeId, parentNodeId)
782 UAPP_GETTER_WRAPPER(NodeId, getReferenceTypeId, referenceTypeId)
783 UAPP_GETTER_WRAPPER(ExpandedNodeId, getRequestedNewNodeId, requestedNewNodeId)
784 UAPP_GETTER_WRAPPER(QualifiedName, getBrowseName, browseName)
785 UAPP_GETTER_CAST(NodeClass, getNodeClass, nodeClass)
786 UAPP_GETTER_WRAPPER(ExtensionObject, getNodeAttributes, nodeAttributes)
787 UAPP_GETTER_WRAPPER(ExpandedNodeId, getTypeDefinition, typeDefinition)
788};
789
790/**
791 * UA_AddNodesResult wrapper class.
792 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/5.7.2
793 */
794class AddNodesResult : public TypeWrapper<UA_AddNodesResult, UA_TYPES_ADDNODESRESULT> {
795public:
796 using TypeWrapper::TypeWrapper;
797
798 UAPP_GETTER(StatusCode, getStatusCode, statusCode)
799 UAPP_GETTER_WRAPPER(NodeId, getAddedNodeId, addedNodeId)
800};
801
802/**
803 * UA_AddNodesRequest wrapper class.
804 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/5.7.2
805 */
806class AddNodesRequest : public TypeWrapper<UA_AddNodesRequest, UA_TYPES_ADDNODESREQUEST> {
807public:
808 using TypeWrapper::TypeWrapper;
809
811 handle()->requestHeader = detail::toNative(std::move(requestHeader));
812 handle()->nodesToAddSize = nodesToAdd.size();
813 handle()->nodesToAdd = detail::toNativeArray(nodesToAdd);
814 }
815
816 UAPP_GETTER_WRAPPER(RequestHeader, getRequestHeader, requestHeader)
817 UAPP_GETTER_SPAN_WRAPPER(AddNodesItem, getNodesToAdd, nodesToAdd, nodesToAddSize)
818};
819
820/**
821 * UA_AddNodesResponse wrapper class.
822 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/5.7.2
823 */
824class AddNodesResponse : public TypeWrapper<UA_AddNodesResponse, UA_TYPES_ADDNODESRESPONSE> {
825public:
826 using TypeWrapper::TypeWrapper;
827
828 UAPP_GETTER_WRAPPER(ResponseHeader, getResponseHeader, responseHeader)
829 UAPP_GETTER_SPAN_WRAPPER(AddNodesResult, getResults, results, resultsSize)
831 DiagnosticInfo, getDiagnosticInfos, diagnosticInfos, diagnosticInfosSize
833};
834
835/**
836 * UA_AddReferencesItem wrapper class.
837 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/5.7.3
838 */
839class AddReferencesItem : public TypeWrapper<UA_AddReferencesItem, UA_TYPES_ADDREFERENCESITEM> {
840public:
841 using TypeWrapper::TypeWrapper;
842
844 NodeId sourceNodeId,
845 NodeId referenceTypeId,
846 bool isForward,
847 std::string_view targetServerUri,
848 ExpandedNodeId targetNodeId,
849 NodeClass targetNodeClass
850 ) {
851 handle()->sourceNodeId = detail::toNative(std::move(sourceNodeId));
852 handle()->referenceTypeId = detail::toNative(std::move(referenceTypeId));
853 handle()->isForward = isForward;
854 handle()->targetServerUri = detail::toNative(targetServerUri);
855 handle()->targetNodeId = detail::toNative(std::move(targetNodeId));
856 handle()->targetNodeClass = static_cast<UA_NodeClass>(targetNodeClass);
857 }
858
859 UAPP_GETTER_WRAPPER(NodeId, getSourceNodeId, sourceNodeId)
860 UAPP_GETTER_WRAPPER(NodeId, getReferenceTypeId, referenceTypeId)
861 UAPP_GETTER(bool, getIsForward, isForward)
862 UAPP_GETTER_WRAPPER(String, getTargetServerUri, targetServerUri)
863 UAPP_GETTER_WRAPPER(ExpandedNodeId, getTargetNodeId, targetNodeId)
864 UAPP_GETTER_CAST(NodeClass, getTargetNodeClass, targetNodeClass)
865};
866
867/**
868 * UA_AddReferencesRequest wrapper class.
869 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/5.7.3
870 */
872 : public TypeWrapper<UA_AddReferencesRequest, UA_TYPES_ADDREFERENCESREQUEST> {
873public:
874 using TypeWrapper::TypeWrapper;
875
877 RequestHeader requestHeader, Span<const AddReferencesItem> referencesToAdd
878 ) {
879 handle()->requestHeader = detail::toNative(std::move(requestHeader));
880 handle()->referencesToAddSize = referencesToAdd.size();
881 handle()->referencesToAdd = detail::toNativeArray(referencesToAdd);
882 }
883
884 UAPP_GETTER_WRAPPER(RequestHeader, getRequestHeader, requestHeader)
886 AddReferencesItem, getReferencesToAdd, referencesToAdd, referencesToAddSize
888};
889
890/**
891 * UA_AddReferencesResponse wrapper class.
892 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/5.7.3
893 */
895 : public TypeWrapper<UA_AddReferencesResponse, UA_TYPES_ADDREFERENCESRESPONSE> {
896public:
897 using TypeWrapper::TypeWrapper;
898
899 UAPP_GETTER_WRAPPER(ResponseHeader, getResponseHeader, responseHeader)
900 UAPP_GETTER_SPAN_WRAPPER(StatusCode, getResults, results, resultsSize)
902 DiagnosticInfo, getDiagnosticInfos, diagnosticInfos, diagnosticInfosSize
904};
905
906/**
907 * UA_DeleteNodesItem wrapper class.
908 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/5.7.4
909 */
910class DeleteNodesItem : public TypeWrapper<UA_DeleteNodesItem, UA_TYPES_DELETENODESITEM> {
911public:
912 using TypeWrapper::TypeWrapper;
913
914 DeleteNodesItem(NodeId nodeId, bool deleteTargetReferences) {
915 handle()->nodeId = detail::toNative(std::move(nodeId));
916 handle()->deleteTargetReferences = deleteTargetReferences;
917 }
918
919 UAPP_GETTER_WRAPPER(NodeId, getNodeId, nodeId)
920 UAPP_GETTER(bool, getDeleteTargetReferences, deleteTargetReferences)
921};
922
923/**
924 * UA_DeleteNodesRequest wrapper class.
925 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/5.7.4
926 */
927class DeleteNodesRequest : public TypeWrapper<UA_DeleteNodesRequest, UA_TYPES_DELETENODESREQUEST> {
928public:
929 using TypeWrapper::TypeWrapper;
930
932 handle()->requestHeader = detail::toNative(std::move(requestHeader));
933 handle()->nodesToDeleteSize = nodesToDelete.size();
934 handle()->nodesToDelete = detail::toNativeArray(nodesToDelete);
935 }
936
937 UAPP_GETTER_WRAPPER(RequestHeader, getRequestHeader, requestHeader)
938 UAPP_GETTER_SPAN_WRAPPER(DeleteNodesItem, getNodesToDelete, nodesToDelete, nodesToDeleteSize)
939};
940
941/**
942 * UA_DeleteNodesResponse wrapper class.
943 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/5.7.4
944 */
946 : public TypeWrapper<UA_DeleteNodesResponse, UA_TYPES_DELETENODESRESPONSE> {
947public:
948 using TypeWrapper::TypeWrapper;
949
950 UAPP_GETTER_WRAPPER(ResponseHeader, getResponseHeader, responseHeader)
951 UAPP_GETTER_SPAN_WRAPPER(StatusCode, getResults, results, resultsSize)
953 DiagnosticInfo, getDiagnosticInfos, diagnosticInfos, diagnosticInfosSize
955};
956
957/**
958 * UA_DeleteReferencesItem wrapper class.
959 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/5.7.5
960 */
962 : public TypeWrapper<UA_DeleteReferencesItem, UA_TYPES_DELETEREFERENCESITEM> {
963public:
964 using TypeWrapper::TypeWrapper;
965
967 NodeId sourceNodeId,
968 NodeId referenceTypeId,
969 bool isForward,
970 ExpandedNodeId targetNodeId,
971 bool deleteBidirectional
972 ) {
973 handle()->sourceNodeId = detail::toNative(std::move(sourceNodeId));
974 handle()->referenceTypeId = detail::toNative(std::move(referenceTypeId));
975 handle()->isForward = isForward;
976 handle()->targetNodeId = detail::toNative(std::move(targetNodeId));
977 handle()->deleteBidirectional = deleteBidirectional;
978 }
979
980 UAPP_GETTER_WRAPPER(NodeId, getSourceNodeId, sourceNodeId)
981 UAPP_GETTER_WRAPPER(NodeId, getReferenceTypeId, referenceTypeId)
982 UAPP_GETTER(bool, getIsForward, isForward)
983 UAPP_GETTER_WRAPPER(ExpandedNodeId, getTargetNodeId, targetNodeId)
984 UAPP_GETTER(bool, getDeleteBidirectional, deleteBidirectional)
985};
986
987/**
988 * UA_DeleteReferencesRequest wrapper class.
989 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/5.7.5
990 */
992 : public TypeWrapper<UA_DeleteReferencesRequest, UA_TYPES_DELETEREFERENCESREQUEST> {
993public:
994 using TypeWrapper::TypeWrapper;
995
997 RequestHeader requestHeader, Span<const DeleteReferencesItem> referencesToDelete
998 ) {
999 handle()->requestHeader = detail::toNative(std::move(requestHeader));
1000 handle()->referencesToDeleteSize = referencesToDelete.size();
1001 handle()->referencesToDelete = detail::toNativeArray(referencesToDelete);
1002 }
1003
1004 UAPP_GETTER_WRAPPER(RequestHeader, getRequestHeader, requestHeader)
1006 DeleteReferencesItem, getReferencesToDelete, referencesToDelete, referencesToDeleteSize
1008};
1009
1010/**
1011 * UA_DeleteReferencesResponse wrapper class.
1012 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/5.7.5
1013 */
1015 : public TypeWrapper<UA_DeleteReferencesResponse, UA_TYPES_DELETEREFERENCESRESPONSE> {
1016public:
1017 using TypeWrapper::TypeWrapper;
1018
1019 UAPP_GETTER_WRAPPER(ResponseHeader, getResponseHeader, responseHeader)
1020 UAPP_GETTER_SPAN_WRAPPER(StatusCode, getResults, results, resultsSize)
1022 DiagnosticInfo, getDiagnosticInfos, diagnosticInfos, diagnosticInfosSize
1024};
1025
1026/**
1027 * UA_ViewDescription wrapper class.
1028 */
1029class ViewDescription : public TypeWrapper<UA_ViewDescription, UA_TYPES_VIEWDESCRIPTION> {
1030public:
1031 using TypeWrapper::TypeWrapper;
1032
1033 ViewDescription(NodeId viewId, DateTime timestamp, uint32_t viewVersion) {
1034 handle()->viewId = detail::toNative(std::move(viewId));
1035 handle()->timestamp = timestamp;
1036 handle()->viewVersion = viewVersion;
1037 }
1038
1039 UAPP_GETTER_WRAPPER(NodeId, getViewId, viewId)
1040 UAPP_GETTER_WRAPPER(DateTime, getTimestamp, timestamp)
1041 UAPP_GETTER(uint32_t, getViewVersion, viewVersion)
1042};
1043
1044/**
1045 * Browse direction.
1046 * An enumeration that specifies the direction of references to follow.
1047 * @see UA_BrowseDirection
1048 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/7.5
1049 */
1050enum class BrowseDirection : int32_t {
1051 // clang-format off
1052 Forward = 0,
1053 Inverse = 1,
1054 Both = 2,
1055 Invalid = 3,
1056 // clang-format on
1057};
1058
1059/**
1060 * Browse result mask.
1061 *
1062 * The enum can be used as a bitmask and allows bitwise operations, e.g.:
1063 * @code
1064 * auto mask = BrowseResultMask::ReferenceTypeId | BrowseResultMask::IsForward;
1065 * @endcode
1066 *
1067 * @see UA_BrowseResultMask
1068 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/5.8.2
1069 */
1084
1085constexpr std::true_type isBitmaskEnum(BrowseResultMask);
1086
1087/**
1088 * UA_BrowseDescription wrapper class.
1089 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/5.8.2
1090 */
1091class BrowseDescription : public TypeWrapper<UA_BrowseDescription, UA_TYPES_BROWSEDESCRIPTION> {
1092public:
1093 using TypeWrapper::TypeWrapper;
1094
1096 NodeId nodeId,
1097 BrowseDirection browseDirection,
1098 NodeId referenceTypeId = ReferenceTypeId::References,
1099 bool includeSubtypes = true,
1100 Bitmask<NodeClass> nodeClassMask = NodeClass::Unspecified,
1101 Bitmask<BrowseResultMask> resultMask = BrowseResultMask::All
1102 ) {
1103 handle()->nodeId = detail::toNative(std::move(nodeId));
1104 handle()->browseDirection = static_cast<UA_BrowseDirection>(browseDirection);
1105 handle()->referenceTypeId = detail::toNative(std::move(referenceTypeId));
1106 handle()->includeSubtypes = includeSubtypes;
1107 handle()->nodeClassMask = nodeClassMask.get();
1108 handle()->resultMask = resultMask.get();
1109 }
1110
1111 UAPP_GETTER_WRAPPER(NodeId, getNodeId, nodeId)
1112 UAPP_GETTER_CAST(BrowseDirection, getBrowseDirection, browseDirection)
1113 UAPP_GETTER_WRAPPER(NodeId, getReferenceTypeId, referenceTypeId)
1114 UAPP_GETTER(bool, getIncludeSubtypes, includeSubtypes)
1115 UAPP_GETTER(Bitmask<NodeClass>, getNodeClassMask, nodeClassMask)
1116 UAPP_GETTER(Bitmask<BrowseResultMask>, getResultMask, resultMask)
1117};
1118
1119/**
1120 * UA_BrowseRequest wrapper class.
1121 */
1122class BrowseRequest : public TypeWrapper<UA_BrowseRequest, UA_TYPES_BROWSEREQUEST> {
1123public:
1124 using TypeWrapper::TypeWrapper;
1125
1127 RequestHeader requestHeader,
1128 ViewDescription view,
1129 uint32_t requestedMaxReferencesPerNode,
1130 Span<const BrowseDescription> nodesToBrowse
1131 ) {
1132 handle()->requestHeader = detail::toNative(std::move(requestHeader));
1133 handle()->view = detail::toNative(std::move(view));
1134 handle()->requestedMaxReferencesPerNode = requestedMaxReferencesPerNode;
1135 handle()->nodesToBrowseSize = nodesToBrowse.size();
1136 handle()->nodesToBrowse = detail::toNativeArray(nodesToBrowse);
1137 }
1138
1139 UAPP_GETTER_WRAPPER(RequestHeader, getRequestHeader, requestHeader)
1141 UAPP_GETTER(uint32_t, getRequestedMaxReferencesPerNode, requestedMaxReferencesPerNode)
1142 UAPP_GETTER_SPAN_WRAPPER(BrowseDescription, getNodesToBrowse, nodesToBrowse, nodesToBrowseSize)
1143};
1144
1145/**
1146 * UA_ReferenceDescription wrapper class.
1147 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/7.30
1148 */
1150 : public TypeWrapper<UA_ReferenceDescription, UA_TYPES_REFERENCEDESCRIPTION> {
1151public:
1152 using TypeWrapper::TypeWrapper;
1153
1154 UAPP_GETTER_WRAPPER(NodeId, getReferenceTypeId, referenceTypeId)
1155 UAPP_GETTER(bool, getIsForward, isForward)
1157 UAPP_GETTER_WRAPPER(QualifiedName, getBrowseName, browseName)
1158 UAPP_GETTER_WRAPPER(LocalizedText, getDisplayName, displayName)
1159 UAPP_GETTER_CAST(NodeClass, getNodeClass, nodeClass)
1160 UAPP_GETTER_WRAPPER(ExpandedNodeId, getTypeDefinition, typeDefinition)
1161};
1162
1163/**
1164 * UA_BrowseResult wrapper class.
1165 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/7.6
1166 */
1167class BrowseResult : public TypeWrapper<UA_BrowseResult, UA_TYPES_BROWSERESULT> {
1168public:
1169 using TypeWrapper::TypeWrapper;
1170
1171 UAPP_GETTER(StatusCode, getStatusCode, statusCode)
1172 UAPP_GETTER_WRAPPER(ByteString, getContinuationPoint, continuationPoint)
1173 UAPP_GETTER_SPAN_WRAPPER(ReferenceDescription, getReferences, references, referencesSize)
1174};
1175
1176/**
1177 * UA_BrowseResponse wrapper class.
1178 */
1179class BrowseResponse : public TypeWrapper<UA_BrowseResponse, UA_TYPES_BROWSERESPONSE> {
1180public:
1181 using TypeWrapper::TypeWrapper;
1182
1183 UAPP_GETTER_WRAPPER(ResponseHeader, getResponseHeader, responseHeader)
1184 UAPP_GETTER_SPAN_WRAPPER(BrowseResult, getResults, results, resultsSize)
1186 DiagnosticInfo, getDiagnosticInfos, diagnosticInfos, diagnosticInfosSize
1188};
1189
1190/**
1191 * UA_BrowseNextRequest wrapper class.
1192 */
1193class BrowseNextRequest : public TypeWrapper<UA_BrowseNextRequest, UA_TYPES_BROWSENEXTREQUEST> {
1194public:
1195 using TypeWrapper::TypeWrapper;
1196
1198 RequestHeader requestHeader,
1199 bool releaseContinuationPoints,
1200 Span<const ByteString> continuationPoints
1201 ) {
1202 handle()->requestHeader = detail::toNative(std::move(requestHeader));
1203 handle()->releaseContinuationPoints = releaseContinuationPoints;
1204 handle()->continuationPointsSize = continuationPoints.size();
1205 handle()->continuationPoints = detail::toNativeArray(continuationPoints);
1206 }
1207
1208 UAPP_GETTER_WRAPPER(RequestHeader, getRequestHeader, requestHeader)
1209 UAPP_GETTER(bool, getReleaseContinuationPoints, releaseContinuationPoints)
1211 ByteString, getContinuationPoints, continuationPoints, continuationPointsSize
1213};
1214
1215/**
1216 * UA_BrowseNextResponse wrapper class.
1217 */
1218class BrowseNextResponse : public TypeWrapper<UA_BrowseNextResponse, UA_TYPES_BROWSENEXTRESPONSE> {
1219public:
1220 using TypeWrapper::TypeWrapper;
1221
1222 UAPP_GETTER_WRAPPER(ResponseHeader, getResponseHeader, responseHeader)
1223 UAPP_GETTER_SPAN_WRAPPER(BrowseResult, getResults, results, resultsSize)
1225 DiagnosticInfo, getDiagnosticInfos, diagnosticInfos, diagnosticInfosSize
1227};
1228
1229/**
1230 * UA_RelativePathElement wrapper class.
1231 */
1233 : public TypeWrapper<UA_RelativePathElement, UA_TYPES_RELATIVEPATHELEMENT> {
1234public:
1235 using TypeWrapper::TypeWrapper;
1236
1238 NodeId referenceTypeId, bool isInverse, bool includeSubtypes, QualifiedName targetName
1239 ) {
1240 handle()->referenceTypeId = detail::toNative(std::move(referenceTypeId));
1241 handle()->isInverse = isInverse;
1242 handle()->includeSubtypes = includeSubtypes;
1243 handle()->targetName = detail::toNative(std::move(targetName));
1244 }
1245
1246 UAPP_GETTER_WRAPPER(NodeId, getReferenceTypeId, referenceTypeId)
1247 UAPP_GETTER(bool, getIsInverse, isInverse)
1248 UAPP_GETTER(bool, getIncludeSubtypes, includeSubtypes)
1249 UAPP_GETTER_WRAPPER(QualifiedName, getTargetName, targetName)
1250};
1251
1252/**
1253 * UA_RelativePath wrapper class.
1254 */
1255class RelativePath : public TypeWrapper<UA_RelativePath, UA_TYPES_RELATIVEPATH> {
1256public:
1257 using TypeWrapper::TypeWrapper;
1258
1259 RelativePath(std::initializer_list<RelativePathElement> elements)
1260 : RelativePath({elements.begin(), elements.size()}) {}
1261
1263 handle()->elementsSize = elements.size();
1264 handle()->elements = detail::toNativeArray(elements);
1265 }
1266
1267 UAPP_GETTER_SPAN_WRAPPER(RelativePathElement, getElements, elements, elementsSize)
1268};
1269
1270/**
1271 * UA_BrowsePath wrapper class.
1272 */
1273class BrowsePath : public TypeWrapper<UA_BrowsePath, UA_TYPES_BROWSEPATH> {
1274public:
1275 using TypeWrapper::TypeWrapper;
1276
1277 BrowsePath(NodeId startingNode, RelativePath relativePath) {
1278 handle()->startingNode = detail::toNative(std::move(startingNode));
1279 handle()->relativePath = detail::toNative(std::move(relativePath));
1280 }
1281
1282 UAPP_GETTER_WRAPPER(NodeId, getStartingNode, startingNode)
1283 UAPP_GETTER_WRAPPER(RelativePath, getRelativePath, relativePath)
1284};
1285
1286/**
1287 * UA_BrowsePathTarget wrapper class.
1288 */
1289class BrowsePathTarget : public TypeWrapper<UA_BrowsePathTarget, UA_TYPES_BROWSEPATHTARGET> {
1290public:
1291 using TypeWrapper::TypeWrapper;
1292
1293 UAPP_GETTER_WRAPPER(ExpandedNodeId, getTargetId, targetId)
1294 UAPP_GETTER(uint32_t, getRemainingPathIndex, remainingPathIndex)
1295};
1296
1297/**
1298 * UA_BrowsePathResult wrapper class.
1299 */
1300class BrowsePathResult : public TypeWrapper<UA_BrowsePathResult, UA_TYPES_BROWSEPATHRESULT> {
1301public:
1302 using TypeWrapper::TypeWrapper;
1303
1304 UAPP_GETTER(StatusCode, getStatusCode, statusCode)
1305 UAPP_GETTER_SPAN_WRAPPER(BrowsePathTarget, getTargets, targets, targetsSize)
1306};
1307
1308/**
1309 * UA_TranslateBrowsePathsToNodeIdsRequest wrapper class.
1310 */
1312 : public TypeWrapper<
1314 UA_TYPES_TRANSLATEBROWSEPATHSTONODEIDSREQUEST> {
1315public:
1316 using TypeWrapper::TypeWrapper;
1317
1319 RequestHeader requestHeader, Span<const BrowsePath> browsePaths
1320 ) {
1321 handle()->requestHeader = detail::toNative(std::move(requestHeader));
1322 handle()->browsePathsSize = browsePaths.size();
1323 handle()->browsePaths = detail::toNativeArray(browsePaths);
1324 }
1325
1326 UAPP_GETTER_WRAPPER(RequestHeader, getRequestHeader, requestHeader)
1327 UAPP_GETTER_SPAN_WRAPPER(BrowsePath, getBrowsePaths, browsePaths, browsePathsSize)
1328};
1329
1330/**
1331 * UA_TranslateBrowsePathsToNodeIdsResponse wrapper class.
1332 */
1334 : public TypeWrapper<
1336 UA_TYPES_TRANSLATEBROWSEPATHSTONODEIDSRESPONSE> {
1337public:
1338 using TypeWrapper::TypeWrapper;
1339
1340 UAPP_GETTER_WRAPPER(ResponseHeader, getResponseHeader, responseHeader)
1341 UAPP_GETTER_SPAN_WRAPPER(BrowsePathResult, getResults, results, resultsSize)
1343 DiagnosticInfo, getDiagnosticInfos, diagnosticInfos, diagnosticInfosSize
1345};
1346
1347/**
1348 * UA_RegisterNodesRequest wrapper class.
1349 */
1351 : public TypeWrapper<UA_RegisterNodesRequest, UA_TYPES_REGISTERNODESREQUEST> {
1352public:
1353 using TypeWrapper::TypeWrapper;
1354
1356 handle()->requestHeader = detail::toNative(std::move(requestHeader));
1357 handle()->nodesToRegisterSize = nodesToRegister.size();
1358 handle()->nodesToRegister = detail::toNativeArray(nodesToRegister);
1359 }
1360
1361 UAPP_GETTER_WRAPPER(RequestHeader, getRequestHeader, requestHeader)
1362 UAPP_GETTER_SPAN_WRAPPER(NodeId, getNodesToRegister, nodesToRegister, nodesToRegisterSize)
1363};
1364
1365/**
1366 * UA_RegisterNodesResponse wrapper class.
1367 */
1369 : public TypeWrapper<UA_RegisterNodesResponse, UA_TYPES_REGISTERNODESRESPONSE> {
1370public:
1371 using TypeWrapper::TypeWrapper;
1372
1373 UAPP_GETTER_WRAPPER(ResponseHeader, getResponseHeader, responseHeader)
1374 UAPP_GETTER_SPAN_WRAPPER(NodeId, getRegisteredNodeIds, registeredNodeIds, registeredNodeIdsSize)
1375};
1376
1377/**
1378 * UA_UnregisterNodesRequest wrapper class.
1379 */
1381 : public TypeWrapper<UA_UnregisterNodesRequest, UA_TYPES_UNREGISTERNODESREQUEST> {
1382public:
1383 using TypeWrapper::TypeWrapper;
1384
1385 UnregisterNodesRequest(RequestHeader requestHeader, Span<const NodeId> nodesToUnregister) {
1386 handle()->requestHeader = detail::toNative(std::move(requestHeader));
1387 handle()->nodesToUnregisterSize = nodesToUnregister.size();
1388 handle()->nodesToUnregister = detail::toNativeArray(nodesToUnregister);
1389 }
1390
1391 UAPP_GETTER_WRAPPER(RequestHeader, getRequestHeader, requestHeader)
1392 UAPP_GETTER_SPAN_WRAPPER(NodeId, getNodesToUnregister, nodesToUnregister, nodesToUnregisterSize)
1393};
1394
1395/**
1396 * UA_UnregisterNodesResponse wrapper class.
1397 */
1399 : public TypeWrapper<UA_UnregisterNodesResponse, UA_TYPES_UNREGISTERNODESRESPONSE> {
1400public:
1401 using TypeWrapper::TypeWrapper;
1402
1403 UAPP_GETTER_WRAPPER(ResponseHeader, getResponseHeader, responseHeader)
1404};
1405
1406/**
1407 * Timestamps to return.
1408 * @see UA_TimestampsToReturn
1409 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/7.40
1410 */
1411enum class TimestampsToReturn : int32_t {
1412 // clang-format off
1413 Source = 0,
1414 Server = 1,
1415 Both = 2,
1416 Neither = 3,
1417 Invalid = 4,
1418 // clang-format on
1419};
1420
1421/**
1422 * UA_ReadValueId wrapper class.
1423 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/7.29
1424 */
1425class ReadValueId : public TypeWrapper<UA_ReadValueId, UA_TYPES_READVALUEID> {
1426public:
1427 using TypeWrapper::TypeWrapper;
1428
1430 NodeId nodeId,
1431 AttributeId attributeId,
1432 std::string_view indexRange = {},
1433 QualifiedName dataEncoding = {}
1434 ) {
1435 handle()->nodeId = detail::toNative(std::move(nodeId));
1436 handle()->attributeId = detail::toNative(attributeId);
1437 handle()->indexRange = detail::toNative(indexRange);
1438 handle()->dataEncoding = detail::toNative(std::move(dataEncoding));
1439 }
1440
1441 UAPP_GETTER_WRAPPER(NodeId, getNodeId, nodeId)
1442 UAPP_GETTER_CAST(AttributeId, getAttributeId, attributeId)
1443 UAPP_GETTER_WRAPPER(String, getIndexRange, indexRange)
1444 UAPP_GETTER_WRAPPER(QualifiedName, getDataEncoding, dataEncoding)
1445};
1446
1447/**
1448 * UA_ReadRequest wrapper class.
1449 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/5.10.2
1450 */
1451class ReadRequest : public TypeWrapper<UA_ReadRequest, UA_TYPES_READREQUEST> {
1452public:
1453 using TypeWrapper::TypeWrapper;
1454
1456 RequestHeader requestHeader,
1457 double maxAge,
1458 TimestampsToReturn timestampsToReturn,
1459 Span<const ReadValueId> nodesToRead
1460 ) {
1461 handle()->requestHeader = detail::toNative(std::move(requestHeader));
1462 handle()->maxAge = maxAge;
1463 handle()->timestampsToReturn = static_cast<UA_TimestampsToReturn>(timestampsToReturn);
1464 handle()->nodesToReadSize = nodesToRead.size();
1465 handle()->nodesToRead = detail::toNativeArray(nodesToRead);
1466 }
1467
1468 UAPP_GETTER_WRAPPER(RequestHeader, getRequestHeader, requestHeader)
1469 UAPP_GETTER(double, getMaxAge, maxAge)
1470 UAPP_GETTER_CAST(TimestampsToReturn, getTimestampsToReturn, timestampsToReturn)
1471 UAPP_GETTER_SPAN_WRAPPER(ReadValueId, getNodesToRead, nodesToRead, nodesToReadSize)
1472};
1473
1474/**
1475 * UA_ReadResponse wrapper class.
1476 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/5.10.2
1477 */
1478class ReadResponse : public TypeWrapper<UA_ReadResponse, UA_TYPES_READRESPONSE> {
1479public:
1480 using TypeWrapper::TypeWrapper;
1481
1482 UAPP_GETTER_WRAPPER(ResponseHeader, getResponseHeader, responseHeader)
1483 UAPP_GETTER_SPAN_WRAPPER(DataValue, getResults, results, resultsSize)
1485 DiagnosticInfo, getDiagnosticInfos, diagnosticInfos, diagnosticInfosSize
1487};
1488
1489/**
1490 * UA_WriteValue wrapper class.
1491 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/5.10.4
1492 */
1493class WriteValue : public TypeWrapper<UA_WriteValue, UA_TYPES_WRITEVALUE> {
1494public:
1495 using TypeWrapper::TypeWrapper;
1496
1498 NodeId nodeId, AttributeId attributeId, std::string_view indexRange, DataValue value
1499 ) {
1500 handle()->nodeId = detail::toNative(std::move(nodeId));
1501 handle()->attributeId = detail::toNative(attributeId);
1502 handle()->indexRange = detail::toNative(indexRange);
1503 handle()->value = detail::toNative(std::move(value));
1504 }
1505
1506 UAPP_GETTER_WRAPPER(NodeId, getNodeId, nodeId)
1507 UAPP_GETTER_CAST(AttributeId, getAttributeId, attributeId)
1508 UAPP_GETTER_WRAPPER(String, getIndexRange, indexRange)
1510};
1511
1512/**
1513 * UA_WriteRequest wrapper class.
1514 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/5.10.4
1515 */
1516class WriteRequest : public TypeWrapper<UA_WriteRequest, UA_TYPES_WRITEREQUEST> {
1517public:
1518 using TypeWrapper::TypeWrapper;
1519
1521 handle()->requestHeader = detail::toNative(std::move(requestHeader));
1522 handle()->nodesToWriteSize = nodesToWrite.size();
1523 handle()->nodesToWrite = detail::toNativeArray(nodesToWrite);
1524 }
1525
1526 UAPP_GETTER_WRAPPER(RequestHeader, getRequestHeader, requestHeader)
1527 UAPP_GETTER_SPAN_WRAPPER(WriteValue, getNodesToWrite, nodesToWrite, nodesToWriteSize)
1528};
1529
1530/**
1531 * UA_WriteResponse wrapper class.
1532 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/5.10.4
1533 */
1534class WriteResponse : public TypeWrapper<UA_WriteResponse, UA_TYPES_WRITERESPONSE> {
1535public:
1536 using TypeWrapper::TypeWrapper;
1537
1538 UAPP_GETTER_WRAPPER(ResponseHeader, getResponseHeader, responseHeader)
1539 UAPP_GETTER_SPAN_WRAPPER(StatusCode, getResults, results, resultsSize)
1541 DiagnosticInfo, getDiagnosticInfos, diagnosticInfos, diagnosticInfosSize
1543};
1544
1545/**
1546 * UA_BuildInfo wrapper class.
1547 * @see https://reference.opcfoundation.org/Core/Part5/v105/docs/12.4
1548 */
1549class BuildInfo : public TypeWrapper<UA_BuildInfo, UA_TYPES_BUILDINFO> {
1550public:
1551 using TypeWrapper::TypeWrapper;
1552
1554 std::string_view productUri,
1555 std::string_view manufacturerName,
1556 std::string_view productName,
1557 std::string_view softwareVersion,
1558 std::string_view buildNumber,
1559 DateTime buildDate
1560 ) {
1561 handle()->productUri = detail::toNative(productUri);
1562 handle()->manufacturerName = detail::toNative(manufacturerName);
1563 handle()->productName = detail::toNative(productName);
1564 handle()->softwareVersion = detail::toNative(softwareVersion);
1565 handle()->buildNumber = detail::toNative(buildNumber);
1566 handle()->buildDate = detail::toNative(std::move(buildDate));
1567 }
1568
1569 UAPP_GETTER_WRAPPER(String, getProductUri, productUri);
1570 UAPP_GETTER_WRAPPER(String, getManufacturerName, manufacturerName);
1571 UAPP_GETTER_WRAPPER(String, getProductName, productName);
1572 UAPP_GETTER_WRAPPER(String, getSoftwareVersion, softwareVersion);
1573 UAPP_GETTER_WRAPPER(String, getBuildNumber, buildNumber);
1574 UAPP_GETTER_WRAPPER(DateTime, getBuildDate, buildDate)
1575};
1576
1577/* ------------------------------------------- Method ------------------------------------------- */
1578
1579#ifdef UA_ENABLE_METHODCALLS
1580
1581/**
1582 * UA_Argument wrapper class.
1583 * @see https://reference.opcfoundation.org/Core/Part3/v105/docs/8.6
1584 */
1585class Argument : public TypeWrapper<UA_Argument, UA_TYPES_ARGUMENT> {
1586public:
1587 using TypeWrapper::TypeWrapper;
1588
1590 std::string_view name,
1591 LocalizedText description,
1592 NodeId dataType,
1593 ValueRank valueRank = {},
1594 Span<const uint32_t> arrayDimensions = {}
1595 ) {
1596 handle()->name = detail::toNative(name);
1597 handle()->description = detail::toNative(std::move(description));
1598 handle()->dataType = detail::toNative(std::move(dataType));
1599 handle()->valueRank = detail::toNative(valueRank);
1600 handle()->arrayDimensionsSize = arrayDimensions.size();
1601 handle()->arrayDimensions = detail::toNativeArray(arrayDimensions);
1602 }
1603
1605 UAPP_GETTER_WRAPPER(LocalizedText, getDescription, description)
1606 UAPP_GETTER_WRAPPER(NodeId, getDataType, dataType)
1607 UAPP_GETTER_CAST(ValueRank, getValueRank, valueRank)
1608 UAPP_GETTER_SPAN(uint32_t, getArrayDimensions, arrayDimensions, arrayDimensionsSize)
1609};
1610
1611/**
1612 * UA_CallMethodRequest wrapper class.
1613 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/5.11.2
1614 */
1615class CallMethodRequest : public TypeWrapper<UA_CallMethodRequest, UA_TYPES_CALLMETHODREQUEST> {
1616public:
1617 using TypeWrapper::TypeWrapper;
1618
1619 CallMethodRequest(NodeId objectId, NodeId methodId, Span<const Variant> inputArguments) {
1620 handle()->objectId = detail::toNative(std::move(objectId));
1621 handle()->methodId = detail::toNative(std::move(methodId));
1622 handle()->inputArgumentsSize = inputArguments.size();
1623 handle()->inputArguments = detail::toNativeArray(inputArguments);
1624 }
1625
1626 UAPP_GETTER_WRAPPER(NodeId, getObjectId, objectId)
1627 UAPP_GETTER_WRAPPER(NodeId, getMethodId, methodId)
1628 UAPP_GETTER_SPAN_WRAPPER(Variant, getInputArguments, inputArguments, inputArgumentsSize)
1629};
1630
1631/**
1632 * UA_CallMethodResult wrapper class.
1633 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/5.11.2
1634 */
1635class CallMethodResult : public TypeWrapper<UA_CallMethodResult, UA_TYPES_CALLMETHODRESULT> {
1636public:
1637 using TypeWrapper::TypeWrapper;
1638
1639 UAPP_GETTER_WRAPPER(StatusCode, getStatusCode, statusCode)
1641 StatusCode, getInputArgumentResults, inputArgumentResults, inputArgumentResultsSize
1645 getInputArgumentDiagnosticInfos,
1646 inputArgumentDiagnosticInfos,
1647 inputArgumentDiagnosticInfosSize
1649 UAPP_GETTER_SPAN_WRAPPER(Variant, getOutputArguments, outputArguments, outputArgumentsSize)
1650};
1651
1652/**
1653 * UA_CallRequest wrapper class.
1654 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/5.11.2
1655 */
1656class CallRequest : public TypeWrapper<UA_CallRequest, UA_TYPES_CALLREQUEST> {
1657public:
1658 using TypeWrapper::TypeWrapper;
1659
1661 handle()->requestHeader = detail::toNative(std::move(requestHeader));
1662 handle()->methodsToCallSize = methodsToCall.size();
1663 handle()->methodsToCall = detail::toNativeArray(methodsToCall);
1664 }
1665
1666 UAPP_GETTER_WRAPPER(RequestHeader, getRequestHeader, requestHeader)
1667 UAPP_GETTER_SPAN_WRAPPER(CallMethodRequest, getMethodsToCall, methodsToCall, methodsToCallSize)
1668};
1669
1670/**
1671 * UA_CallResponse wrapper class.
1672 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/5.11.2
1673 */
1674class CallResponse : public TypeWrapper<UA_CallResponse, UA_TYPES_CALLRESPONSE> {
1675public:
1676 using TypeWrapper::TypeWrapper;
1677
1678 UAPP_GETTER_WRAPPER(ResponseHeader, getResponseHeader, responseHeader)
1679 UAPP_GETTER_SPAN_WRAPPER(CallMethodResult, getResults, results, resultsSize)
1681 DiagnosticInfo, getDiagnosticInfos, diagnosticInfos, diagnosticInfosSize
1683};
1684
1685#endif // UA_ENABLE_METHODCALLS
1686
1687/* ---------------------------------------- Subscriptions --------------------------------------- */
1688
1689#ifdef UA_ENABLE_SUBSCRIPTIONS
1690
1691/**
1692 * Monitoring mode.
1693 * @see UA_MonitoringMode
1694 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/7.23
1695 */
1696enum class MonitoringMode : int32_t {
1697 // clang-format off
1698 Disabled = 0,
1699 Sampling = 1,
1700 Reporting = 2,
1701 // clang-format on
1702};
1703
1704/**
1705 * Filter operator.
1706 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/7.7.3
1707 */
1708enum class FilterOperator : int32_t {
1709 // clang-format off
1710 Equals = 0,
1711 IsNull = 1,
1712 GreaterThan = 2,
1713 LessThan = 3,
1714 GreaterThanOrEqual = 4,
1715 LessThanOrEqual = 5,
1716 Like = 6,
1717 Not = 7,
1718 Between = 8,
1719 InList = 9,
1720 And = 10,
1721 Or = 11,
1722 Cast = 12,
1723 InView = 13,
1724 OfType = 14,
1725 RelatedTo = 15,
1726 BitwiseAnd = 16,
1727 BitwiseOr = 17,
1728 // clang-format on
1729};
1730
1731/**
1732 * UA_ElementOperand wrapper class.
1733 * Reference a sub-element in the ContentFilter elements array by index.
1734 * The index must be greater than the element index it is part of.
1735 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/7.7.4.2
1736 */
1737class ElementOperand : public TypeWrapper<UA_ElementOperand, UA_TYPES_ELEMENTOPERAND> {
1738public:
1739 using TypeWrapper::TypeWrapper;
1740
1741 explicit ElementOperand(uint32_t index) {
1742 handle()->index = index;
1743 }
1744
1745 UAPP_GETTER(uint32_t, getIndex, index)
1746};
1747
1748/**
1749 * UA_LiteralOperand wrapper class.
1750 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/7.7.4.3
1751 */
1752class LiteralOperand : public TypeWrapper<UA_LiteralOperand, UA_TYPES_LITERALOPERAND> {
1753private:
1754 template <typename T>
1755 using EnableIfLiteral =
1756 std::enable_if_t<!detail::IsOneOf<T, Variant, UA_LiteralOperand, LiteralOperand>::value>;
1757
1758public:
1759 using TypeWrapper::TypeWrapper;
1760
1761 explicit LiteralOperand(Variant value) {
1762 handle()->value = detail::toNative(std::move(value));
1763 }
1764
1765 template <typename T, typename = EnableIfLiteral<T>>
1766 explicit LiteralOperand(T&& literal)
1767 : LiteralOperand(Variant(std::forward<T>(literal))) {}
1768
1770};
1771
1772/**
1773 * UA_AttributeOperand wrapper class.
1774 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/7.7.4.4
1775 */
1776class AttributeOperand : public TypeWrapper<UA_AttributeOperand, UA_TYPES_ATTRIBUTEOPERAND> {
1777public:
1778 using TypeWrapper::TypeWrapper;
1779
1781 NodeId nodeId,
1782 std::string_view alias,
1783 RelativePath browsePath,
1784 AttributeId attributeId,
1785 std::string_view indexRange = {}
1786 ) {
1787 handle()->nodeId = detail::toNative(std::move(nodeId));
1788 handle()->alias = detail::toNative(alias);
1789 handle()->browsePath = detail::toNative(std::move(browsePath));
1790 handle()->attributeId = detail::toNative(attributeId);
1791 handle()->indexRange = detail::toNative(indexRange);
1792 }
1793
1794 UAPP_GETTER_WRAPPER(NodeId, getNodeId, nodeId)
1795 UAPP_GETTER_WRAPPER(String, getAlias, alias)
1796 UAPP_GETTER_WRAPPER(RelativePath, getBrowsePath, browsePath)
1797 UAPP_GETTER_CAST(AttributeId, getAttributeId, attributeId)
1798 UAPP_GETTER_WRAPPER(String, getIndexRange, indexRange)
1799};
1800
1801/**
1802 * UA_SimpleAttributeOperand wrapper class.
1803 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/7.7.4.5
1804 */
1806 : public TypeWrapper<UA_SimpleAttributeOperand, UA_TYPES_SIMPLEATTRIBUTEOPERAND> {
1807public:
1808 using TypeWrapper::TypeWrapper;
1809
1811 NodeId typeDefinitionId,
1812 Span<const QualifiedName> browsePath,
1813 AttributeId attributeId,
1814 std::string_view indexRange = {}
1815 ) {
1816 handle()->typeDefinitionId = detail::toNative(std::move(typeDefinitionId));
1817 handle()->browsePathSize = browsePath.size();
1818 handle()->browsePath = detail::toNativeArray(browsePath);
1819 handle()->attributeId = detail::toNative(attributeId);
1820 handle()->indexRange = detail::toNative(indexRange);
1821 }
1822
1823 UAPP_GETTER_WRAPPER(NodeId, getTypeDefinitionId, typeDefinitionId)
1824 UAPP_GETTER_SPAN_WRAPPER(QualifiedName, getBrowsePath, browsePath, browsePathSize)
1825 UAPP_GETTER_CAST(AttributeId, getAttributeId, attributeId)
1826 UAPP_GETTER_WRAPPER(String, getIndexRange, indexRange)
1827};
1828
1829/**
1830 * Filter operand.
1831 *
1832 * The FilterOperand is an extensible parameter and can be of type:
1833 * - ElementOperand
1834 * - LiteralOperand
1835 * - AttributeOperand
1836 * - SimpleAttributeOperand
1837 * - ExtensionObject (other types)
1838 *
1839 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/7.7.4
1840 */
1841using FilterOperand = std::variant<
1847
1848/**
1849 * UA_ContentFilterElement wrapper class.
1850 *
1851 * ContentFilterElements compose a filter criteria with an operator and its operands.
1852 * ContentFilterElements can be composed to ContentFilter objects with the `&&`/`||` operators and
1853 * negated with the `!` operator.
1854 *
1855 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/7.7.1
1856 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/B.1
1857 */
1859 : public TypeWrapper<UA_ContentFilterElement, UA_TYPES_CONTENTFILTERELEMENT> {
1860public:
1861 using TypeWrapper::TypeWrapper;
1862
1864
1865 UAPP_GETTER_CAST(FilterOperator, getFilterOperator, filterOperator)
1866 UAPP_GETTER_SPAN_WRAPPER(ExtensionObject, getFilterOperands, filterOperands, filterOperandsSize)
1867};
1868
1869/**
1870 * UA_ContentFilter wrapper class.
1871 *
1872 * A collection of ContentFilterElement objects that define a filter criteria. The ContentFilter has
1873 * a tree-like structure with references to sub-elements (of type ElementOperand). The evaluation of
1874 * the ContentFilter starts with the first entry of the elements.
1875 * ContentFilter objects can be composed with `&&`/`||` operators and negated with the `!` operator.
1876 *
1877 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/7.7.1
1878 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/B.1
1879 */
1880class ContentFilter : public TypeWrapper<UA_ContentFilter, UA_TYPES_CONTENTFILTER> {
1881public:
1882 using TypeWrapper::TypeWrapper;
1883
1884 ContentFilter(std::initializer_list<ContentFilterElement> elements);
1886
1887 UAPP_GETTER_SPAN_WRAPPER(ContentFilterElement, getElements, elements, elementsSize)
1888};
1889
1890/// @relates ContentFilterElement
1892/// @relates ContentFilter
1894
1895/// @relates ContentFilterElement
1897/// @relates ContentFilterElement
1898/// @relatesalso ContentFilter
1900/// @relates ContentFilter
1901/// @relatesalso ContentFilterElement
1903/// @relates ContentFilter
1905
1906/// @relates ContentFilterElement
1908/// @relates ContentFilterElement
1909/// @relatesalso ContentFilter
1911/// @relates ContentFilter
1912/// @relatesalso ContentFilterElement
1914/// @relates ContentFilter
1916
1917/**
1918 * Data change trigger.
1919 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/7.10
1920 */
1921enum class DataChangeTrigger : int32_t {
1922 // clang-format off
1923 Status = 0,
1924 StatusValue = 1,
1925 StatusValueTimestamp = 2,
1926 // clang-format on
1927};
1928
1929/**
1930 * Deadband type.
1931 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/7.22.2
1932 */
1933enum class DeadbandType : int32_t {
1934 // clang-format off
1935 None = 0,
1936 Absolute = 1,
1937 Percent = 2,
1938 // clang-format on
1939};
1940
1941/**
1942 * UA_DataChangeFilter wrapper class.
1943 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/7.22.2
1944 */
1945class DataChangeFilter : public TypeWrapper<UA_DataChangeFilter, UA_TYPES_DATACHANGEFILTER> {
1946public:
1947 using TypeWrapper::TypeWrapper;
1948
1949 DataChangeFilter(DataChangeTrigger trigger, DeadbandType deadbandType, double deadbandValue) {
1950 handle()->trigger = static_cast<UA_DataChangeTrigger>(trigger);
1951 handle()->deadbandType = detail::toNative(deadbandType);
1952 handle()->deadbandValue = deadbandValue;
1953 }
1954
1956 UAPP_GETTER_CAST(DeadbandType, getDeadbandType, deadbandType)
1957 UAPP_GETTER(double, getDeadbandValue, deadbandValue)
1958};
1959
1960/**
1961 * UA_EventFilter wrapper class.
1962 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/7.22.3
1963 */
1964class EventFilter : public TypeWrapper<UA_EventFilter, UA_TYPES_EVENTFILTER> {
1965public:
1966 using TypeWrapper::TypeWrapper;
1967
1969 handle()->selectClausesSize = selectClauses.size();
1970 handle()->selectClauses = detail::toNativeArray(selectClauses);
1971 handle()->whereClause = detail::toNative(std::move(whereClause));
1972 }
1973
1975 SimpleAttributeOperand, getSelectClauses, selectClauses, selectClausesSize
1977 UAPP_GETTER_WRAPPER(ContentFilter, getWhereClause, whereClause)
1978};
1979
1981
1982/**
1983 * UA_AggregateFilter wrapper class.
1984 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/7.22.4
1985 */
1986class AggregateFilter : public TypeWrapper<UA_AggregateFilter, UA_TYPES_AGGREGATEFILTER> {
1987public:
1988 using TypeWrapper::TypeWrapper;
1989
1991 DateTime startTime,
1992 NodeId aggregateType,
1993 double processingInterval,
1994 AggregateConfiguration aggregateConfiguration
1995 ) {
1996 handle()->startTime = detail::toNative(std::move(startTime));
1997 handle()->aggregateType = detail::toNative(std::move(aggregateType));
1998 handle()->processingInterval = processingInterval;
1999 handle()->aggregateConfiguration = aggregateConfiguration; // TODO: make wrapper?
2000 }
2001
2002 UAPP_GETTER_WRAPPER(DateTime, getStartTime, startTime)
2003 UAPP_GETTER_WRAPPER(NodeId, getAggregateType, aggregateType)
2004 UAPP_GETTER(double, getProcessingInterval, processingInterval)
2005 UAPP_GETTER(AggregateConfiguration, getAggregateConfiguration, aggregateConfiguration)
2006};
2007
2008/**
2009 * UA_MonitoringParameters wrapper class.
2010 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/7.21
2011 */
2013 : public TypeWrapper<UA_MonitoringParameters, UA_TYPES_MONITORINGPARAMETERS> {
2014public:
2015 using TypeWrapper::TypeWrapper;
2016
2017 /// Construct with default values from open62541.
2018 /// The `clientHandle` parameter cannot be set by the user, any value will be replaced by the
2019 /// client before sending the request to the server.
2020 // NOLINTNEXTLINE(hicpp-explicit-conversions)
2022 double samplingInterval = 250.0,
2023 ExtensionObject filter = {},
2024 uint32_t queueSize = 1U,
2025 bool discardOldest = true
2026 ) {
2027 handle()->samplingInterval = samplingInterval;
2028 handle()->filter = detail::toNative(std::move(filter));
2029 handle()->queueSize = queueSize;
2030 handle()->discardOldest = discardOldest;
2031 }
2032
2033 UAPP_GETTER(double, getSamplingInterval, samplingInterval)
2035 UAPP_GETTER(uint32_t, getQueueSize, queueSize)
2036 UAPP_GETTER(bool, getDiscardOldest, discardOldest)
2037};
2038
2039/**
2040 * UA_MonitoredItemCreateRequest wrapper class.
2041 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/5.12.2
2042 */
2044 : public TypeWrapper<UA_MonitoredItemCreateRequest, UA_TYPES_MONITOREDITEMCREATEREQUEST> {
2045public:
2046 using TypeWrapper::TypeWrapper;
2047
2049 ReadValueId itemToMonitor,
2050 MonitoringMode monitoringMode = MonitoringMode::Reporting,
2051 MonitoringParameters requestedParameters = {}
2052 ) {
2053 handle()->itemToMonitor = detail::toNative(std::move(itemToMonitor));
2054 handle()->monitoringMode = static_cast<UA_MonitoringMode>(monitoringMode);
2055 handle()->requestedParameters = detail::toNative(std::move(requestedParameters));
2056 }
2057
2058 UAPP_GETTER_WRAPPER(ReadValueId, getItemToMonitor, itemToMonitor)
2059 UAPP_GETTER_CAST(MonitoringMode, getMonitoringMode, monitoringMode)
2060 UAPP_GETTER_WRAPPER(MonitoringParameters, getRequestedParameters, requestedParameters)
2061};
2062
2063/**
2064 * UA_MonitoredItemCreateResult wrapper class.
2065 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/5.12.2
2066 */
2068 : public TypeWrapper<UA_MonitoredItemCreateResult, UA_TYPES_MONITOREDITEMCREATERESULT> {
2069public:
2070 using TypeWrapper::TypeWrapper;
2071
2072 UAPP_GETTER_WRAPPER(StatusCode, getStatusCode, statusCode);
2073 UAPP_GETTER(IntegerId, getMonitoredItemId, monitoredItemId);
2074 UAPP_GETTER(double, getRevisedSamplingInterval, revisedSamplingInterval);
2075 UAPP_GETTER(IntegerId, getRevisedQueueSize, revisedQueueSize);
2076 UAPP_GETTER_WRAPPER(ExtensionObject, getFilterResult, filterResult);
2077};
2078
2079/**
2080 * UA_CreateMonitoredItemsRequest wrapper class.
2081 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/5.12.2
2082 */
2084 : public TypeWrapper<UA_CreateMonitoredItemsRequest, UA_TYPES_CREATEMONITOREDITEMSREQUEST> {
2085public:
2086 using TypeWrapper::TypeWrapper;
2087
2089 RequestHeader requestHeader,
2090 IntegerId subscriptionId,
2091 TimestampsToReturn timestampsToReturn,
2093 ) {
2094 handle()->requestHeader = detail::toNative(std::move(requestHeader));
2095 handle()->subscriptionId = subscriptionId;
2096 handle()->timestampsToReturn = static_cast<UA_TimestampsToReturn>(timestampsToReturn);
2097 handle()->itemsToCreateSize = itemsToCreate.size();
2098 handle()->itemsToCreate = detail::toNativeArray(itemsToCreate);
2099 }
2100
2101 UAPP_GETTER_WRAPPER(RequestHeader, getRequestHeader, requestHeader)
2102 UAPP_GETTER(IntegerId, getSubscriptionId, subscriptionId)
2103 UAPP_GETTER_CAST(TimestampsToReturn, getTimestampsToReturn, timestampsToReturn)
2105 MonitoredItemCreateRequest, getItemsToCreate, itemsToCreate, itemsToCreateSize
2107};
2108
2109/**
2110 * UA_CreateMonitoredItemsResponse wrapper class.
2111 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/5.12.2
2112 */
2114 : public TypeWrapper<UA_CreateMonitoredItemsResponse, UA_TYPES_CREATEMONITOREDITEMSRESPONSE> {
2115public:
2116 using TypeWrapper::TypeWrapper;
2117
2118 UAPP_GETTER_WRAPPER(ResponseHeader, getResponseHeader, responseHeader)
2119 UAPP_GETTER_SPAN_WRAPPER(MonitoredItemCreateResult, getResults, results, resultsSize);
2121 DiagnosticInfo, getDiagnosticInfos, diagnosticInfos, diagnosticInfosSize
2123};
2124
2125/**
2126 * UA_MonitoredItemModifyRequest wrapper class.
2127 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/5.12.3
2128 */
2130 : public TypeWrapper<UA_MonitoredItemModifyRequest, UA_TYPES_MONITOREDITEMMODIFYREQUEST> {
2131public:
2132 using TypeWrapper::TypeWrapper;
2133
2135 IntegerId monitoredItemId, MonitoringParameters requestedParameters
2136 ) {
2137 handle()->monitoredItemId = monitoredItemId;
2138 handle()->requestedParameters = detail::toNative(std::move(requestedParameters));
2139 }
2140
2141 UAPP_GETTER(IntegerId, getMonitoredItemId, monitoredItemId);
2142 UAPP_GETTER_WRAPPER(MonitoringParameters, getRequestedParameters, requestedParameters)
2143};
2144
2145/**
2146 * UA_MonitoredItemModifyResult wrapper class.
2147 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/5.12.3
2148 */
2150 : public TypeWrapper<UA_MonitoredItemModifyResult, UA_TYPES_MONITOREDITEMMODIFYRESULT> {
2151public:
2152 using TypeWrapper::TypeWrapper;
2153
2154 UAPP_GETTER_WRAPPER(StatusCode, getStatusCode, statusCode);
2155 UAPP_GETTER(double, getRevisedSamplingInterval, revisedSamplingInterval);
2156 UAPP_GETTER(uint32_t, getRevisedQueueSize, revisedQueueSize);
2157 UAPP_GETTER_WRAPPER(ExtensionObject, getFilterResult, filterResult);
2158};
2159
2160/**
2161 * UA_ModifyMonitoredItemsRequest wrapper class.
2162 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/5.12.3
2163 */
2165 : public TypeWrapper<UA_ModifyMonitoredItemsRequest, UA_TYPES_MODIFYMONITOREDITEMSREQUEST> {
2166public:
2167 using TypeWrapper::TypeWrapper;
2168
2170 RequestHeader requestHeader,
2171 IntegerId subscriptionId,
2172 TimestampsToReturn timestampsToReturn,
2174 ) {
2175 handle()->requestHeader = detail::toNative(std::move(requestHeader));
2176 handle()->subscriptionId = subscriptionId;
2177 handle()->timestampsToReturn = static_cast<UA_TimestampsToReturn>(timestampsToReturn);
2178 handle()->itemsToModifySize = itemsToModify.size();
2179 handle()->itemsToModify = detail::toNativeArray(itemsToModify);
2180 }
2181
2182 UAPP_GETTER_WRAPPER(RequestHeader, getRequestHeader, requestHeader)
2183 UAPP_GETTER(IntegerId, getSubscriptionId, subscriptionId)
2184 UAPP_GETTER_CAST(TimestampsToReturn, getTimestampsToReturn, timestampsToReturn)
2186 MonitoredItemModifyRequest, getItemsToModify, itemsToModify, itemsToModifySize
2188};
2189
2190/**
2191 * UA_CreateMonitoredItemsResponse wrapper class.
2192 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/5.12.3
2193 */
2195 : public TypeWrapper<UA_ModifyMonitoredItemsResponse, UA_TYPES_MODIFYMONITOREDITEMSRESPONSE> {
2196public:
2197 using TypeWrapper::TypeWrapper;
2198
2199 UAPP_GETTER_WRAPPER(ResponseHeader, getResponseHeader, responseHeader)
2200 UAPP_GETTER_SPAN_WRAPPER(MonitoredItemModifyResult, getResults, results, resultsSize);
2202 DiagnosticInfo, getDiagnosticInfos, diagnosticInfos, diagnosticInfosSize
2204};
2205
2206/**
2207 * UA_SetMonitoringModeRequest wrapper class.
2208 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/5.12.4
2209 */
2211 : public TypeWrapper<UA_SetMonitoringModeRequest, UA_TYPES_SETMONITORINGMODEREQUEST> {
2212public:
2213 using TypeWrapper::TypeWrapper;
2214
2216 RequestHeader requestHeader,
2217 IntegerId subscriptionId,
2218 MonitoringMode monitoringMode,
2219 Span<const IntegerId> monitoredItemIds
2220 ) {
2221 handle()->requestHeader = detail::toNative(std::move(requestHeader));
2222 handle()->subscriptionId = subscriptionId;
2223 handle()->monitoringMode = static_cast<UA_MonitoringMode>(monitoringMode);
2224 handle()->monitoredItemIdsSize = monitoredItemIds.size();
2225 handle()->monitoredItemIds = detail::toNativeArray(monitoredItemIds);
2226 }
2227
2228 UAPP_GETTER_WRAPPER(RequestHeader, getRequestHeader, requestHeader)
2229 UAPP_GETTER(IntegerId, getSubscriptionId, subscriptionId)
2230 UAPP_GETTER_CAST(MonitoringMode, getMonitoringMode, monitoringMode)
2231 UAPP_GETTER_SPAN(IntegerId, getMonitoredItemIds, monitoredItemIds, monitoredItemIdsSize)
2232};
2233
2234/**
2235 * UA_SetMonitoringModeResponse wrapper class.
2236 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/5.12.4
2237 */
2239 : public TypeWrapper<UA_SetMonitoringModeResponse, UA_TYPES_SETMONITORINGMODERESPONSE> {
2240public:
2241 using TypeWrapper::TypeWrapper;
2242
2243 UAPP_GETTER_WRAPPER(ResponseHeader, getResponseHeader, responseHeader)
2244 UAPP_GETTER_SPAN_WRAPPER(StatusCode, getResults, results, resultsSize);
2246 DiagnosticInfo, getDiagnosticInfos, diagnosticInfos, diagnosticInfosSize
2248};
2249
2250/**
2251 * UA_SetTriggeringRequest wrapper class.
2252 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/5.12.5
2253 */
2255 : public TypeWrapper<UA_SetTriggeringRequest, UA_TYPES_SETTRIGGERINGREQUEST> {
2256public:
2257 using TypeWrapper::TypeWrapper;
2258
2260 RequestHeader requestHeader,
2261 IntegerId subscriptionId,
2262 IntegerId triggeringItemId,
2263 Span<const IntegerId> linksToAdd,
2264 Span<const IntegerId> linksToRemove
2265 ) {
2266 handle()->requestHeader = detail::toNative(std::move(requestHeader));
2267 handle()->subscriptionId = subscriptionId;
2268 handle()->triggeringItemId = triggeringItemId;
2269 handle()->linksToAddSize = linksToAdd.size();
2270 handle()->linksToAdd = detail::toNativeArray(linksToAdd);
2271 handle()->linksToRemoveSize = linksToRemove.size();
2272 handle()->linksToRemove = detail::toNativeArray(linksToRemove);
2273 }
2274
2275 UAPP_GETTER_WRAPPER(RequestHeader, getRequestHeader, requestHeader)
2276 UAPP_GETTER(IntegerId, getSubscriptionId, subscriptionId)
2277 UAPP_GETTER(IntegerId, getTriggeringItemId, triggeringItemId)
2278 UAPP_GETTER_SPAN(IntegerId, getLinksToAdd, linksToAdd, linksToAddSize)
2279 UAPP_GETTER_SPAN(IntegerId, getLinksToRemove, linksToRemove, linksToRemoveSize)
2280};
2281
2282/**
2283 * UA_SetTriggeringResponse wrapper class.
2284 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/5.12.5
2285 */
2287 : public TypeWrapper<UA_SetTriggeringResponse, UA_TYPES_SETTRIGGERINGRESPONSE> {
2288public:
2289 using TypeWrapper::TypeWrapper;
2290
2291 UAPP_GETTER_WRAPPER(ResponseHeader, getResponseHeader, responseHeader)
2292 UAPP_GETTER_SPAN_WRAPPER(StatusCode, getAddResults, addResults, addResultsSize);
2294 DiagnosticInfo, getAddDiagnosticInfos, addDiagnosticInfos, addDiagnosticInfosSize
2296 UAPP_GETTER_SPAN_WRAPPER(StatusCode, getRemoveResults, removeResults, removeResultsSize);
2298 DiagnosticInfo, getRemoveDiagnosticInfos, removeDiagnosticInfos, removeDiagnosticInfosSize
2300};
2301
2302/**
2303 * UA_DeleteMonitoredItemsRequest wrapper class.
2304 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/5.12.6
2305 */
2307 : public TypeWrapper<UA_DeleteMonitoredItemsRequest, UA_TYPES_DELETEMONITOREDITEMSREQUEST> {
2308public:
2309 using TypeWrapper::TypeWrapper;
2310
2312 RequestHeader requestHeader,
2313 IntegerId subscriptionId,
2314 Span<const IntegerId> monitoredItemIds
2315 ) {
2316 handle()->requestHeader = detail::toNative(std::move(requestHeader));
2317 handle()->subscriptionId = subscriptionId;
2318 handle()->monitoredItemIdsSize = monitoredItemIds.size();
2319 handle()->monitoredItemIds = detail::toNativeArray(monitoredItemIds);
2320 }
2321
2322 UAPP_GETTER_WRAPPER(RequestHeader, getRequestHeader, requestHeader)
2323 UAPP_GETTER(IntegerId, getSubscriptionId, subscriptionId)
2324 UAPP_GETTER_SPAN(IntegerId, getMonitoredItemIds, monitoredItemIds, monitoredItemIdsSize)
2325};
2326
2327/**
2328 * UA_DeleteMonitoredItemsResponse wrapper class.
2329 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/5.12.6
2330 */
2332 : public TypeWrapper<UA_DeleteMonitoredItemsResponse, UA_TYPES_DELETEMONITOREDITEMSRESPONSE> {
2333public:
2334 using TypeWrapper::TypeWrapper;
2335
2336 UAPP_GETTER_WRAPPER(ResponseHeader, getResponseHeader, responseHeader)
2337 UAPP_GETTER_SPAN_WRAPPER(StatusCode, getResults, results, resultsSize);
2339 DiagnosticInfo, getDiagnosticInfos, diagnosticInfos, diagnosticInfosSize
2341};
2342
2343/**
2344 * UA_CreateSubscriptionRequest wrapper class.
2345 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/5.13.2
2346 */
2348 : public TypeWrapper<UA_CreateSubscriptionRequest, UA_TYPES_CREATESUBSCRIPTIONREQUEST> {
2349public:
2350 using TypeWrapper::TypeWrapper;
2351
2353 RequestHeader requestHeader,
2354 double requestedPublishingInterval,
2355 uint32_t requestedLifetimeCount,
2356 uint32_t requestedMaxKeepAliveCount,
2357 uint32_t maxNotificationsPerPublish,
2358 bool publishingEnabled,
2359 uint8_t priority
2360 ) {
2361 handle()->requestHeader = detail::toNative(std::move(requestHeader));
2362 handle()->requestedPublishingInterval = requestedPublishingInterval;
2363 handle()->requestedLifetimeCount = requestedLifetimeCount;
2364 handle()->requestedMaxKeepAliveCount = requestedMaxKeepAliveCount;
2365 handle()->maxNotificationsPerPublish = maxNotificationsPerPublish;
2366 handle()->publishingEnabled = publishingEnabled;
2367 handle()->priority = priority;
2368 }
2369
2370 UAPP_GETTER_WRAPPER(RequestHeader, getRequestHeader, requestHeader)
2371 UAPP_GETTER(double, getRequestedPublishingInterval, requestedPublishingInterval)
2372 UAPP_GETTER(uint32_t, getRequestedLifetimeCount, requestedLifetimeCount)
2373 UAPP_GETTER(uint32_t, getRequestedMaxKeepAliveCount, requestedMaxKeepAliveCount)
2374 UAPP_GETTER(uint32_t, getMaxNotificationsPerPublish, maxNotificationsPerPublish)
2375 UAPP_GETTER(bool, getPublishingEnabled, publishingEnabled)
2376 UAPP_GETTER(uint8_t, getPriority, priority)
2377};
2378
2379/**
2380 * UA_CreateSubscriptionResponse wrapper class.
2381 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/5.13.2
2382 */
2384 : public TypeWrapper<UA_CreateSubscriptionResponse, UA_TYPES_CREATESUBSCRIPTIONRESPONSE> {
2385public:
2386 using TypeWrapper::TypeWrapper;
2387
2388 UAPP_GETTER_WRAPPER(ResponseHeader, getResponseHeader, responseHeader)
2389 UAPP_GETTER(IntegerId, getSubscriptionId, subscriptionId)
2390 UAPP_GETTER(bool, getRevisedPublishingInterval, revisedPublishingInterval)
2391 UAPP_GETTER(uint32_t, getRevisedLifetimeCount, revisedLifetimeCount)
2392 UAPP_GETTER(uint32_t, getRevisedMaxKeepAliveCount, revisedMaxKeepAliveCount)
2393};
2394
2395/**
2396 * UA_ModifySubscriptionRequest wrapper class.
2397 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/5.13.3
2398 */
2400 : public TypeWrapper<UA_ModifySubscriptionRequest, UA_TYPES_MODIFYSUBSCRIPTIONREQUEST> {
2401public:
2402 using TypeWrapper::TypeWrapper;
2403
2405 RequestHeader requestHeader,
2406 IntegerId subscriptionId,
2407 double requestedPublishingInterval,
2408 uint32_t requestedLifetimeCount,
2409 uint32_t requestedMaxKeepAliveCount,
2410 uint32_t maxNotificationsPerPublish,
2411 uint8_t priority
2412 ) {
2413 handle()->requestHeader = detail::toNative(std::move(requestHeader));
2414 handle()->subscriptionId = subscriptionId;
2415 handle()->requestedPublishingInterval = requestedPublishingInterval;
2416 handle()->requestedLifetimeCount = requestedLifetimeCount;
2417 handle()->requestedMaxKeepAliveCount = requestedMaxKeepAliveCount;
2418 handle()->maxNotificationsPerPublish = maxNotificationsPerPublish;
2419 handle()->priority = priority;
2420 }
2421
2422 UAPP_GETTER_WRAPPER(RequestHeader, getRequestHeader, requestHeader)
2423 UAPP_GETTER(IntegerId, getSubscriptionId, subscriptionId)
2424 UAPP_GETTER(double, getRequestedPublishingInterval, requestedPublishingInterval)
2425 UAPP_GETTER(uint32_t, getRequestedLifetimeCount, requestedLifetimeCount)
2426 UAPP_GETTER(uint32_t, getRequestedMaxKeepAliveCount, requestedMaxKeepAliveCount)
2427 UAPP_GETTER(uint32_t, getMaxNotificationsPerPublish, maxNotificationsPerPublish)
2428 UAPP_GETTER(uint8_t, getPriority, priority)
2429};
2430
2431/**
2432 * UA_ModifySubscriptionResponse wrapper class.
2433 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/5.13.3
2434 */
2436 : public TypeWrapper<UA_ModifySubscriptionResponse, UA_TYPES_MODIFYSUBSCRIPTIONRESPONSE> {
2437public:
2438 using TypeWrapper::TypeWrapper;
2439
2440 UAPP_GETTER_WRAPPER(ResponseHeader, getResponseHeader, responseHeader)
2441 UAPP_GETTER(bool, getRevisedPublishingInterval, revisedPublishingInterval)
2442 UAPP_GETTER(uint32_t, getRevisedLifetimeCount, revisedLifetimeCount)
2443 UAPP_GETTER(uint32_t, getRevisedMaxKeepAliveCount, revisedMaxKeepAliveCount)
2444};
2445
2446/**
2447 * UA_SetPublishingModeRequest wrapper class.
2448 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/5.13.4
2449 */
2451 : public TypeWrapper<UA_SetPublishingModeRequest, UA_TYPES_SETPUBLISHINGMODEREQUEST> {
2452public:
2453 using TypeWrapper::TypeWrapper;
2454
2456 RequestHeader requestHeader, bool publishingEnabled, Span<const IntegerId> subscriptionIds
2457 ) {
2458 handle()->requestHeader = detail::toNative(std::move(requestHeader));
2459 handle()->publishingEnabled = publishingEnabled;
2460 handle()->subscriptionIdsSize = subscriptionIds.size();
2461 handle()->subscriptionIds = detail::toNativeArray(subscriptionIds);
2462 }
2463
2464 UAPP_GETTER_WRAPPER(RequestHeader, getRequestHeader, requestHeader)
2465 UAPP_GETTER(bool, getPublishingEnabled, publishingEnabled)
2466 UAPP_GETTER_SPAN(IntegerId, getSubscriptionIds, subscriptionIds, subscriptionIdsSize)
2467};
2468
2469/**
2470 * UA_SetPublishingModeResponse wrapper class.
2471 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/5.13.4
2472 */
2474 : public TypeWrapper<UA_SetPublishingModeResponse, UA_TYPES_SETPUBLISHINGMODERESPONSE> {
2475public:
2476 using TypeWrapper::TypeWrapper;
2477
2478 UAPP_GETTER_WRAPPER(ResponseHeader, getResponseHeader, responseHeader)
2479 UAPP_GETTER_SPAN_WRAPPER(StatusCode, getResults, results, resultsSize)
2481 DiagnosticInfo, getDiagnosticInfos, diagnosticInfos, diagnosticInfosSize
2483};
2484
2485/**
2486 * UA_StatusChangeNotification wrapper class.
2487 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/7.25.4
2488 */
2490 : public TypeWrapper<UA_StatusChangeNotification, UA_TYPES_STATUSCHANGENOTIFICATION> {
2491public:
2492 using TypeWrapper::TypeWrapper;
2493
2495 UAPP_GETTER_WRAPPER(DiagnosticInfo, getDiagnosticInfo, diagnosticInfo)
2496};
2497
2498/**
2499 * UA_DeleteSubscriptionsRequest wrapper class.
2500 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/5.13.8
2501 */
2503 : public TypeWrapper<UA_DeleteSubscriptionsRequest, UA_TYPES_DELETESUBSCRIPTIONSREQUEST> {
2504public:
2505 using TypeWrapper::TypeWrapper;
2506
2508 handle()->requestHeader = detail::toNative(std::move(requestHeader));
2509 handle()->subscriptionIdsSize = subscriptionIds.size();
2510 handle()->subscriptionIds = detail::toNativeArray(subscriptionIds);
2511 }
2512
2513 UAPP_GETTER_WRAPPER(RequestHeader, getRequestHeader, requestHeader)
2514 UAPP_GETTER_SPAN(IntegerId, getSubscriptionIds, subscriptionIds, subscriptionIdsSize)
2515};
2516
2517/**
2518 * UA_DeleteSubscriptionsResponse wrapper class.
2519 * @see https://reference.opcfoundation.org/Core/Part4/v105/docs/5.13.8
2520 */
2522 : public TypeWrapper<UA_DeleteSubscriptionsResponse, UA_TYPES_DELETESUBSCRIPTIONSRESPONSE> {
2523public:
2524 using TypeWrapper::TypeWrapper;
2525
2526 UAPP_GETTER_WRAPPER(ResponseHeader, getResponseHeader, responseHeader)
2527 UAPP_GETTER_SPAN_WRAPPER(StatusCode, getResults, results, resultsSize)
2529 DiagnosticInfo, getDiagnosticInfos, diagnosticInfos, diagnosticInfosSize
2531};
2532
2533#endif // UA_ENABLE_SUBSCRIPTIONS
2534
2535/* ----------------------------------------- Historizing ---------------------------------------- */
2536
2537/**
2538 * Perform update type for structured data history updates.
2539 * @see UA_PerformUpdateType
2540 * @see https://reference.opcfoundation.org/Core/Part11/v104/docs/6.8.3
2541 */
2542enum class PerformUpdateType : int32_t {
2543 // clang-format off
2544 Insert = 1,
2545 Replace = 2,
2546 Update = 3,
2547 Remove = 4,
2548 // clang-format on
2549};
2550
2551/* ----------------------------------------- DataAccess ----------------------------------------- */
2552
2553#if UAPP_HAS_DATAACCESS
2554
2555/**
2556 * UA_Range wrapper class.
2557 * @see https://reference.opcfoundation.org/Core/Part8/v105/docs/5.6.2
2558 */
2559class Range : public TypeWrapper<UA_Range, UA_TYPES_RANGE> {
2560public:
2561 using TypeWrapper::TypeWrapper;
2562
2563 Range(double low, double high) noexcept {
2564 handle()->low = low;
2565 handle()->high = high;
2566 }
2567
2568 UAPP_GETTER(double, getLow, low)
2569 UAPP_GETTER(double, getHigh, high)
2570};
2571
2572/**
2573 * UA_EUInformation wrapper class.
2574 * @see https://reference.opcfoundation.org/Core/Part8/v105/docs/5.6.3
2575 */
2576class EUInformation : public TypeWrapper<UA_EUInformation, UA_TYPES_EUINFORMATION> {
2577public:
2578 using TypeWrapper::TypeWrapper;
2579
2581 std::string_view namespaceUri,
2582 int32_t unitId,
2583 LocalizedText displayName,
2584 LocalizedText description
2585 ) {
2586 handle()->namespaceUri = detail::toNative(namespaceUri);
2587 handle()->unitId = unitId;
2588 handle()->displayName = detail::toNative(std::move(displayName));
2589 handle()->description = detail::toNative(std::move(description));
2590 }
2591
2592 UAPP_GETTER_WRAPPER(String, getNamespaceUri, namespaceUri)
2593 UAPP_GETTER(int32_t, getUnitId, unitId)
2594 UAPP_GETTER_WRAPPER(LocalizedText, getDisplayName, displayName)
2595 UAPP_GETTER_WRAPPER(LocalizedText, getDescription, description)
2596};
2597
2598/**
2599 * UA_ComplexNumberType wrapper class.
2600 * @see https://reference.opcfoundation.org/Core/Part8/v105/docs/5.6.4
2601 */
2602class ComplexNumberType : public TypeWrapper<UA_ComplexNumberType, UA_TYPES_COMPLEXNUMBERTYPE> {
2603public:
2604 using TypeWrapper::TypeWrapper;
2605
2606 ComplexNumberType(float real, float imaginary) noexcept {
2607 handle()->real = real;
2608 handle()->imaginary = imaginary;
2609 }
2610
2611 UAPP_GETTER(float, getReal, real)
2612 UAPP_GETTER(float, getImaginary, imaginary)
2613};
2614
2615/**
2616 * UA_DoubleComplexNumberType wrapper class.
2617 * @see https://reference.opcfoundation.org/Core/Part8/v105/docs/5.6.5
2618 */
2620 : public TypeWrapper<UA_DoubleComplexNumberType, UA_TYPES_DOUBLECOMPLEXNUMBERTYPE> {
2621public:
2622 using TypeWrapper::TypeWrapper;
2623
2624 DoubleComplexNumberType(double real, double imaginary) noexcept {
2625 handle()->real = real;
2626 handle()->imaginary = imaginary;
2627 }
2628
2629 UAPP_GETTER(double, getReal, real)
2630 UAPP_GETTER(double, getImaginary, imaginary)
2631};
2632
2633/**
2634 * Axis scale.
2635 * @see https://reference.opcfoundation.org/Core/Part8/v105/docs/5.6.7
2636 */
2637enum class AxisScaleEnumeration : int32_t {
2638 Linear = 1,
2639 Log = 2,
2640 Ln = 3,
2641};
2642
2643/**
2644 * UA_AxisInformation wrapper class.
2645 * @see https://reference.opcfoundation.org/Core/Part8/v105/docs/5.6.6
2646 */
2647class AxisInformation : public TypeWrapper<UA_AxisInformation, UA_TYPES_AXISINFORMATION> {
2648public:
2649 using TypeWrapper::TypeWrapper;
2650
2652 EUInformation engineeringUnits,
2653 Range eURange,
2654 LocalizedText title,
2655 AxisScaleEnumeration axisScaleType,
2656 Span<const double> axisSteps
2657 ) {
2658 handle()->engineeringUnits = detail::toNative(std::move(engineeringUnits));
2659 handle()->eURange = detail::toNative(std::move(eURange));
2660 handle()->title = detail::toNative(std::move(title));
2661 handle()->axisScaleType = static_cast<UA_AxisScaleEnumeration>(axisScaleType);
2662 handle()->axisStepsSize = axisSteps.size();
2663 handle()->axisSteps = detail::toNativeArray(axisSteps);
2664 }
2665
2666 UAPP_GETTER_WRAPPER(EUInformation, getEngineeringUnits, engineeringUnits)
2667 UAPP_GETTER_WRAPPER(Range, getEURange, eURange)
2669 UAPP_GETTER_CAST(AxisScaleEnumeration, getAxisScaleType, axisScaleType)
2670 UAPP_GETTER_SPAN(double, getAxisSteps, axisSteps, axisStepsSize)
2671};
2672
2673/**
2674 * UA_XVType wrapper class.
2675 * @see https://reference.opcfoundation.org/Core/Part8/v105/docs/5.6.8
2676 */
2677class XVType : public TypeWrapper<UA_XVType, UA_TYPES_XVTYPE> {
2678public:
2679 using TypeWrapper::TypeWrapper;
2680
2681 XVType(double x, float value) noexcept {
2682 handle()->x = x;
2683 handle()->value = value;
2684 }
2685
2686 UAPP_GETTER(double, getX, x)
2687 UAPP_GETTER(float, getValue, value)
2688};
2689
2690#endif // UAPP_HAS_DATAACCESS
2691
2692/* -------------------------------------- Type description -------------------------------------- */
2693
2694#ifdef UA_ENABLE_TYPEDESCRIPTION
2695
2696/**
2697 * Structure type.
2698 * @see https://reference.opcfoundation.org/Core/Part3/v105/docs/8.49
2699 */
2700enum class StructureType : int32_t {
2701 // clang-format off
2702 Structure = 0,
2703 StructureWithOptionalFields = 1,
2704 Union = 2,
2705 // clang-format on
2706};
2707
2708/**
2709 * UA_StructureField wrapper class.
2710 * @see https://reference.opcfoundation.org/Core/Part3/v105/docs/8.51
2711 */
2712class StructureField : public TypeWrapper<UA_StructureField, UA_TYPES_STRUCTUREFIELD> {
2713public:
2714 using TypeWrapper::TypeWrapper;
2715
2717 UAPP_GETTER_WRAPPER(LocalizedText, getDescription, description)
2718 UAPP_GETTER_WRAPPER(NodeId, getDataType, dataType)
2719 UAPP_GETTER_CAST(ValueRank, getValueRank, valueRank)
2720 UAPP_GETTER_SPAN(uint32_t, getArrayDimensions, arrayDimensions, arrayDimensionsSize)
2721 UAPP_GETTER(uint32_t, getMaxStringLength, maxStringLength)
2722 UAPP_GETTER(bool, getIsOptional, isOptional)
2723};
2724
2725/**
2726 * UA_StructureDefinition wrapper class.
2727 * @see https://reference.opcfoundation.org/Core/Part3/v105/docs/8.48
2728 */
2730 : public TypeWrapper<UA_StructureDefinition, UA_TYPES_STRUCTUREDEFINITION> {
2731public:
2732 using TypeWrapper::TypeWrapper;
2733
2734 UAPP_GETTER_WRAPPER(NodeId, getDefaultEncodingId, defaultEncodingId)
2735 UAPP_GETTER_WRAPPER(NodeId, getBaseDataType, baseDataType)
2736 UAPP_GETTER_CAST(StructureType, getStructureType, structureType)
2737 UAPP_GETTER_SPAN_WRAPPER(StructureField, getFields, fields, fieldsSize)
2738};
2739
2740/**
2741 * UA_EnumField wrapper class.
2742 * @see https://reference.opcfoundation.org/Core/Part3/v105/docs/8.52
2743 */
2744class EnumField : public TypeWrapper<UA_EnumField, UA_TYPES_ENUMFIELD> {
2745public:
2746 using TypeWrapper::TypeWrapper;
2747
2748 EnumField(int64_t value, std::string_view name)
2749 : EnumField(value, {"", name}, {}, name) {}
2750
2752 int64_t value, LocalizedText displayName, LocalizedText description, std::string_view name
2753 ) {
2754 handle()->value = value;
2755 handle()->displayName = detail::toNative(std::move(displayName));
2756 handle()->description = detail::toNative(std::move(description));
2757 handle()->name = detail::toNative(name);
2758 }
2759
2760 UAPP_GETTER(int64_t, getValue, value)
2761 UAPP_GETTER_WRAPPER(LocalizedText, getDisplayName, displayName)
2762 UAPP_GETTER_WRAPPER(LocalizedText, getDescription, description)
2764};
2765
2766/**
2767 * UA_EnumDefinition wrapper class.
2768 * @see https://reference.opcfoundation.org/Core/Part3/v105/docs/8.50
2769 */
2770class EnumDefinition : public TypeWrapper<UA_EnumDefinition, UA_TYPES_ENUMDEFINITION> {
2771public:
2772 using TypeWrapper::TypeWrapper;
2773
2774 EnumDefinition(std::initializer_list<EnumField> fields)
2775 : EnumDefinition({fields.begin(), fields.size()}) {}
2776
2778 handle()->fieldsSize = fields.size();
2779 handle()->fields = detail::toNativeArray(fields);
2780 }
2781
2782 UAPP_GETTER_SPAN_WRAPPER(EnumField, getFields, fields, fieldsSize)
2783};
2784
2785#endif // UA_ENABLE_TYPEDESCRIPTION
2786
2787/**
2788 * @}
2789 */
2790
2791} // namespace ua
2792} // namespace opcua
Bitmask using (scoped) enums.
Definition bitmask.hpp:127
UA_ByteString wrapper class.
Definition types.hpp:553
High-level client class.
Definition client.hpp:126
UA_DataType wrapper class.
Definition datatype.hpp:108
UA_DataValue wrapper class.
Definition types.hpp:1849
UA_DateTime wrapper class.
Definition types.hpp:401
UA_DiagnosticInfo wrapper class.
Definition types.hpp:2327
UA_ExpandedNodeId wrapper class.
Definition types.hpp:913
UA_ExtensionObject wrapper class.
Definition types.hpp:2094
UA_LocalizedText wrapper class.
Definition types.hpp:1079
UA_NodeId wrapper class.
Definition types.hpp:665
UA_QualifiedName wrapper class.
Definition types.hpp:1028
High-level server class.
Definition server.hpp:136
View to a contiguous sequence of objects, similar to std::span in C++20.
Definition span.hpp:30
constexpr size_t size() const noexcept
Definition span.hpp:93
UA_StatusCode wrapper class.
Definition types.hpp:47
UA_String wrapper class.
Definition types.hpp:257
Template base class to wrap UA_* type objects that require manual memory management.
constexpr TypeWrapper() noexcept=default
UA_Variant wrapper class.
Definition types.hpp:1193
constexpr T * handle() noexcept
Return pointer to native object.
Definition wrapper.hpp:82
UA_AddNodesItem wrapper class.
Definition types.hpp:759
AddNodesItem(ExpandedNodeId parentNodeId, NodeId referenceTypeId, ExpandedNodeId requestedNewNodeId, QualifiedName browseName, NodeClass nodeClass, ExtensionObject nodeAttributes, ExpandedNodeId typeDefinition)
Definition types.hpp:763
UA_AddNodesRequest wrapper class.
Definition types.hpp:806
AddNodesRequest(RequestHeader requestHeader, Span< const AddNodesItem > nodesToAdd)
Definition types.hpp:810
UA_AddNodesResponse wrapper class.
Definition types.hpp:824
UA_AddNodesResult wrapper class.
Definition types.hpp:794
UA_AddReferencesItem wrapper class.
Definition types.hpp:839
AddReferencesItem(NodeId sourceNodeId, NodeId referenceTypeId, bool isForward, std::string_view targetServerUri, ExpandedNodeId targetNodeId, NodeClass targetNodeClass)
Definition types.hpp:843
UA_AddReferencesRequest wrapper class.
Definition types.hpp:872
AddReferencesRequest(RequestHeader requestHeader, Span< const AddReferencesItem > referencesToAdd)
Definition types.hpp:876
UA_AddReferencesResponse wrapper class.
Definition types.hpp:895
UA_AggregateFilter wrapper class.
Definition types.hpp:1986
AggregateFilter(DateTime startTime, NodeId aggregateType, double processingInterval, AggregateConfiguration aggregateConfiguration)
Definition types.hpp:1990
UA_AnonymousIdentityToken wrapper class.
Definition types.hpp:688
UA_ApplicationDescription wrapper class.
Definition types.hpp:167
ApplicationDescription(std::string_view applicationUri, std::string_view productUri, LocalizedText applicationName, ApplicationType applicationType, std::string_view gatewayServerUri, std::string_view discoveryProfileUri, Span< const String > discoveryUrls)
Definition types.hpp:171
UA_Argument wrapper class.
Definition types.hpp:1585
Argument(std::string_view name, LocalizedText description, NodeId dataType, ValueRank valueRank={}, Span< const uint32_t > arrayDimensions={})
Definition types.hpp:1589
UA_AttributeOperand wrapper class.
Definition types.hpp:1776
AttributeOperand(NodeId nodeId, std::string_view alias, RelativePath browsePath, AttributeId attributeId, std::string_view indexRange={})
Definition types.hpp:1780
UA_AxisInformation wrapper class.
Definition types.hpp:2647
AxisInformation(EUInformation engineeringUnits, Range eURange, LocalizedText title, AxisScaleEnumeration axisScaleType, Span< const double > axisSteps)
Definition types.hpp:2651
UA_BrowseDescription wrapper class.
Definition types.hpp:1091
BrowseDescription(NodeId nodeId, BrowseDirection browseDirection, NodeId referenceTypeId=ReferenceTypeId::References, bool includeSubtypes=true, Bitmask< NodeClass > nodeClassMask=NodeClass::Unspecified, Bitmask< BrowseResultMask > resultMask=BrowseResultMask::All)
Definition types.hpp:1095
UA_BrowseNextRequest wrapper class.
Definition types.hpp:1193
BrowseNextRequest(RequestHeader requestHeader, bool releaseContinuationPoints, Span< const ByteString > continuationPoints)
Definition types.hpp:1197
UA_BrowseNextResponse wrapper class.
Definition types.hpp:1218
UA_BrowsePathResult wrapper class.
Definition types.hpp:1300
UA_BrowsePathTarget wrapper class.
Definition types.hpp:1289
UA_BrowsePath wrapper class.
Definition types.hpp:1273
BrowsePath(NodeId startingNode, RelativePath relativePath)
Definition types.hpp:1277
UA_BrowseRequest wrapper class.
Definition types.hpp:1122
BrowseRequest(RequestHeader requestHeader, ViewDescription view, uint32_t requestedMaxReferencesPerNode, Span< const BrowseDescription > nodesToBrowse)
Definition types.hpp:1126
UA_BrowseResponse wrapper class.
Definition types.hpp:1179
UA_BrowseResult wrapper class.
Definition types.hpp:1167
UA_BuildInfo wrapper class.
Definition types.hpp:1549
BuildInfo(std::string_view productUri, std::string_view manufacturerName, std::string_view productName, std::string_view softwareVersion, std::string_view buildNumber, DateTime buildDate)
Definition types.hpp:1553
UA_CallMethodRequest wrapper class.
Definition types.hpp:1615
CallMethodRequest(NodeId objectId, NodeId methodId, Span< const Variant > inputArguments)
Definition types.hpp:1619
UA_CallMethodResult wrapper class.
Definition types.hpp:1635
UA_CallRequest wrapper class.
Definition types.hpp:1656
CallRequest(RequestHeader requestHeader, Span< const CallMethodRequest > methodsToCall)
Definition types.hpp:1660
UA_CallResponse wrapper class.
Definition types.hpp:1674
UA_ComplexNumberType wrapper class.
Definition types.hpp:2602
ComplexNumberType(float real, float imaginary) noexcept
Definition types.hpp:2606
UA_ContentFilterElement wrapper class.
Definition types.hpp:1859
ContentFilterElement(FilterOperator filterOperator, Span< const FilterOperand > operands)
UA_ContentFilter wrapper class.
Definition types.hpp:1880
ContentFilter(std::initializer_list< ContentFilterElement > elements)
ContentFilter(Span< const ContentFilterElement > elements)
UA_CreateMonitoredItemsRequest wrapper class.
Definition types.hpp:2084
CreateMonitoredItemsRequest(RequestHeader requestHeader, IntegerId subscriptionId, TimestampsToReturn timestampsToReturn, Span< const MonitoredItemCreateRequest > itemsToCreate)
Definition types.hpp:2088
UA_CreateMonitoredItemsResponse wrapper class.
Definition types.hpp:2114
UA_CreateSubscriptionRequest wrapper class.
Definition types.hpp:2348
CreateSubscriptionRequest(RequestHeader requestHeader, double requestedPublishingInterval, uint32_t requestedLifetimeCount, uint32_t requestedMaxKeepAliveCount, uint32_t maxNotificationsPerPublish, bool publishingEnabled, uint8_t priority)
Definition types.hpp:2352
UA_CreateSubscriptionResponse wrapper class.
Definition types.hpp:2384
UA_DataChangeFilter wrapper class.
Definition types.hpp:1945
DataChangeFilter(DataChangeTrigger trigger, DeadbandType deadbandType, double deadbandValue)
Definition types.hpp:1949
UA_DataTypeAttributes wrapper class.
Definition types.hpp:634
DataTypeAttributes()
Construct with default attribute definitions.
Definition types.hpp:639
UA_DeleteMonitoredItemsRequest wrapper class.
Definition types.hpp:2307
DeleteMonitoredItemsRequest(RequestHeader requestHeader, IntegerId subscriptionId, Span< const IntegerId > monitoredItemIds)
Definition types.hpp:2311
UA_DeleteMonitoredItemsResponse wrapper class.
Definition types.hpp:2332
UA_DeleteNodesItem wrapper class.
Definition types.hpp:910
DeleteNodesItem(NodeId nodeId, bool deleteTargetReferences)
Definition types.hpp:914
UA_DeleteNodesRequest wrapper class.
Definition types.hpp:927
DeleteNodesRequest(RequestHeader requestHeader, Span< const DeleteNodesItem > nodesToDelete)
Definition types.hpp:931
UA_DeleteNodesResponse wrapper class.
Definition types.hpp:946
UA_DeleteReferencesItem wrapper class.
Definition types.hpp:962
DeleteReferencesItem(NodeId sourceNodeId, NodeId referenceTypeId, bool isForward, ExpandedNodeId targetNodeId, bool deleteBidirectional)
Definition types.hpp:966
UA_DeleteReferencesRequest wrapper class.
Definition types.hpp:992
DeleteReferencesRequest(RequestHeader requestHeader, Span< const DeleteReferencesItem > referencesToDelete)
Definition types.hpp:996
UA_DeleteReferencesResponse wrapper class.
Definition types.hpp:1015
UA_DeleteSubscriptionsRequest wrapper class.
Definition types.hpp:2503
DeleteSubscriptionsRequest(RequestHeader requestHeader, Span< const IntegerId > subscriptionIds)
Definition types.hpp:2507
UA_DeleteSubscriptionsResponse wrapper class.
Definition types.hpp:2522
UA_DoubleComplexNumberType wrapper class.
Definition types.hpp:2620
DoubleComplexNumberType(double real, double imaginary) noexcept
Definition types.hpp:2624
UA_EUInformation wrapper class.
Definition types.hpp:2576
EUInformation(std::string_view namespaceUri, int32_t unitId, LocalizedText displayName, LocalizedText description)
Definition types.hpp:2580
UA_ElementOperand wrapper class.
Definition types.hpp:1737
ElementOperand(uint32_t index)
Definition types.hpp:1741
UA_EndpointDescription wrapper class.
Definition types.hpp:311
UA_EnumDefinition wrapper class.
Definition types.hpp:2770
EnumDefinition(std::initializer_list< EnumField > fields)
Definition types.hpp:2774
EnumDefinition(Span< const EnumField > fields)
Definition types.hpp:2777
UA_EnumField wrapper class.
Definition types.hpp:2744
EnumField(int64_t value, LocalizedText displayName, LocalizedText description, std::string_view name)
Definition types.hpp:2751
EnumField(int64_t value, std::string_view name)
Definition types.hpp:2748
UA_EnumValueType wrapper class.
Definition types.hpp:135
EnumValueType(int64_t value, LocalizedText displayName, LocalizedText description)
Definition types.hpp:139
const LocalizedText & description() const noexcept
Definition types.hpp:147
const LocalizedText & getDescription() const noexcept
Definition types.hpp:147
const LocalizedText & displayName() const noexcept
Definition types.hpp:146
const LocalizedText & getDisplayName() const noexcept
Definition types.hpp:146
int64_t value() const noexcept
Definition types.hpp:145
int64_t getValue() const noexcept
Definition types.hpp:145
UA_EventFilter wrapper class.
Definition types.hpp:1964
EventFilter(Span< const SimpleAttributeOperand > selectClauses, ContentFilter whereClause)
Definition types.hpp:1968
UA_IssuedIdentityToken wrapper class.
Definition types.hpp:741
IssuedIdentityToken(ByteString tokenData, std::string_view encryptionAlgorithm={})
Definition types.hpp:745
UA_LiteralOperand wrapper class.
Definition types.hpp:1752
LiteralOperand(T &&literal)
Definition types.hpp:1766
LiteralOperand(Variant value)
Definition types.hpp:1761
UA_MethodAttributes wrapper class.
Definition types.hpp:531
MethodAttributes()
Construct with default attribute definitions.
Definition types.hpp:536
UA_ModifyMonitoredItemsRequest wrapper class.
Definition types.hpp:2165
ModifyMonitoredItemsRequest(RequestHeader requestHeader, IntegerId subscriptionId, TimestampsToReturn timestampsToReturn, Span< const MonitoredItemModifyRequest > itemsToModify)
Definition types.hpp:2169
UA_CreateMonitoredItemsResponse wrapper class.
Definition types.hpp:2195
UA_ModifySubscriptionRequest wrapper class.
Definition types.hpp:2400
ModifySubscriptionRequest(RequestHeader requestHeader, IntegerId subscriptionId, double requestedPublishingInterval, uint32_t requestedLifetimeCount, uint32_t requestedMaxKeepAliveCount, uint32_t maxNotificationsPerPublish, uint8_t priority)
Definition types.hpp:2404
UA_ModifySubscriptionResponse wrapper class.
Definition types.hpp:2436
UA_MonitoredItemCreateRequest wrapper class.
Definition types.hpp:2044
MonitoredItemCreateRequest(ReadValueId itemToMonitor, MonitoringMode monitoringMode=MonitoringMode::Reporting, MonitoringParameters requestedParameters={})
Definition types.hpp:2048
UA_MonitoredItemCreateResult wrapper class.
Definition types.hpp:2068
UA_MonitoredItemModifyRequest wrapper class.
Definition types.hpp:2130
MonitoredItemModifyRequest(IntegerId monitoredItemId, MonitoringParameters requestedParameters)
Definition types.hpp:2134
UA_MonitoredItemModifyResult wrapper class.
Definition types.hpp:2150
UA_MonitoringParameters wrapper class.
Definition types.hpp:2013
MonitoringParameters(double samplingInterval=250.0, ExtensionObject filter={}, uint32_t queueSize=1U, bool discardOldest=true)
Construct with default values from open62541.
Definition types.hpp:2021
UA_NodeAttributes wrapper class.
Definition types.hpp:440
UA_ObjectAttributes wrapper class.
Definition types.hpp:451
ObjectAttributes()
Construct with default attribute definitions.
Definition types.hpp:456
UA_ObjectTypeAttributes wrapper class.
Definition types.hpp:549
ObjectTypeAttributes()
Construct with default attribute definitions.
Definition types.hpp:554
UA_Range wrapper class.
Definition types.hpp:2559
Range(double low, double high) noexcept
Definition types.hpp:2563
UA_ReadRequest wrapper class.
Definition types.hpp:1451
ReadRequest(RequestHeader requestHeader, double maxAge, TimestampsToReturn timestampsToReturn, Span< const ReadValueId > nodesToRead)
Definition types.hpp:1455
UA_ReadResponse wrapper class.
Definition types.hpp:1478
UA_ReadValueId wrapper class.
Definition types.hpp:1425
ReadValueId(NodeId nodeId, AttributeId attributeId, std::string_view indexRange={}, QualifiedName dataEncoding={})
Definition types.hpp:1429
UA_ReferenceDescription wrapper class.
Definition types.hpp:1150
UA_ReferenceTypeAttributes wrapper class.
Definition types.hpp:614
ReferenceTypeAttributes()
Construct with default attribute definitions.
Definition types.hpp:619
UA_RegisterNodesRequest wrapper class.
Definition types.hpp:1351
RegisterNodesRequest(RequestHeader requestHeader, Span< const NodeId > nodesToRegister)
Definition types.hpp:1355
UA_RegisterNodesResponse wrapper class.
Definition types.hpp:1369
UA_RelativePathElement wrapper class.
Definition types.hpp:1233
RelativePathElement(NodeId referenceTypeId, bool isInverse, bool includeSubtypes, QualifiedName targetName)
Definition types.hpp:1237
UA_RelativePath wrapper class.
Definition types.hpp:1255
RelativePath(Span< const RelativePathElement > elements)
Definition types.hpp:1262
RelativePath(std::initializer_list< RelativePathElement > elements)
Definition types.hpp:1259
UA_RequestHeader wrapper class.
Definition types.hpp:203
RequestHeader(NodeId authenticationToken, DateTime timestamp, IntegerId requestHandle, uint32_t returnDiagnostics, std::string_view auditEntryId, uint32_t timeoutHint, ExtensionObject additionalHeader)
Definition types.hpp:207
UA_ResponseHeader wrapper class.
Definition types.hpp:238
UA_SetMonitoringModeRequest wrapper class.
Definition types.hpp:2211
SetMonitoringModeRequest(RequestHeader requestHeader, IntegerId subscriptionId, MonitoringMode monitoringMode, Span< const IntegerId > monitoredItemIds)
Definition types.hpp:2215
UA_SetMonitoringModeResponse wrapper class.
Definition types.hpp:2239
UA_SetPublishingModeRequest wrapper class.
Definition types.hpp:2451
SetPublishingModeRequest(RequestHeader requestHeader, bool publishingEnabled, Span< const IntegerId > subscriptionIds)
Definition types.hpp:2455
UA_SetPublishingModeResponse wrapper class.
Definition types.hpp:2474
UA_SetTriggeringRequest wrapper class.
Definition types.hpp:2255
SetTriggeringRequest(RequestHeader requestHeader, IntegerId subscriptionId, IntegerId triggeringItemId, Span< const IntegerId > linksToAdd, Span< const IntegerId > linksToRemove)
Definition types.hpp:2259
UA_SetTriggeringResponse wrapper class.
Definition types.hpp:2287
UA_SimpleAttributeOperand wrapper class.
Definition types.hpp:1806
SimpleAttributeOperand(NodeId typeDefinitionId, Span< const QualifiedName > browsePath, AttributeId attributeId, std::string_view indexRange={})
Definition types.hpp:1810
UA_StatusChangeNotification wrapper class.
Definition types.hpp:2490
UA_StructureDefinition wrapper class.
Definition types.hpp:2730
UA_StructureField wrapper class.
Definition types.hpp:2712
UA_TranslateBrowsePathsToNodeIdsRequest wrapper class.
Definition types.hpp:1314
TranslateBrowsePathsToNodeIdsRequest(RequestHeader requestHeader, Span< const BrowsePath > browsePaths)
Definition types.hpp:1318
UA_TranslateBrowsePathsToNodeIdsResponse wrapper class.
Definition types.hpp:1336
UA_UnregisterNodesRequest wrapper class.
Definition types.hpp:1381
UnregisterNodesRequest(RequestHeader requestHeader, Span< const NodeId > nodesToUnregister)
Definition types.hpp:1385
UA_UnregisterNodesResponse wrapper class.
Definition types.hpp:1399
UA_UserIdentityToken wrapper class.
Definition types.hpp:676
UA_UserNameIdentityToken wrapper class.
Definition types.hpp:700
UserNameIdentityToken(std::string_view userName, std::string_view password, std::string_view encryptionAlgorithm={})
Definition types.hpp:704
UA_UserTokenPolicy wrapper class.
Definition types.hpp:281
UserTokenPolicy(std::string_view policyId, UserTokenType tokenType, std::string_view issuedTokenType, std::string_view issuerEndpointUrl, std::string_view securityPolicyUri)
Definition types.hpp:285
UA_VariableAttributes wrapper class.
Definition types.hpp:469
auto & setValueArray(Args &&... args)
Definition types.hpp:488
auto & setDataType()
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition types.hpp:497
auto & setValueScalar(Args &&... args)
Definition types.hpp:482
VariableAttributes()
Construct with default attribute definitions.
Definition types.hpp:474
UA_VariableAttributes wrapper class.
Definition types.hpp:566
VariableTypeAttributes()
Construct with default attribute definitions.
Definition types.hpp:571
auto & setValueArray(Args &&... args)
Definition types.hpp:585
auto & setDataType()
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition types.hpp:594
auto & setValueScalar(Args &&... args)
Definition types.hpp:579
UA_ViewAttributes wrapper class.
Definition types.hpp:650
ViewAttributes()
Construct with default attribute definitions.
Definition types.hpp:655
UA_ViewDescription wrapper class.
Definition types.hpp:1029
ViewDescription(NodeId viewId, DateTime timestamp, uint32_t viewVersion)
Definition types.hpp:1033
UA_WriteRequest wrapper class.
Definition types.hpp:1516
WriteRequest(RequestHeader requestHeader, Span< const WriteValue > nodesToWrite)
Definition types.hpp:1520
UA_WriteResponse wrapper class.
Definition types.hpp:1534
UA_WriteValue wrapper class.
Definition types.hpp:1493
WriteValue(NodeId nodeId, AttributeId attributeId, std::string_view indexRange, DataValue value)
Definition types.hpp:1497
UA_X509IdentityToken wrapper class.
Definition types.hpp:724
X509IdentityToken(ByteString certificateData)
Definition types.hpp:728
UA_XVType wrapper class.
Definition types.hpp:2677
XVType(double x, float value) noexcept
Definition types.hpp:2681
UA_EXPORT const UA_ObjectTypeAttributes UA_ObjectTypeAttributes_default
UA_EXPORT const UA_VariableAttributes UA_VariableAttributes_default
UA_EXPORT const UA_DataTypeAttributes UA_DataTypeAttributes_default
UA_EXPORT const UA_ViewAttributes UA_ViewAttributes_default
UA_EXPORT const UA_VariableTypeAttributes UA_VariableTypeAttributes_default
UA_EXPORT const UA_MethodAttributes UA_MethodAttributes_default
UA_EXPORT const UA_ReferenceTypeAttributes UA_ReferenceTypeAttributes_default
UA_EXPORT const UA_ObjectAttributes UA_ObjectAttributes_default
constexpr std::false_type isBitmaskEnum(T)
Function template to define an enum (class) as a bitmask and allow bitwise operations.
ReferenceTypeId
ReferenceType node ids defined by the OPC UA specification (generated).
Definition nodeids.hpp:457
BrowseResultMask
Browse result mask.
Definition types.hpp:1070
DeadbandType
Deadband type.
Definition types.hpp:1933
#define UAPP_NODEATTR_WRAPPER(Type, suffix, member, flag)
Definition types.hpp:402
ContentFilter operator!(const ContentFilterElement &filterElement)
std::variant< ElementOperand, LiteralOperand, AttributeOperand, SimpleAttributeOperand, ExtensionObject > FilterOperand
Filter operand.
Definition types.hpp:1846
ContentFilter operator||(const ContentFilter &lhs, const ContentFilterElement &rhs)
UserTokenType
User identity token type.
Definition types.hpp:268
PerformUpdateType
Perform update type for structured data history updates.
Definition types.hpp:2542
DataChangeTrigger
Data change trigger.
Definition types.hpp:1921
ContentFilter operator!(const ContentFilter &filter)
StructureType
Structure type.
Definition types.hpp:2700
AxisScaleEnumeration
Axis scale.
Definition types.hpp:2637
ContentFilter operator&&(const ContentFilterElement &lhs, const ContentFilterElement &rhs)
ApplicationType
Application type.
Definition types.hpp:155
MonitoringMode
Monitoring mode.
Definition types.hpp:1696
ContentFilter operator||(const ContentFilterElement &lhs, const ContentFilter &rhs)
#define UAPP_NODEATTR_BITMASK(Type, suffix, member, flag)
Definition types.hpp:388
MessageSecurityMode
Message security mode.
Definition types.hpp:255
BrowseDirection
Browse direction.
Definition types.hpp:1050
ContentFilter operator||(const ContentFilter &lhs, const ContentFilter &rhs)
ContentFilter operator&&(const ContentFilter &lhs, const ContentFilterElement &rhs)
TimestampsToReturn
Timestamps to return.
Definition types.hpp:1411
ContentFilter operator&&(const ContentFilterElement &lhs, const ContentFilter &rhs)
NodeAttributesMask
Node attributes mask.
Definition types.hpp:334
ContentFilter operator||(const ContentFilterElement &lhs, const ContentFilterElement &rhs)
#define UAPP_NODEATTR_ARRAY(Type, suffix, member, memberSize, flag)
Definition types.hpp:409
FilterOperator
Filter operator.
Definition types.hpp:1708
#define UAPP_NODEATTR_CAST(Type, suffix, member, flag)
Definition types.hpp:395
#define UAPP_NODEATTR(Type, suffix, member, flag)
Definition types.hpp:381
ContentFilter operator&&(const ContentFilter &lhs, const ContentFilter &rhs)
#define UAPP_NODEATTR_COMMON
Definition types.hpp:419
static UA_LogCategory const char va_list args
uint32_t IntegerId
IntegerId.
Definition types.hpp:124
NodeClass
Node class.
Definition common.hpp:71
AccessLevel
Access level.
Definition common.hpp:94
EventNotifier
Event notifier.
Definition common.hpp:174
ValueRank
Value rank.
Definition common.hpp:157
WriteMask
Write mask.
Definition common.hpp:116
AttributeId
Attribute identifiers.
Definition common.hpp:28
If a reference is symmetric
Definition symmetric.dox:1
uint8_t UA_Byte
UA_BrowseDirection
UA_DataChangeTrigger
UA_UserTokenType
UA_BROWSERESULTMASK_REFERENCETYPEID
UA_BROWSERESULTMASK_DISPLAYNAME
UA_BROWSERESULTMASK_ALL
UA_BROWSERESULTMASK_ISFORWARD
UA_BROWSERESULTMASK_REFERENCETYPEINFO
UA_BROWSERESULTMASK_TYPEDEFINITION
UA_BROWSERESULTMASK_BROWSENAME
UA_BROWSERESULTMASK_TARGETINFO
UA_BROWSERESULTMASK_NODECLASS
UA_BROWSERESULTMASK_NONE
UA_ApplicationType
UA_AxisScaleEnumeration
UA_TimestampsToReturn
UA_MonitoringMode
UA_NodeClass
UA_EXPORT const UA_ObjectTypeAttributes UA_ObjectTypeAttributes_default
#define UAPP_GETTER_SPAN(Type, getterName, memberArray, memberSize)
Definition types.hpp:81
UA_EXPORT const UA_VariableAttributes UA_VariableAttributes_default
UA_EXPORT const UA_DataTypeAttributes UA_DataTypeAttributes_default
UA_EXPORT const UA_ViewAttributes UA_ViewAttributes_default
#define UAPP_GETTER_WRAPPER(Type, getterName, member)
Definition types.hpp:77
#define UAPP_GETTER_CAST(Type, getterName, member)
Definition types.hpp:49
#define UAPP_GETTER_SPAN_WRAPPER(Type, getterName, memberArray, memberSize)
Definition types.hpp:99
#define UAPP_GETTER(Type, getterName, member)
Definition types.hpp:39
UA_EXPORT const UA_VariableTypeAttributes UA_VariableTypeAttributes_default
UA_EXPORT const UA_MethodAttributes UA_MethodAttributes_default
UA_EXPORT const UA_ReferenceTypeAttributes UA_ReferenceTypeAttributes_default
UA_EXPORT const UA_ObjectAttributes UA_ObjectAttributes_default
UA_StatusCode status