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