open62541pp 0.19.0
C++ wrapper of open62541
Loading...
Searching...
No Matches
node.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <string_view>
5#include <utility> // move
6#include <vector>
7
10#include "open62541pp/config.hpp"
14#include "open62541pp/span.hpp"
15#include "open62541pp/typeregistry.hpp" // getDataType
16#include "open62541pp/types.hpp"
19#include "open62541pp/wrapper.hpp" // asWrapper
20
26
27namespace opcua {
28
29/**
30 * High-level node class to access node attribute, browse and populate address space.
31 *
32 * The Node API is just a more convenient way of using the free functions in the opcua::services
33 * namespace.
34 *
35 * Node objects are useful as-is but they do not expose the entire OPC UA protocol. You can get
36 * access to the associated NodeId instance with the Node::id() method and apply the native
37 * open62541 functions or the free functions in the opcua::services namespace.
38 *
39 * @note The async functions are available for Client only.
40 *
41 * @tparam Connection Server or Client
42 * @see Services
43 */
44template <typename Connection>
45class Node {
46public:
47 /// Create a Node object.
48 Node(Connection& connection, const NodeId& id)
49 : connection_{&connection},
50 id_{id} {}
51
52 /// Create a Node object.
53 Node(Connection& connection, NodeId&& id)
54 : connection_{&connection},
55 id_{std::move(id)} {}
56
57 /// Get the server/client instance.
58 Connection& connection() noexcept {
59 return *connection_;
60 }
61
62 /// Get the server/client instance.
63 const Connection& connection() const noexcept {
64 return *connection_;
65 }
66
67 /// Get the node id.
68 const NodeId& id() const noexcept {
69 return id_;
70 }
71
72 /// Check if the Node exists in the most efficient manner.
73 /// If the instance is of type `Node<Server>`, the internal node store is searched.
74 /// If the instance is of type `Node<Client>`, an actual read request to the server is made.
75 bool exists() noexcept;
76
77 /// @name NodeManagement
78 /// @{
79
80 /// @wrapper{services::addFolder}
82 const NodeId& id,
83 std::string_view browseName,
84 const ObjectAttributes& attributes = {},
85 const NodeId& referenceType = ReferenceTypeId::HasComponent
86 ) {
87 return fromId(
88 connection(),
89 services::addFolder(connection(), this->id(), id, browseName, attributes, referenceType)
90 );
91 }
92
93 /// @wrapper{services::addFolder}
94 /// @param token @completiontoken{void(Result<Node>&)}
95 /// @return @asyncresult{Result<Node>}
96 template <typename CompletionToken = DefaultCompletionToken>
98 const NodeId& id,
99 std::string_view browseName,
100 const ObjectAttributes& attributes = {},
101 const NodeId& referenceType = ReferenceTypeId::HasComponent,
102 CompletionToken&& token = DefaultCompletionToken{}
103 ) {
105 connection(),
106 this->id(),
107 id,
108 browseName,
109 attributes,
110 referenceType,
111 fromIdAsync(connection(), std::forward<CompletionToken>(token))
112 );
113 }
114
115 /// @wrapper{services::addObject}
117 const NodeId& id,
118 std::string_view browseName,
119 const ObjectAttributes& attributes = {},
120 const NodeId& objectType = ObjectTypeId::BaseObjectType,
121 const NodeId& referenceType = ReferenceTypeId::HasComponent
122 ) {
123 return fromId(
124 connection(),
126 connection(), this->id(), id, browseName, attributes, objectType, referenceType
127 )
128 );
129 }
130
131 /// @wrapper{services::addObjectAsync}
132 /// @param token @completiontoken{void(Result<Node>&)}
133 /// @return @asyncresult{Result<Node>}
134 template <typename CompletionToken = DefaultCompletionToken>
136 const NodeId& id,
137 std::string_view browseName,
138 const ObjectAttributes& attributes = {},
139 const NodeId& objectType = ObjectTypeId::BaseObjectType,
140 const NodeId& referenceType = ReferenceTypeId::HasComponent,
141 CompletionToken&& token = DefaultCompletionToken{}
142 ) {
144 connection(),
145 this->id(),
146 id,
147 browseName,
148 attributes,
149 objectType,
150 referenceType,
151 fromIdAsync(connection(), std::forward<CompletionToken>(token))
152 );
153 }
154
155 /// @wrapper{services::addVariable}
157 const NodeId& id,
158 std::string_view browseName,
159 const VariableAttributes& attributes = {},
160 const NodeId& variableType = VariableTypeId::BaseDataVariableType,
161 const NodeId& referenceType = ReferenceTypeId::HasComponent
162 ) {
163 return fromId(
164 connection(),
166 connection(), this->id(), id, browseName, attributes, variableType, referenceType
167 )
168 );
169 }
170
171 /// @wrapper{services::addVariableAsync}
172 /// @param token @completiontoken{void(Result<Node>&)}
173 /// @return @asyncresult{Result<Node>}
174 template <typename CompletionToken = DefaultCompletionToken>
176 const NodeId& id,
177 std::string_view browseName,
178 const VariableAttributes& attributes = {},
179 const NodeId& variableType = VariableTypeId::BaseDataVariableType,
180 const NodeId& referenceType = ReferenceTypeId::HasComponent,
181 CompletionToken&& token = DefaultCompletionToken{}
182 ) {
184 connection(),
185 this->id(),
186 id,
187 browseName,
188 attributes,
189 variableType,
190 referenceType,
191 fromIdAsync(connection(), std::forward<CompletionToken>(token))
192 );
193 }
194
195 /// @wrapper{services::addProperty}
197 const NodeId& id, std::string_view browseName, const VariableAttributes& attributes = {}
198 ) {
199 return fromId(
200 connection(),
201 services::addProperty(connection(), this->id(), id, browseName, attributes)
202 );
203 }
204
205 /// @wrapper{services::addPropertyAsync}
206 /// @param token @completiontoken{void(Result<Node>&)}
207 /// @return @asyncresult{Result<Node>}
208 template <typename CompletionToken = DefaultCompletionToken>
210 const NodeId& id,
211 std::string_view browseName,
212 const VariableAttributes& attributes = {},
213 CompletionToken&& token = DefaultCompletionToken{}
214 ) {
216 connection(),
217 this->id(),
218 id,
219 browseName,
220 attributes,
221 fromIdAsync(connection(), std::forward<CompletionToken>(token))
222 );
223 }
224
225#ifdef UA_ENABLE_METHODCALLS
226 /// @wrapper{services::addMethod}
228 const NodeId& id,
229 std::string_view browseName,
231 Span<const Argument> inputArguments,
232 Span<const Argument> outputArguments,
233 const MethodAttributes& attributes = {},
234 const NodeId& referenceType = ReferenceTypeId::HasComponent
235 ) {
236 return fromId(
237 connection(),
239 connection(),
240 this->id(),
241 id,
242 browseName,
243 std::move(callback),
244 inputArguments,
245 outputArguments,
246 attributes,
247 referenceType
248 )
249 );
250 }
251
252 /// @wrapper{services::addMethodAsync}
253 /// @param token @completiontoken{void(Result<Node>&)}
254 /// @return @asyncresult{Result<Node>}
255 template <typename CompletionToken = DefaultCompletionToken>
257 const NodeId& id,
258 std::string_view browseName,
260 Span<const Argument> inputArguments,
261 Span<const Argument> outputArguments,
262 const MethodAttributes& attributes = {},
263 const NodeId& referenceType = ReferenceTypeId::HasComponent,
264 CompletionToken&& token = DefaultCompletionToken{}
265 ) {
267 connection(),
268 this->id(),
269 id,
270 browseName,
271 std::move(callback),
272 inputArguments,
273 outputArguments,
274 attributes,
275 referenceType,
276 fromIdAsync(connection(), std::forward<CompletionToken>(token))
277 );
278 }
279#endif
280
281 /// @wrapper{services::addObjectType}
283 const NodeId& id,
284 std::string_view browseName,
285 const ObjectTypeAttributes& attributes = {},
286 const NodeId& referenceType = ReferenceTypeId::HasSubtype
287 ) {
288 return fromId(
289 connection(),
291 connection(), this->id(), id, browseName, attributes, referenceType
292 )
293 );
294 }
295
296 /// @wrapper{services::addObjectTypeAsync}
297 /// @param token @completiontoken{void(Result<Node>&)}
298 /// @return @asyncresult{Result<Node>}
299 template <typename CompletionToken = DefaultCompletionToken>
301 const NodeId& id,
302 std::string_view browseName,
303 const ObjectTypeAttributes& attributes = {},
304 const NodeId& referenceType = ReferenceTypeId::HasSubtype,
305 CompletionToken&& token = DefaultCompletionToken{}
306 ) {
308 connection(),
309 this->id(),
310 id,
311 browseName,
312 attributes,
313 referenceType,
314 fromIdAsync(connection(), std::forward<CompletionToken>(token))
315 );
316 }
317
318 /// @wrapper{services::addVariableType}
320 const NodeId& id,
321 std::string_view browseName,
322 const VariableTypeAttributes& attributes = {},
323 const NodeId& variableType = VariableTypeId::BaseDataVariableType,
324 const NodeId& referenceType = ReferenceTypeId::HasSubtype
325 ) {
326 return fromId(
327 connection(),
329 connection(), this->id(), id, browseName, attributes, variableType, referenceType
330 )
331 );
332 }
333
334 /// @wrapper{services::addVariableTypeAsync}
335 /// @param token @completiontoken{void(Result<Node>&)}
336 /// @return @asyncresult{Result<Node>}
337 template <typename CompletionToken = DefaultCompletionToken>
339 const NodeId& id,
340 std::string_view browseName,
341 const VariableTypeAttributes& attributes = {},
342 const NodeId& variableType = VariableTypeId::BaseDataVariableType,
343 const NodeId& referenceType = ReferenceTypeId::HasSubtype,
344 CompletionToken&& token = DefaultCompletionToken{}
345 ) {
347 connection(),
348 this->id(),
349 id,
350 browseName,
351 attributes,
352 variableType,
353 referenceType,
354 fromIdAsync(connection(), std::forward<CompletionToken>(token))
355 );
356 }
357
358 /// @wrapper{services::addReferenceType}
360 const NodeId& id,
361 std::string_view browseName,
362 const ReferenceTypeAttributes& attributes = {},
363 const NodeId& referenceType = ReferenceTypeId::HasSubtype
364 ) {
365 return fromId(
366 connection(),
368 connection(), this->id(), id, browseName, attributes, referenceType
369 )
370 );
371 }
372
373 /// @wrapper{services::addReferenceTypeAsync}
374 /// @param token @completiontoken{void(Result<Node>&)}
375 /// @return @asyncresult{Result<Node>}
376 template <typename CompletionToken = DefaultCompletionToken>
378 const NodeId& id,
379 std::string_view browseName,
380 const ReferenceTypeAttributes& attributes = {},
381 const NodeId& referenceType = ReferenceTypeId::HasSubtype,
382 CompletionToken&& token = DefaultCompletionToken{}
383 ) {
385 connection(),
386 this->id(),
387 id,
388 browseName,
389 attributes,
390 referenceType,
391 fromIdAsync(connection(), std::forward<CompletionToken>(token))
392 );
393 }
394
395 /// @wrapper{services::addDataType}
397 const NodeId& id,
398 std::string_view browseName,
399 const DataTypeAttributes& attributes = {},
400 const NodeId& referenceType = ReferenceTypeId::HasSubtype
401 ) {
402 return fromId(
403 connection(),
405 connection(), this->id(), id, browseName, attributes, referenceType
406 )
407 );
408 }
409
410 /// @wrapper{services::addDataTypeAsync}
411 /// @param token @completiontoken{void(Result<Node>&)}
412 /// @return @asyncresult{Result<Node>}
413 template <typename CompletionToken = DefaultCompletionToken>
415 const NodeId& id,
416 std::string_view browseName,
417 const DataTypeAttributes& attributes = {},
418 const NodeId& referenceType = ReferenceTypeId::HasSubtype,
419 CompletionToken&& token = DefaultCompletionToken{}
420 ) {
422 connection(),
423 this->id(),
424 id,
425 browseName,
426 attributes,
427 referenceType,
428 fromIdAsync(connection(), std::forward<CompletionToken>(token))
429 );
430 }
431
432 /// @wrapper{services::addView}
434 const NodeId& id,
435 std::string_view browseName,
436 const ViewAttributes& attributes = {},
437 const NodeId& referenceType = ReferenceTypeId::Organizes
438 ) {
439 return fromId(
440 connection(),
441 services::addView(connection(), this->id(), id, browseName, attributes, referenceType)
442 );
443 }
444
445 /// @wrapper{services::addViewAsync}
446 /// @param token @completiontoken{void(Result<Node>&)}
447 /// @return @asyncresult{Result<Node>}
448 template <typename CompletionToken = DefaultCompletionToken>
450 const NodeId& id,
451 std::string_view browseName,
452 const ViewAttributes& attributes = {},
453 const NodeId& referenceType = ReferenceTypeId::Organizes,
454 CompletionToken&& token = DefaultCompletionToken{}
455 ) {
457 connection(),
458 this->id(),
459 id,
460 browseName,
461 attributes,
462 referenceType,
463 fromIdAsync(connection(), std::forward<CompletionToken>(token))
464 );
465 }
466
467 /// @wrapper{services::addReference}
468 Node& addReference(const NodeId& targetId, const NodeId& referenceType, bool forward = true) {
469 services::addReference(connection(), id(), targetId, referenceType, forward).throwIfBad();
470 return *this;
471 }
472
473 /// @wrapper{services::addReferenceAsync}
474 /// @param token @completiontoken{void(StatusCode)}
475 /// @return @asyncresult{StatusCode}
476 template <typename CompletionToken = DefaultCompletionToken>
478 const NodeId& targetId,
479 const NodeId& referenceType,
480 bool forward = true,
481 CompletionToken&& token = DefaultCompletionToken{}
482 ) {
484 connection(),
485 id(),
486 targetId,
487 referenceType,
488 forward,
489 std::forward<CompletionToken>(token)
490 );
491 }
492
493 /// @wrapper{services::addModellingRule}
496 return *this;
497 }
498
499 /// @wrapper{services::addModellingRuleAsync}
500 /// @param token @completiontoken{void(StatusCode)}
501 /// @return @asyncresult{StatusCode}
502 template <typename CompletionToken = DefaultCompletionToken>
504 ModellingRule rule, CompletionToken&& token = DefaultCompletionToken{}
505 ) {
507 connection(), id(), rule, std::forward<CompletionToken>(token)
508 );
509 }
510
511 /// @wrapper{services::deleteNode}
512 void deleteNode(bool deleteReferences = true) {
513 services::deleteNode(connection(), id(), deleteReferences).throwIfBad();
514 }
515
516 /// @wrapper{services::deleteNodeAsync}
517 /// @param token @completiontoken{void(StatusCode)}
518 /// @return @asyncresult{StatusCode}
519 template <typename CompletionToken = DefaultCompletionToken>
521 bool deleteReferences = true, CompletionToken&& token = DefaultCompletionToken{}
522 ) {
524 connection(), id(), deleteReferences, std::forward<CompletionToken>(token)
525 );
526 }
527
528 /// @wrapper{services::deleteReference}
530 const NodeId& targetId,
531 const NodeId& referenceType,
532 bool isForward = true,
533 bool deleteBidirectional = true
534 ) {
536 connection(), id(), targetId, referenceType, isForward, deleteBidirectional
537 )
538 .throwIfBad();
539 return *this;
540 }
541
542 /// @wrapper{services::deleteReferenceAsync}
543 /// @param token @completiontoken{void(StatusCode)}
544 /// @return @asyncresult{StatusCode}
545 template <typename CompletionToken = DefaultCompletionToken>
547 const NodeId& targetId,
548 const NodeId& referenceType,
549 bool isForward = true,
550 bool deleteBidirectional = true,
551 CompletionToken&& token = DefaultCompletionToken{}
552 ) {
554 connection(),
555 id(),
556 targetId,
557 referenceType,
558 isForward,
559 deleteBidirectional,
560 std::forward<CompletionToken>(token)
561 );
562 }
563
564 /// @}
565 /// @name View
566 /// @{
567
568 /// Browse references.
569 std::vector<ReferenceDescription> browseReferences(
570 BrowseDirection browseDirection = BrowseDirection::Both,
571 const NodeId& referenceType = ReferenceTypeId::References,
572 bool includeSubtypes = true,
574 ) {
575 const BrowseDescription bd(
576 id(),
577 browseDirection,
578 referenceType,
579 includeSubtypes,
580 nodeClassMask,
581 BrowseResultMask::All
582 );
583 return services::browseAll(connection(), bd).value();
584 }
585
586 /// Browse referenced nodes (only local nodes).
587 std::vector<Node> browseReferencedNodes(
588 BrowseDirection browseDirection = BrowseDirection::Both,
589 const NodeId& referenceType = ReferenceTypeId::References,
590 bool includeSubtypes = true,
592 ) {
593 const BrowseDescription bd(
594 id(),
595 browseDirection,
596 referenceType,
597 includeSubtypes,
598 nodeClassMask,
599 BrowseResultMask::TargetInfo // only node id required here
600 );
601 auto refs = services::browseAll(connection(), bd).value();
602 std::vector<Node> nodes;
603 nodes.reserve(refs.size());
604 for (auto&& ref : refs) {
605 if (ref.nodeId().isLocal()) {
606 nodes.emplace_back(connection(), std::move(ref.nodeId().nodeId()));
607 }
608 }
609 return nodes;
610 }
611
612 /// Browse child nodes (only local nodes).
613 std::vector<Node> browseChildren(
614 const NodeId& referenceType = ReferenceTypeId::HierarchicalReferences,
616 ) {
617 return browseReferencedNodes(BrowseDirection::Forward, referenceType, true, nodeClassMask);
618 }
619
620 /// Browse child node specified by its relative path from this node (only local nodes).
621 /// The relative path is specified using browse names.
622 /// @exception BadStatus (BadNoMatch) If path not found
624 auto result = services::browseSimplifiedBrowsePath(connection(), id(), path);
625 result.statusCode().throwIfBad();
626 for (auto&& target : result.targets()) {
627 if (target.targetId().isLocal()) {
628 return {connection(), std::move(target.targetId().nodeId())};
629 }
630 }
632 }
633
634 /// Browse parent node.
635 /// A Node may have several parents, the first found is returned.
636 /// @exception BadStatus (BadNotFound) If no parent node found
638 const BrowseDescription bd(
639 id(),
640 BrowseDirection::Inverse,
641 ReferenceTypeId::HierarchicalReferences,
642 true,
644 BrowseResultMask::TargetInfo
645 );
646 auto result = services::browse(connection(), bd, 1);
647 result.statusCode().throwIfBad();
648 if (result.references().empty()) {
650 }
651 return fromId(connection(), result.references().front().nodeId());
652 }
653
654#ifdef UA_ENABLE_METHODCALLS
655 /// @}
656 /// @name Method
657 /// @{
658
659 /// @wrapper{services::call}
660 CallMethodResult callMethod(const NodeId& methodId, Span<const Variant> inputArguments) {
661 return services::call(connection(), id(), methodId, inputArguments);
662 }
663
664 /// @wrapper{services::callAsync}
665 template <typename CompletionToken = DefaultCompletionToken>
667 const NodeId& methodId,
668 Span<const Variant> inputArguments,
669 CompletionToken&& token = DefaultCompletionToken{}
670 ) {
671 return services::callAsync(
672 connection(), id(), methodId, inputArguments, std::forward<CompletionToken>(token)
673 );
674 }
675#endif
676
677 /// @}
678 /// @name Attribute
679 /// @{
680
681 /// @wrapper{services::readNodeClass}
683 return services::readNodeClass(connection(), id()).value();
684 }
685
686 /// @wrapper{services::readNodeClassAsync}
687 template <typename CompletionToken = DefaultCompletionToken>
688 auto readNodeClassAsync(CompletionToken&& token = DefaultCompletionToken{}) {
690 connection(), id(), std::forward<CompletionToken>(token)
691 );
692 }
693
694 /// @wrapper{services::readBrowseName}
696 return services::readBrowseName(connection(), id()).value();
697 }
698
699 /// @wrapper{services::readBrowseNameAsync}
700 template <typename CompletionToken = DefaultCompletionToken>
701 auto readBrowseNameAsync(CompletionToken&& token = DefaultCompletionToken{}) {
703 connection(), id(), std::forward<CompletionToken>(token)
704 );
705 }
706
707 /// @wrapper{services::readDisplayName}
711
712 /// @wrapper{services::readDisplayNameAsync}
713 template <typename CompletionToken = DefaultCompletionToken>
714 auto readDisplayNameAsync(CompletionToken&& token = DefaultCompletionToken{}) {
716 connection(), id(), std::forward<CompletionToken>(token)
717 );
718 }
719
720 /// @wrapper{services::readDescription}
724
725 /// @wrapper{services::readDescriptionAsync}
726 template <typename CompletionToken = DefaultCompletionToken>
727 auto readDescriptionAsync(CompletionToken&& token = DefaultCompletionToken{}) {
729 connection(), id(), std::forward<CompletionToken>(token)
730 );
731 }
732
733 /// @wrapper{services::readWriteMask}
737
738 /// @wrapper{services::readWriteMaskAsync}
739 template <typename CompletionToken = DefaultCompletionToken>
740 auto readWriteMaskAsync(CompletionToken&& token = DefaultCompletionToken{}) {
742 connection(), id(), std::forward<CompletionToken>(token)
743 );
744 }
745
746 /// @wrapper{services::readUserWriteMask}
750
751 /// @wrapper{services::readUserWriteMaskAsync}
752 template <typename CompletionToken = DefaultCompletionToken>
753 auto readUserWriteMaskAsync(CompletionToken&& token = DefaultCompletionToken{}) {
755 connection(), id(), std::forward<CompletionToken>(token)
756 );
757 }
758
759 /// @wrapper{services::readIsAbstract}
761 return services::readIsAbstract(connection(), id()).value();
762 }
763
764 /// @wrapper{services::readIsAbstractAsync}
765 template <typename CompletionToken = DefaultCompletionToken>
766 auto readIsAbstractAsync(CompletionToken&& token = DefaultCompletionToken{}) {
768 connection(), id(), std::forward<CompletionToken>(token)
769 );
770 }
771
772 /// @wrapper{services::readSymmetric}
774 return services::readSymmetric(connection(), id()).value();
775 }
776
777 /// @wrapper{services::readSymmetricAsync}
778 template <typename CompletionToken = DefaultCompletionToken>
779 auto readSymmetricAsync(CompletionToken&& token = DefaultCompletionToken{}) {
781 connection(), id(), std::forward<CompletionToken>(token)
782 );
783 }
784
785 /// @wrapper{services::readInverseName}
789
790 /// @wrapper{services::readInverseNameAsync}
791 template <typename CompletionToken = DefaultCompletionToken>
792 auto readInverseNameAsync(CompletionToken&& token = DefaultCompletionToken{}) {
794 connection(), id(), std::forward<CompletionToken>(token)
795 );
796 }
797
798 /// @wrapper{services::readContainsNoLoops}
800 return services::readContainsNoLoops(connection(), id()).value();
801 }
802
803 /// @wrapper{services::readContainsNoLoopsAsync}
804 template <typename CompletionToken = DefaultCompletionToken>
805 auto readContainsNoLoopsAsync(CompletionToken&& token = DefaultCompletionToken{}) {
807 connection(), id(), std::forward<CompletionToken>(token)
808 );
809 }
810
811 /// @wrapper{services::readEventNotifier}
815
816 /// @wrapper{services::readEventNotifierAsync}
817 template <typename CompletionToken = DefaultCompletionToken>
818 auto readEventNotifierAsync(CompletionToken&& token = DefaultCompletionToken{}) {
820 connection(), id(), std::forward<CompletionToken>(token)
821 );
822 }
823
824 /// @wrapper{services::readDataValue}
828
829 /// @wrapper{services::readDataValueAsync}
830 template <typename CompletionToken = DefaultCompletionToken>
831 auto readDataValueAsync(CompletionToken&& token = DefaultCompletionToken{}) {
833 connection(), id(), std::forward<CompletionToken>(token)
834 );
835 }
836
837 /// @wrapper{services::readValue}
839 return services::readValue(connection(), id()).value();
840 }
841
842 /// @wrapper{services::readValueAsync}
843 template <typename CompletionToken = DefaultCompletionToken>
844 auto readValueAsync(CompletionToken&& token = DefaultCompletionToken{}) {
845 return services::readValueAsync(connection(), id(), std::forward<CompletionToken>(token));
846 }
847
848 /// @deprecated Use readValue().to<T>() instead
849 template <typename T>
850 [[deprecated("use readValue().to<T>() instead")]]
852 return readValue().template to<T>();
853 }
854
855 /// @deprecated Use readValue().to<std::vector<T>>() instead
856 template <typename T>
857 [[deprecated("use readValue().to<std::vector<T>>() instead")]]
858 std::vector<T> readValueArray() {
859 return readValue().template to<std::vector<T>>();
860 }
861
862 /// @wrapper{services::readDataType}
864 return services::readDataType(connection(), id()).value();
865 }
866
867 /// @wrapper{services::readDataTypeAsync}
868 template <typename CompletionToken = DefaultCompletionToken>
869 auto readDataTypeAsync(CompletionToken&& token = DefaultCompletionToken{}) {
871 connection(), id(), std::forward<CompletionToken>(token)
872 );
873 }
874
875 /// @wrapper{services::readValueRank}
877 return services::readValueRank(connection(), id()).value();
878 }
879
880 /// @wrapper{services::readValueRankAsync}
881 template <typename CompletionToken = DefaultCompletionToken>
882 auto readValueRankAsync(CompletionToken&& token = DefaultCompletionToken{}) {
884 connection(), id(), std::forward<CompletionToken>(token)
885 );
886 }
887
888 /// @wrapper{services::readArrayDimensions}
889 std::vector<uint32_t> readArrayDimensions() {
890 return services::readArrayDimensions(connection(), id()).value();
891 }
892
893 /// @wrapper{services::readArrayDimensionsAsync}
894 template <typename CompletionToken = DefaultCompletionToken>
895 auto readArrayDimensionsAsync(CompletionToken&& token = DefaultCompletionToken{}) {
897 connection(), id(), std::forward<CompletionToken>(token)
898 );
899 }
900
901 /// @wrapper{services::readAccessLevel}
905
906 /// @wrapper{services::readAccessLevelAsync}
907 template <typename CompletionToken = DefaultCompletionToken>
908 auto readAccessLevelAsync(CompletionToken&& token = DefaultCompletionToken{}) {
910 connection(), id(), std::forward<CompletionToken>(token)
911 );
912 }
913
914 /// @wrapper{services::readUserAccessLevel}
918
919 /// @wrapper{services::readUserAccessLevelAsync}
920 template <typename CompletionToken = DefaultCompletionToken>
921 auto readUserAccessLevelAsync(CompletionToken&& token = DefaultCompletionToken{}) {
923 connection(), id(), std::forward<CompletionToken>(token)
924 );
925 }
926
927 /// @wrapper{services::readMinimumSamplingInterval}
931
932 /// @wrapper{services::readMinimumSamplingIntervalAsync}
933 template <typename CompletionToken = DefaultCompletionToken>
936 connection(), id(), std::forward<CompletionToken>(token)
937 );
938 }
939
940 /// @wrapper{services::readHistorizing}
942 return services::readHistorizing(connection(), id()).value();
943 }
944
945 /// @wrapper{services::readHistorizingAsync}
946 template <typename CompletionToken = DefaultCompletionToken>
947 auto readHistorizingAsync(CompletionToken&& token = DefaultCompletionToken{}) {
949 connection(), id(), std::forward<CompletionToken>(token)
950 );
951 }
952
953 /// @wrapper{services::readExecutable}
955 return services::readExecutable(connection(), id()).value();
956 }
957
958 /// @wrapper{services::readExecutableAsync}
959 template <typename CompletionToken = DefaultCompletionToken>
960 auto readExecutableAsync(CompletionToken&& token = DefaultCompletionToken{}) {
962 connection(), id(), std::forward<CompletionToken>(token)
963 );
964 }
965
966 /// @wrapper{services::readUserExecutable}
968 return services::readUserExecutable(connection(), id()).value();
969 }
970
971 /// @wrapper{services::readUserExecutableAsync}
972 template <typename CompletionToken = DefaultCompletionToken>
973 auto readUserExecutableAsync(CompletionToken&& token = DefaultCompletionToken{}) {
975 connection(), id(), std::forward<CompletionToken>(token)
976 );
977 }
978
979 /// @wrapper{services::readDataTypeDefinition}
983
984 /// @wrapper{services::readDataTypeDefinitionAsync}
985 template <typename CompletionToken = DefaultCompletionToken>
986 auto readDataTypeDefinitionAsync(CompletionToken&& token = DefaultCompletionToken{}) {
988 connection(), id(), std::forward<CompletionToken>(token)
989 );
990 }
991
992 /// Read the value of an object property.
993 /// @param propertyName Browse name of the property (variable node)
995 return browseObjectProperty(propertyName).readValue();
996 }
997
998 /// @wrapper{services::writeDisplayName}
999 Node& writeDisplayName(const LocalizedText& displayName) {
1000 services::writeDisplayName(connection(), id(), displayName).throwIfBad();
1001 return *this;
1002 }
1003
1004 /// @wrapper{services::writeDisplayNameAsync}
1005 template <typename CompletionToken = DefaultCompletionToken>
1007 const LocalizedText& displayName, CompletionToken&& token = DefaultCompletionToken{}
1008 ) {
1010 connection(), id(), displayName, std::forward<CompletionToken>(token)
1011 );
1012 }
1013
1014 /// @wrapper{services::writeDescription}
1015 Node& writeDescription(const LocalizedText& description) {
1016 services::writeDescription(connection(), id(), description).throwIfBad();
1017 return *this;
1018 }
1019
1020 /// @wrapper{services::writeDescriptionAsync}
1021 template <typename CompletionToken = DefaultCompletionToken>
1023 const LocalizedText& description, CompletionToken&& token = DefaultCompletionToken{}
1024 ) {
1026 connection(), id(), description, std::forward<CompletionToken>(token)
1027 );
1028 }
1029
1030 /// @wrapper{services::writeWriteMask}
1032 services::writeWriteMask(connection(), id(), writeMask).throwIfBad();
1033 return *this;
1034 }
1035
1036 /// @wrapper{services::writeWriteMaskAsync}
1037 template <typename CompletionToken = DefaultCompletionToken>
1039 Bitmask<WriteMask> writeMask, CompletionToken&& token = DefaultCompletionToken{}
1040 ) {
1042 connection(), id(), writeMask, std::forward<CompletionToken>(token)
1043 );
1044 }
1045
1046 /// @wrapper{services::writeUserWriteMask}
1048 services::writeUserWriteMask(connection(), id(), userWriteMask).throwIfBad();
1049 return *this;
1050 }
1051
1052 /// @wrapper{services::writeUserWriteMaskAsync}
1053 template <typename CompletionToken = DefaultCompletionToken>
1055 Bitmask<WriteMask> userWriteMask, CompletionToken&& token = DefaultCompletionToken{}
1056 ) {
1058 connection(), id(), userWriteMask, std::forward<CompletionToken>(token)
1059 );
1060 }
1061
1062 /// @wrapper{services::writeIsAbstract}
1063 Node& writeIsAbstract(bool isAbstract) {
1064 services::writeIsAbstract(connection(), id(), isAbstract).throwIfBad();
1065 return *this;
1066 }
1067
1068 /// @wrapper{services::writeIsAbstractAsync}
1069 template <typename CompletionToken = DefaultCompletionToken>
1070 auto writeIsAbstractAsync(bool isAbstract, CompletionToken&& token = DefaultCompletionToken{}) {
1072 connection(), id(), isAbstract, std::forward<CompletionToken>(token)
1073 );
1074 }
1075
1076 /// @wrapper{services::writeSymmetric}
1079 return *this;
1080 }
1081
1082 /// @wrapper{services::writeSymmetricAsync}
1083 template <typename CompletionToken = DefaultCompletionToken>
1084 auto writeSymmetricAsync(bool symmetric, CompletionToken&& token = DefaultCompletionToken{}) {
1086 connection(), id(), symmetric, std::forward<CompletionToken>(token)
1087 );
1088 }
1089
1090 /// @wrapper{services::writeInverseName}
1091 Node& writeInverseName(const LocalizedText& inverseName) {
1092 services::writeInverseName(connection(), id(), inverseName).throwIfBad();
1093 return *this;
1094 }
1095
1096 /// @wrapper{services::writeInverseNameAsync}
1097 template <typename CompletionToken = DefaultCompletionToken>
1099 const LocalizedText& inverseName, CompletionToken&& token = DefaultCompletionToken{}
1100 ) {
1102 connection(), id(), inverseName, std::forward<CompletionToken>(token)
1103 );
1104 }
1105
1106 /// @wrapper{services::writeContainsNoLoops}
1107 Node& writeContainsNoLoops(bool containsNoLoops) {
1108 services::writeContainsNoLoops(connection(), id(), containsNoLoops).throwIfBad();
1109 return *this;
1110 }
1111
1112 /// @wrapper{services::writeContainsNoLoopsAsync}
1113 template <typename CompletionToken = DefaultCompletionToken>
1115 bool containsNoLoops, CompletionToken&& token = DefaultCompletionToken{}
1116 ) {
1118 connection(), id(), containsNoLoops, std::forward<CompletionToken>(token)
1119 );
1120 }
1121
1122 /// @wrapper{services::writeEventNotifier}
1124 services::writeEventNotifier(connection(), id(), eventNotifier).throwIfBad();
1125 return *this;
1126 }
1127
1128 /// @wrapper{services::writeEventNotifierAsync}
1129 template <typename CompletionToken = DefaultCompletionToken>
1131 Bitmask<EventNotifier> eventNotifier, CompletionToken&& token = DefaultCompletionToken{}
1132 ) {
1134 connection(), id(), eventNotifier, std::forward<CompletionToken>(token)
1135 );
1136 }
1137
1138 /// @wrapper{services::writeDataValue}
1141 return *this;
1142 }
1143
1144 /// @wrapper{services::writeDataValueAsync}
1145 template <typename CompletionToken = DefaultCompletionToken>
1147 const DataValue& value, CompletionToken&& token = DefaultCompletionToken{}
1148 ) {
1150 connection(), id(), value, std::forward<CompletionToken>(token)
1151 );
1152 }
1153
1154 /// @wrapper{services::writeValue}
1155 Node& writeValue(const Variant& value) {
1156 services::writeValue(connection(), id(), value).throwIfBad();
1157 return *this;
1158 }
1159
1160 /// @wrapper{services::writeValueAsync}
1161 template <typename CompletionToken = DefaultCompletionToken>
1162 auto writeValueAsync(const Variant& value, CompletionToken&& token = DefaultCompletionToken{}) {
1164 connection(), id(), value, std::forward<CompletionToken>(token)
1165 );
1166 }
1167
1168 /// @deprecated Use writeValue(Variant{value}) instead
1169 template <typename T>
1170 [[deprecated("use writeValue(Variant{value}) instead")]]
1171 Node& writeValueScalar(const T& value) {
1172 writeValue(Variant{value});
1173 return *this;
1174 }
1175
1176 /// @deprecated Use writeValue(Variant{array}) instead
1177 template <typename ArrayLike>
1178 [[deprecated("use writeValue(Variant{array}) instead")]]
1179 Node& writeValueArray(const ArrayLike& array) {
1180 writeValue(Variant{array});
1181 return *this;
1182 }
1183
1184 /// @deprecated Use writeValue(Variant{first, last}) instead
1185 template <typename InputIt>
1186 [[deprecated("use writeValue(Variant{first, last}) instead")]]
1187 Node& writeValueArray(InputIt first, InputIt last) {
1188 writeValue(Variant{first, last});
1189 return *this;
1190 }
1191
1192 /// @wrapper{services::writeDataType}
1193 Node& writeDataType(const NodeId& dataType) {
1194 services::writeDataType(connection(), id(), dataType).throwIfBad();
1195 return *this;
1196 }
1197
1198 /// @overload
1199 /// Deduce the `typeId` from the template type.
1200 template <typename T>
1202 return writeDataType(asWrapper<NodeId>(getDataType<T>().typeId));
1203 }
1204
1205 /// @wrapper{services::writeDataTypeAsync}
1206 template <typename CompletionToken = DefaultCompletionToken>
1208 const NodeId& dataType, CompletionToken&& token = DefaultCompletionToken{}
1209 ) {
1211 connection(), id(), dataType, std::forward<CompletionToken>(token)
1212 );
1213 }
1214
1215 /// @wrapper{services::writeValueRank}
1217 services::writeValueRank(connection(), id(), valueRank).throwIfBad();
1218 return *this;
1219 }
1220
1221 /// @wrapper{services::writeValueRankAsync}
1222 template <typename CompletionToken = DefaultCompletionToken>
1224 ValueRank valueRank, CompletionToken&& token = DefaultCompletionToken{}
1225 ) {
1227 connection(), id(), valueRank, std::forward<CompletionToken>(token)
1228 );
1229 }
1230
1231 /// @wrapper{services::writeArrayDimensions}
1234 return *this;
1235 }
1236
1237 /// @wrapper{services::writeArrayDimensionsAsync}
1238 template <typename CompletionToken = DefaultCompletionToken>
1240 Span<const uint32_t> dimensions, CompletionToken&& token = DefaultCompletionToken{}
1241 ) {
1243 connection(), id(), dimensions, std::forward<CompletionToken>(token)
1244 );
1245 }
1246
1247 /// @wrapper{services::writeAccessLevel}
1249 services::writeAccessLevel(connection(), id(), accessLevel).throwIfBad();
1250 return *this;
1251 }
1252
1253 /// @wrapper{services::writeAccessLevelAsync}
1254 template <typename CompletionToken = DefaultCompletionToken>
1256 Bitmask<AccessLevel> accessLevel, CompletionToken&& token = DefaultCompletionToken{}
1257 ) {
1259 connection(), id(), accessLevel, std::forward<CompletionToken>(token)
1260 );
1261 }
1262
1263 /// @wrapper{services::writeUserAccessLevel}
1265 services::writeUserAccessLevel(connection(), id(), userAccessLevel).throwIfBad();
1266 return *this;
1267 }
1268
1269 /// @wrapper{services::writeUserAccessLevelAsync}
1270 template <typename CompletionToken = DefaultCompletionToken>
1272 Bitmask<AccessLevel> userAccessLevel, CompletionToken&& token = DefaultCompletionToken{}
1273 ) {
1275 connection(), id(), userAccessLevel, std::forward<CompletionToken>(token)
1276 );
1277 }
1278
1279 /// @wrapper{services::writeMinimumSamplingInterval}
1280 Node& writeMinimumSamplingInterval(double milliseconds) {
1282 return *this;
1283 }
1284
1285 /// @wrapper{services::writeMinimumSamplingIntervalAsync}
1286 template <typename CompletionToken = DefaultCompletionToken>
1288 double milliseconds, CompletionToken&& token = DefaultCompletionToken{}
1289 ) {
1291 connection(), id(), milliseconds, std::forward<CompletionToken>(token)
1292 );
1293 }
1294
1295 /// @wrapper{services::writeHistorizing}
1296 Node& writeHistorizing(bool historizing) {
1297 services::writeHistorizing(connection(), id(), historizing).throwIfBad();
1298 return *this;
1299 }
1300
1301 /// @wrapper{services::writeHistorizingAsync}
1302 template <typename CompletionToken = DefaultCompletionToken>
1304 bool historizing, CompletionToken&& token = DefaultCompletionToken{}
1305 ) {
1307 connection(), id(), historizing, std::forward<CompletionToken>(token)
1308 );
1309 }
1310
1311 /// @wrapper{services::writeExecutable}
1312 Node& writeExecutable(bool executable) {
1313 services::writeExecutable(connection(), id(), executable).throwIfBad();
1314 return *this;
1315 }
1316
1317 /// @wrapper{services::writeExecutableAsync}
1318 template <typename CompletionToken = DefaultCompletionToken>
1319 auto writeExecutableAsync(bool executable, CompletionToken&& token = DefaultCompletionToken{}) {
1321 connection(), id(), executable, std::forward<CompletionToken>(token)
1322 );
1323 }
1324
1325 /// @wrapper{services::writeUserExecutable}
1326 Node& writeUserExecutable(bool userExecutable) {
1327 services::writeUserExecutable(connection(), id(), userExecutable).throwIfBad();
1328 return *this;
1329 }
1330
1331 /// @wrapper{services::writeUserExecutableAsync}
1332 template <typename CompletionToken = DefaultCompletionToken>
1334 bool userExecutable, CompletionToken&& token = DefaultCompletionToken{}
1335 ) {
1337 connection(), id(), userExecutable, std::forward<CompletionToken>(token)
1338 );
1339 }
1340
1341 /// Write the value of an object property.
1342 /// @param propertyName Browse name of the property (variable node)
1343 /// @param value New value
1344 Node& writeObjectProperty(const QualifiedName& propertyName, const Variant& value) {
1345 browseObjectProperty(propertyName).writeValue(value);
1346 return *this;
1347 }
1348
1349 /// @}
1350
1351private:
1352 static Node fromId(Connection& connection, Result<NodeId>&& result) {
1353 return {connection, std::move(result).value()};
1354 }
1355
1356 static Node fromId(Connection& connection, ExpandedNodeId& id) {
1357 if (!id.isLocal()) {
1358 throw BadStatus{UA_STATUSCODE_BADNODEIDUNKNOWN};
1359 }
1360 return {connection, std::move(id.nodeId())};
1361 }
1362
1363 template <typename CompletionToken>
1364 static auto fromIdAsync(Connection& connection, CompletionToken&& token) {
1365 return services::detail::TransformToken(
1366 [&](Result<NodeId>& result) {
1367 return result.transform([&](NodeId& id) -> Node {
1368 return {connection, std::move(id)};
1369 });
1370 },
1371 std::forward<CompletionToken>(token)
1372 );
1373 }
1374
1375 Node browseObjectProperty(const QualifiedName& propertyName) {
1377 connection(),
1378 BrowsePath(id(), {{ReferenceTypeId::HasProperty, false, true, propertyName}})
1379 );
1380 result.statusCode().throwIfBad();
1381 for (auto&& target : result.targets()) {
1382 if (target.targetId().isLocal()) {
1383 return {connection(), std::move(target.targetId().nodeId())};
1384 }
1385 }
1386 throw BadStatus{UA_STATUSCODE_BADNOTFOUND};
1387 }
1388
1389 Connection* connection_;
1390 NodeId id_;
1391};
1392
1393/* ---------------------------------------------------------------------------------------------- */
1394
1395/// @relates Node
1396template <typename Connection>
1397bool operator==(const Node<Connection>& lhs, const Node<Connection>& rhs) noexcept {
1398 return (lhs.connection() == rhs.connection()) && (lhs.id() == rhs.id());
1399}
1400
1401/// @relates Node
1402template <typename Connection>
1403bool operator!=(const Node<Connection>& lhs, const Node<Connection>& rhs) noexcept {
1404 return !(lhs == rhs);
1405}
1406
1407} // namespace opcua
Exception for bad status codes from open62541 UA_STATUSCODE_*.
Definition exception.hpp:15
Bitmask using (scoped) enums.
Definition bitmask.hpp:127
UA_DataValue wrapper class.
Definition types.hpp:1568
Variant & value() &noexcept
Get value.
Definition types.hpp:1668
UA_LocalizedText wrapper class.
Definition types.hpp:956
UA_NodeId wrapper class.
Definition types.hpp:641
High-level node class to access node attribute, browse and populate address space.
Definition node.hpp:45
double readMinimumSamplingInterval()
Read the AttributeId::MinimumSamplingInterval attribute of a node.
Definition node.hpp:928
bool readIsAbstract()
Read the AttributeId::IsAbstract attribute of a node.
Definition node.hpp:760
QualifiedName readBrowseName()
Read the AttributeId::BrowseName attribute of a node.
Definition node.hpp:695
Node & writeEventNotifier(Bitmask< EventNotifier > eventNotifier)
Write the AttributeId::EventNotifier attribute of a node.
Definition node.hpp:1123
auto writeEventNotifierAsync(Bitmask< EventNotifier > eventNotifier, CompletionToken &&token=DefaultCompletionToken{})
Write the AttributeId::EventNotifier attribute of a node.
Definition node.hpp:1130
auto writeValueAsync(const Variant &value, CompletionToken &&token=DefaultCompletionToken{})
Write the AttributeId::Value attribute of a node.
Definition node.hpp:1162
Bitmask< AccessLevel > readUserAccessLevel()
Read the AttributeId::UserAccessLevel attribute of a node.
Definition node.hpp:915
auto readIsAbstractAsync(CompletionToken &&token=DefaultCompletionToken{})
Read the AttributeId::IsAbstract attribute of a node.
Definition node.hpp:766
Variant readObjectProperty(const QualifiedName &propertyName)
Read the value of an object property.
Definition node.hpp:994
LocalizedText readDisplayName()
Read the AttributeId::DisplayName attribute of a node.
Definition node.hpp:708
Node & writeArrayDimensions(Span< const uint32_t > dimensions)
Write the AttributeId::ArrayDimensions attribute of a node.
Definition node.hpp:1232
auto addMethodAsync(const NodeId &id, std::string_view browseName, services::MethodCallback callback, Span< const Argument > inputArguments, Span< const Argument > outputArguments, const MethodAttributes &attributes={}, const NodeId &referenceType=ReferenceTypeId::HasComponent, CompletionToken &&token=DefaultCompletionToken{})
Add method.
Definition node.hpp:256
auto writeDisplayNameAsync(const LocalizedText &displayName, CompletionToken &&token=DefaultCompletionToken{})
Write the AttributeId::DisplayName attribute of a node.
Definition node.hpp:1006
auto addObjectTypeAsync(const NodeId &id, std::string_view browseName, const ObjectTypeAttributes &attributes={}, const NodeId &referenceType=ReferenceTypeId::HasSubtype, CompletionToken &&token=DefaultCompletionToken{})
Add object type.
Definition node.hpp:300
auto writeAccessLevelAsync(Bitmask< AccessLevel > accessLevel, CompletionToken &&token=DefaultCompletionToken{})
Write the AttributeId::AccessLevel attribute of a node.
Definition node.hpp:1255
auto readValueRankAsync(CompletionToken &&token=DefaultCompletionToken{})
Read the AttributeId::ValueRank attribute of a node.
Definition node.hpp:882
auto writeContainsNoLoopsAsync(bool containsNoLoops, CompletionToken &&token=DefaultCompletionToken{})
Write the AttributeId::ContainsNoLoops attribute of a node.
Definition node.hpp:1114
auto readMinimumSamplingIntervalAsync(CompletionToken &&token=DefaultCompletionToken{})
Read the AttributeId::MinimumSamplingInterval attribute of a node.
Definition node.hpp:934
auto writeValueRankAsync(ValueRank valueRank, CompletionToken &&token=DefaultCompletionToken{})
Write the AttributeId::ValueRank attribute of a node.
Definition node.hpp:1223
Node addView(const NodeId &id, std::string_view browseName, const ViewAttributes &attributes={}, const NodeId &referenceType=ReferenceTypeId::Organizes)
Add view.
Definition node.hpp:433
auto writeSymmetricAsync(bool symmetric, CompletionToken &&token=DefaultCompletionToken{})
Write the AttributeId::Symmetric attribute of a node.
Definition node.hpp:1084
auto readArrayDimensionsAsync(CompletionToken &&token=DefaultCompletionToken{})
Read the AttributeId::ArrayDimensions attribute of a node.
Definition node.hpp:895
Node & writeValueScalar(const T &value)
Definition node.hpp:1171
auto readHistorizingAsync(CompletionToken &&token=DefaultCompletionToken{})
Read the AttributeId::Historizing attribute of a node.
Definition node.hpp:947
Node & writeContainsNoLoops(bool containsNoLoops)
Write the AttributeId::ContainsNoLoops attribute of a node.
Definition node.hpp:1107
DataValue readDataValue()
Read the AttributeId::Value attribute of a node as a DataValue object.
Definition node.hpp:825
auto addVariableTypeAsync(const NodeId &id, std::string_view browseName, const VariableTypeAttributes &attributes={}, const NodeId &variableType=VariableTypeId::BaseDataVariableType, const NodeId &referenceType=ReferenceTypeId::HasSubtype, CompletionToken &&token=DefaultCompletionToken{})
Add variable type.
Definition node.hpp:338
Node & addModellingRule(ModellingRule rule)
Add modelling rule.
Definition node.hpp:494
auto readDataTypeAsync(CompletionToken &&token=DefaultCompletionToken{})
Read the AttributeId::DataType attribute of a node.
Definition node.hpp:869
auto writeExecutableAsync(bool executable, CompletionToken &&token=DefaultCompletionToken{})
Write the AttributeId::Executable attribute of a node.
Definition node.hpp:1319
bool operator==(const Node< Connection > &lhs, const Node< Connection > &rhs) noexcept
Definition node.hpp:1397
Node addObjectType(const NodeId &id, std::string_view browseName, const ObjectTypeAttributes &attributes={}, const NodeId &referenceType=ReferenceTypeId::HasSubtype)
Add object type.
Definition node.hpp:282
auto writeInverseNameAsync(const LocalizedText &inverseName, CompletionToken &&token=DefaultCompletionToken{})
Write the AttributeId::InverseName attribute of a node.
Definition node.hpp:1098
auto addObjectAsync(const NodeId &id, std::string_view browseName, const ObjectAttributes &attributes={}, const NodeId &objectType=ObjectTypeId::BaseObjectType, const NodeId &referenceType=ReferenceTypeId::HasComponent, CompletionToken &&token=DefaultCompletionToken{})
Add object.
Definition node.hpp:135
bool operator!=(const Node< Connection > &lhs, const Node< Connection > &rhs) noexcept
Definition node.hpp:1403
Node addProperty(const NodeId &id, std::string_view browseName, const VariableAttributes &attributes={})
Add property.
Definition node.hpp:196
Variant readDataTypeDefinition()
Read the AttributeId::DataTypeDefinition attribute of a node.
Definition node.hpp:980
Connection & connection() noexcept
Get the server/client instance.
Definition node.hpp:58
Node & writeUserExecutable(bool userExecutable)
Write the AttributeId::UserExecutable attribute of a node.
Definition node.hpp:1326
Node & writeObjectProperty(const QualifiedName &propertyName, const Variant &value)
Write the value of an object property.
Definition node.hpp:1344
std::vector< Node > browseChildren(const NodeId &referenceType=ReferenceTypeId::HierarchicalReferences, Bitmask< NodeClass > nodeClassMask=NodeClass::Unspecified)
Browse child nodes (only local nodes).
Definition node.hpp:613
auto deleteNodeAsync(bool deleteReferences=true, CompletionToken &&token=DefaultCompletionToken{})
Delete node.
Definition node.hpp:520
Node(Connection &connection, const NodeId &id)
Create a Node object.
Definition node.hpp:48
auto writeDataValueAsync(const DataValue &value, CompletionToken &&token=DefaultCompletionToken{})
Write the AttributeId::Value attribute of a node as a DataValue object.
Definition node.hpp:1146
auto writeWriteMaskAsync(Bitmask< WriteMask > writeMask, CompletionToken &&token=DefaultCompletionToken{})
Write the AttributeId::WriteMask attribute of a node.
Definition node.hpp:1038
auto readInverseNameAsync(CompletionToken &&token=DefaultCompletionToken{})
Read the AttributeId::InverseName attribute of a node.
Definition node.hpp:792
void deleteNode(bool deleteReferences=true)
Delete node.
Definition node.hpp:512
auto readDisplayNameAsync(CompletionToken &&token=DefaultCompletionToken{})
Read the AttributeId::DisplayName attribute of a node.
Definition node.hpp:714
auto readDataValueAsync(CompletionToken &&token=DefaultCompletionToken{})
Read the AttributeId::Value attribute of a node as a DataValue object.
Definition node.hpp:831
auto readWriteMaskAsync(CompletionToken &&token=DefaultCompletionToken{})
Read the AttributeId::WriteMask attribute of a node.
Definition node.hpp:740
auto readUserWriteMaskAsync(CompletionToken &&token=DefaultCompletionToken{})
Read the AttributeId::UserWriteMask attribute of a node.
Definition node.hpp:753
Node & writeHistorizing(bool historizing)
Write the AttributeId::Historizing attribute of a node.
Definition node.hpp:1296
LocalizedText readInverseName()
Read the AttributeId::InverseName attribute of a node.
Definition node.hpp:786
Node & deleteReference(const NodeId &targetId, const NodeId &referenceType, bool isForward=true, bool deleteBidirectional=true)
Delete reference.
Definition node.hpp:529
NodeClass readNodeClass()
Read the AttributeId::NodeClass attribute of a node.
Definition node.hpp:682
Node & writeSymmetric(bool symmetric)
Write the AttributeId::Symmetric attribute of a node.
Definition node.hpp:1077
auto addDataTypeAsync(const NodeId &id, std::string_view browseName, const DataTypeAttributes &attributes={}, const NodeId &referenceType=ReferenceTypeId::HasSubtype, CompletionToken &&token=DefaultCompletionToken{})
Add data type.
Definition node.hpp:414
bool exists() noexcept
Check if the Node exists in the most efficient manner.
auto addModellingRuleAsync(ModellingRule rule, CompletionToken &&token=DefaultCompletionToken{})
Add modelling rule.
Definition node.hpp:503
Node & writeAccessLevel(Bitmask< AccessLevel > accessLevel)
Write the AttributeId::AccessLevel attribute of a node.
Definition node.hpp:1248
Node addFolder(const NodeId &id, std::string_view browseName, const ObjectAttributes &attributes={}, const NodeId &referenceType=ReferenceTypeId::HasComponent)
Add folder.
Definition node.hpp:81
auto callMethodAsync(const NodeId &methodId, Span< const Variant > inputArguments, CompletionToken &&token=DefaultCompletionToken{})
Definition node.hpp:666
Node & writeDataType(const NodeId &dataType)
Write the AttributeId::DataType attribute of a node.
Definition node.hpp:1193
std::vector< uint32_t > readArrayDimensions()
Read the AttributeId::ArrayDimensions attribute of a node.
Definition node.hpp:889
Node & writeDataValue(const DataValue &value)
Write the AttributeId::Value attribute of a node as a DataValue object.
Definition node.hpp:1139
auto readBrowseNameAsync(CompletionToken &&token=DefaultCompletionToken{})
Read the AttributeId::BrowseName attribute of a node.
Definition node.hpp:701
Node addObject(const NodeId &id, std::string_view browseName, const ObjectAttributes &attributes={}, const NodeId &objectType=ObjectTypeId::BaseObjectType, const NodeId &referenceType=ReferenceTypeId::HasComponent)
Add object.
Definition node.hpp:116
auto addReferenceAsync(const NodeId &targetId, const NodeId &referenceType, bool forward=true, CompletionToken &&token=DefaultCompletionToken{})
Add reference.
Definition node.hpp:477
auto writeUserWriteMaskAsync(Bitmask< WriteMask > userWriteMask, CompletionToken &&token=DefaultCompletionToken{})
Write the AttributeId::UserWriteMask attribute of a node.
Definition node.hpp:1054
auto readExecutableAsync(CompletionToken &&token=DefaultCompletionToken{})
Read the AttributeId::Executable attribute of a node.
Definition node.hpp:960
Node & writeWriteMask(Bitmask< WriteMask > writeMask)
Write the AttributeId::WriteMask attribute of a node.
Definition node.hpp:1031
auto writeDataTypeAsync(const NodeId &dataType, CompletionToken &&token=DefaultCompletionToken{})
Write the AttributeId::DataType attribute of a node.
Definition node.hpp:1207
std::vector< Node > browseReferencedNodes(BrowseDirection browseDirection=BrowseDirection::Both, const NodeId &referenceType=ReferenceTypeId::References, bool includeSubtypes=true, Bitmask< NodeClass > nodeClassMask=NodeClass::Unspecified)
Browse referenced nodes (only local nodes).
Definition node.hpp:587
Node addDataType(const NodeId &id, std::string_view browseName, const DataTypeAttributes &attributes={}, const NodeId &referenceType=ReferenceTypeId::HasSubtype)
Add data type.
Definition node.hpp:396
auto readSymmetricAsync(CompletionToken &&token=DefaultCompletionToken{})
Read the AttributeId::Symmetric attribute of a node.
Definition node.hpp:779
auto readNodeClassAsync(CompletionToken &&token=DefaultCompletionToken{})
Read the AttributeId::NodeClass attribute of a node.
Definition node.hpp:688
std::vector< ReferenceDescription > browseReferences(BrowseDirection browseDirection=BrowseDirection::Both, const NodeId &referenceType=ReferenceTypeId::References, bool includeSubtypes=true, Bitmask< NodeClass > nodeClassMask=NodeClass::Unspecified)
Browse references.
Definition node.hpp:569
auto readContainsNoLoopsAsync(CompletionToken &&token=DefaultCompletionToken{})
Read the AttributeId::ContainsNoLoops attribute of a node.
Definition node.hpp:805
T readValueScalar()
Definition node.hpp:851
bool readExecutable()
Read the AttributeId::Executable attribute of a node.
Definition node.hpp:954
bool readContainsNoLoops()
Read the AttributeId::ContainsNoLoops attribute of a node.
Definition node.hpp:799
Node & writeInverseName(const LocalizedText &inverseName)
Write the AttributeId::InverseName attribute of a node.
Definition node.hpp:1091
Bitmask< AccessLevel > readAccessLevel()
Read the AttributeId::AccessLevel attribute of a node.
Definition node.hpp:902
Node addReferenceType(const NodeId &id, std::string_view browseName, const ReferenceTypeAttributes &attributes={}, const NodeId &referenceType=ReferenceTypeId::HasSubtype)
Add reference type.
Definition node.hpp:359
Variant readValue()
Read the AttributeId::Value attribute of a node.
Definition node.hpp:838
Node & writeValueRank(ValueRank valueRank)
Write the AttributeId::ValueRank attribute of a node.
Definition node.hpp:1216
Node & writeDisplayName(const LocalizedText &displayName)
Write the AttributeId::DisplayName attribute of a node.
Definition node.hpp:999
auto addVariableAsync(const NodeId &id, std::string_view browseName, const VariableAttributes &attributes={}, const NodeId &variableType=VariableTypeId::BaseDataVariableType, const NodeId &referenceType=ReferenceTypeId::HasComponent, CompletionToken &&token=DefaultCompletionToken{})
Add variable.
Definition node.hpp:175
auto readValueAsync(CompletionToken &&token=DefaultCompletionToken{})
Read the AttributeId::Value attribute of a node.
Definition node.hpp:844
Node(Connection &connection, NodeId &&id)
Create a Node object.
Definition node.hpp:53
auto readUserAccessLevelAsync(CompletionToken &&token=DefaultCompletionToken{})
Read the AttributeId::UserAccessLevel attribute of a node.
Definition node.hpp:921
Node & writeValueArray(const ArrayLike &array)
Definition node.hpp:1179
auto readAccessLevelAsync(CompletionToken &&token=DefaultCompletionToken{})
Read the AttributeId::AccessLevel attribute of a node.
Definition node.hpp:908
bool readSymmetric()
Read the AttributeId::Symmetric attribute of a node.
Definition node.hpp:773
auto writeHistorizingAsync(bool historizing, CompletionToken &&token=DefaultCompletionToken{})
Write the AttributeId::Historizing attribute of a node.
Definition node.hpp:1303
Node & writeIsAbstract(bool isAbstract)
Write the AttributeId::IsAbstract attribute of a node.
Definition node.hpp:1063
auto writeDescriptionAsync(const LocalizedText &description, CompletionToken &&token=DefaultCompletionToken{})
Write the AttributeId::Description attribute of a node.
Definition node.hpp:1022
auto writeMinimumSamplingIntervalAsync(double milliseconds, CompletionToken &&token=DefaultCompletionToken{})
Write the AttributeId::MinimumSamplingInterval attribute of a node.
Definition node.hpp:1287
LocalizedText readDescription()
Read the AttributeId::Description attribute of a node.
Definition node.hpp:721
Node addVariableType(const NodeId &id, std::string_view browseName, const VariableTypeAttributes &attributes={}, const NodeId &variableType=VariableTypeId::BaseDataVariableType, const NodeId &referenceType=ReferenceTypeId::HasSubtype)
Add variable type.
Definition node.hpp:319
Bitmask< WriteMask > readUserWriteMask()
Read the AttributeId::UserWriteMask attribute of a node.
Definition node.hpp:747
Node & writeDataType()
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition node.hpp:1201
auto readDescriptionAsync(CompletionToken &&token=DefaultCompletionToken{})
Read the AttributeId::Description attribute of a node.
Definition node.hpp:727
Node & writeValue(const Variant &value)
Write the AttributeId::Value attribute of a node.
Definition node.hpp:1155
bool readHistorizing()
Read the AttributeId::Historizing attribute of a node.
Definition node.hpp:941
Node & writeUserWriteMask(Bitmask< WriteMask > userWriteMask)
Write the AttributeId::UserWriteMask attribute of a node.
Definition node.hpp:1047
auto readUserExecutableAsync(CompletionToken &&token=DefaultCompletionToken{})
Read the AttributeId::UserExecutable attribute of a node.
Definition node.hpp:973
auto addViewAsync(const NodeId &id, std::string_view browseName, const ViewAttributes &attributes={}, const NodeId &referenceType=ReferenceTypeId::Organizes, CompletionToken &&token=DefaultCompletionToken{})
Add view.
Definition node.hpp:449
auto writeUserAccessLevelAsync(Bitmask< AccessLevel > userAccessLevel, CompletionToken &&token=DefaultCompletionToken{})
Write the AttributeId::UserAccessLevel attribute of a node.
Definition node.hpp:1271
ValueRank readValueRank()
Read the AttributeId::ValueRank attribute of a node.
Definition node.hpp:876
Node & writeExecutable(bool executable)
Write the AttributeId::Executable attribute of a node.
Definition node.hpp:1312
auto addPropertyAsync(const NodeId &id, std::string_view browseName, const VariableAttributes &attributes={}, CompletionToken &&token=DefaultCompletionToken{})
Add property.
Definition node.hpp:209
Node & addReference(const NodeId &targetId, const NodeId &referenceType, bool forward=true)
Add reference.
Definition node.hpp:468
auto readDataTypeDefinitionAsync(CompletionToken &&token=DefaultCompletionToken{})
Read the AttributeId::DataTypeDefinition attribute of a node.
Definition node.hpp:986
NodeId readDataType()
Read the AttributeId::DataType attribute of a node.
Definition node.hpp:863
std::vector< T > readValueArray()
Definition node.hpp:858
auto writeArrayDimensionsAsync(Span< const uint32_t > dimensions, CompletionToken &&token=DefaultCompletionToken{})
Write the AttributeId::ArrayDimensions attribute of a node.
Definition node.hpp:1239
auto writeIsAbstractAsync(bool isAbstract, CompletionToken &&token=DefaultCompletionToken{})
Write the AttributeId::IsAbstract attribute of a node.
Definition node.hpp:1070
auto readEventNotifierAsync(CompletionToken &&token=DefaultCompletionToken{})
Read the AttributeId::EventNotifier attribute of a node.
Definition node.hpp:818
auto addFolderAsync(const NodeId &id, std::string_view browseName, const ObjectAttributes &attributes={}, const NodeId &referenceType=ReferenceTypeId::HasComponent, CompletionToken &&token=DefaultCompletionToken{})
Add folder.
Definition node.hpp:97
const Connection & connection() const noexcept
Get the server/client instance.
Definition node.hpp:63
auto writeUserExecutableAsync(bool userExecutable, CompletionToken &&token=DefaultCompletionToken{})
Write the AttributeId::UserExecutable attribute of a node.
Definition node.hpp:1333
Node addVariable(const NodeId &id, std::string_view browseName, const VariableAttributes &attributes={}, const NodeId &variableType=VariableTypeId::BaseDataVariableType, const NodeId &referenceType=ReferenceTypeId::HasComponent)
Add variable.
Definition node.hpp:156
Node & writeDescription(const LocalizedText &description)
Write the AttributeId::Description attribute of a node.
Definition node.hpp:1015
Node & writeValueArray(InputIt first, InputIt last)
Definition node.hpp:1187
Node addMethod(const NodeId &id, std::string_view browseName, services::MethodCallback callback, Span< const Argument > inputArguments, Span< const Argument > outputArguments, const MethodAttributes &attributes={}, const NodeId &referenceType=ReferenceTypeId::HasComponent)
Add method.
Definition node.hpp:227
CallMethodResult callMethod(const NodeId &methodId, Span< const Variant > inputArguments)
Call server methods.
Definition node.hpp:660
auto deleteReferenceAsync(const NodeId &targetId, const NodeId &referenceType, bool isForward=true, bool deleteBidirectional=true, CompletionToken &&token=DefaultCompletionToken{})
Delete reference.
Definition node.hpp:546
Node browseParent()
Browse parent node.
Definition node.hpp:637
Bitmask< WriteMask > readWriteMask()
Read the AttributeId::WriteMask attribute of a node.
Definition node.hpp:734
Node & writeUserAccessLevel(Bitmask< AccessLevel > userAccessLevel)
Write the AttributeId::UserAccessLevel attribute of a node.
Definition node.hpp:1264
auto addReferenceTypeAsync(const NodeId &id, std::string_view browseName, const ReferenceTypeAttributes &attributes={}, const NodeId &referenceType=ReferenceTypeId::HasSubtype, CompletionToken &&token=DefaultCompletionToken{})
Add reference type.
Definition node.hpp:377
bool readUserExecutable()
Read the AttributeId::UserExecutable attribute of a node.
Definition node.hpp:967
const NodeId & id() const noexcept
Get the node id.
Definition node.hpp:68
Bitmask< EventNotifier > readEventNotifier()
Read the AttributeId::EventNotifier attribute of a node.
Definition node.hpp:812
Node & writeMinimumSamplingInterval(double milliseconds)
Write the AttributeId::MinimumSamplingInterval attribute of a node.
Definition node.hpp:1280
Node browseChild(Span< const QualifiedName > path)
Browse child node specified by its relative path from this node (only local nodes).
Definition node.hpp:623
UA_QualifiedName wrapper class.
Definition types.hpp:915
The template class Result encapsulates a StatusCode and optionally a value.
Definition result.hpp:53
View to a contiguous sequence of objects, similar to std::span in C++20.
Definition span.hpp:29
constexpr void throwIfBad() const
Throw a BadStatus exception if the status code is bad.
Definition types.hpp:82
UA_Variant wrapper class.
Definition types.hpp:1048
UA_BrowseDescription wrapper class.
Definition types.hpp:1036
UA_CallMethodResult wrapper class.
Definition types.hpp:1569
UA_DataTypeAttributes wrapper class.
Definition types.hpp:589
UA_MethodAttributes wrapper class.
Definition types.hpp:483
UA_ObjectAttributes wrapper class.
Definition types.hpp:400
UA_ObjectTypeAttributes wrapper class.
Definition types.hpp:501
UA_ReferenceTypeAttributes wrapper class.
Definition types.hpp:568
UA_VariableAttributes wrapper class.
Definition types.hpp:419
UA_VariableAttributes wrapper class.
Definition types.hpp:518
UA_ViewAttributes wrapper class.
Definition types.hpp:605
auto addObjectTypeAsync(Client &connection, const NodeId &parentId, const NodeId &id, std::string_view browseName, const ObjectTypeAttributes &attributes, const NodeId &referenceType, CompletionToken &&token)
Add object type.
auto addPropertyAsync(Client &connection, const NodeId &parentId, const NodeId &id, std::string_view browseName, const VariableAttributes &attributes, CompletionToken &&token)
Add property.
Result< NodeId > addObject(T &connection, const NodeId &parentId, const NodeId &id, std::string_view browseName, const ObjectAttributes &attributes, const NodeId &objectType, const NodeId &referenceType) noexcept
Add object.
auto addMethodAsync(Client &connection, const NodeId &parentId, const NodeId &id, std::string_view browseName, MethodCallback callback, Span< const Argument > inputArguments, Span< const Argument > outputArguments, const MethodAttributes &attributes, const NodeId &referenceType, CompletionToken &&token)
Add method.
std::variant< std::function< void(Span< const Variant > input, Span< Variant > output)>, std::function< StatusCode(Session &session, Span< const Variant > input, Span< Variant > output, const NodeId &methodId, const NodeId &objectId)> > MethodCallback
Method callback.
Result< NodeId > addObjectType(T &connection, const NodeId &parentId, const NodeId &id, std::string_view browseName, const ObjectTypeAttributes &attributes, const NodeId &referenceType) noexcept
Add object type.
Result< NodeId > addMethod(T &connection, const NodeId &parentId, const NodeId &id, std::string_view browseName, MethodCallback callback, Span< const Argument > inputArguments, Span< const Argument > outputArguments, const MethodAttributes &attributes, const NodeId &referenceType) noexcept
Add method.
auto addFolderAsync(Client &connection, const NodeId &parentId, const NodeId &id, std::string_view browseName, const ObjectAttributes &attributes, const NodeId &referenceType, CompletionToken &&token)
Add folder.
Result< NodeId > addFolder(T &connection, const NodeId &parentId, const NodeId &id, std::string_view browseName, const ObjectAttributes &attributes, const NodeId &referenceType) noexcept
Add folder.
Result< NodeId > addDataType(T &connection, const NodeId &parentId, const NodeId &id, std::string_view browseName, const DataTypeAttributes &attributes, const NodeId &referenceType) noexcept
Add data type.
auto addReferenceTypeAsync(Client &connection, const NodeId &parentId, const NodeId &id, std::string_view browseName, const ReferenceTypeAttributes &attributes, const NodeId &referenceType, CompletionToken &&token)
Add reference type.
auto addDataTypeAsync(Client &connection, const NodeId &parentId, const NodeId &id, std::string_view browseName, const DataTypeAttributes &attributes, const NodeId &referenceType, CompletionToken &&token)
Add data type.
auto addVariableTypeAsync(Client &connection, const NodeId &parentId, const NodeId &id, std::string_view browseName, const VariableTypeAttributes &attributes, const NodeId &variableType, const NodeId &referenceType, CompletionToken &&token)
Add variable type.
Result< NodeId > addVariableType(T &connection, const NodeId &parentId, const NodeId &id, std::string_view browseName, const VariableTypeAttributes &attributes, const NodeId &variableType, const NodeId &referenceType) noexcept
Add variable type.
auto addVariableAsync(Client &connection, const NodeId &parentId, const NodeId &id, std::string_view browseName, const VariableAttributes &attributes, const NodeId &variableType, const NodeId &referenceType, CompletionToken &&token)
Add variable.
Result< NodeId > addReferenceType(T &connection, const NodeId &parentId, const NodeId &id, std::string_view browseName, const ReferenceTypeAttributes &attributes, const NodeId &referenceType) noexcept
Add reference type.
Result< NodeId > addProperty(T &connection, const NodeId &parentId, const NodeId &id, std::string_view browseName, const VariableAttributes &attributes) noexcept
Add property.
Result< NodeId > addView(T &connection, const NodeId &parentId, const NodeId &id, std::string_view browseName, const ViewAttributes &attributes, const NodeId &referenceType) noexcept
Add view.
auto addObjectAsync(Client &connection, const NodeId &parentId, const NodeId &id, std::string_view browseName, const ObjectAttributes &attributes, const NodeId &objectType, const NodeId &referenceType, CompletionToken &&token)
Add object.
auto addViewAsync(Client &connection, const NodeId &parentId, const NodeId &id, std::string_view browseName, const ViewAttributes &attributes, const NodeId &referenceType, CompletionToken &&token)
Add view.
Result< NodeId > addVariable(T &connection, const NodeId &parentId, const NodeId &id, std::string_view browseName, const VariableAttributes &attributes, const NodeId &variableType, const NodeId &referenceType) noexcept
Add variable.
StatusCode addModellingRule(T &connection, const NodeId &id, ModellingRule rule) noexcept
Add modelling rule.
auto addModellingRuleAsync(Client &connection, const NodeId &id, ModellingRule rule, CompletionToken &&token)
Add modelling rule.
auto addReferenceAsync(Client &connection, const NodeId &sourceId, const NodeId &targetId, const NodeId &referenceType, bool forward, CompletionToken &&token)
Add reference.
StatusCode addReference(T &connection, const NodeId &sourceId, const NodeId &targetId, const NodeId &referenceType, bool forward) noexcept
Add reference.
BrowseResponse browse(Client &connection, const BrowseRequest &request) noexcept
Discover the references of one or more nodes (client only).
Result< std::vector< ReferenceDescription > > browseAll(T &connection, const BrowseDescription &bd)
Discover all the references of a specified node (without calling browseNext).
Definition view.hpp:333
CallResponse call(Client &connection, const CallRequest &request) noexcept
Call server methods.
auto callAsync(Client &connection, const CallRequest &request, CompletionToken &&token)
Call server methods.
Definition method.hpp:49
auto deleteNodeAsync(Client &connection, const NodeId &id, bool deleteReferences, CompletionToken &&token)
Delete node.
StatusCode deleteNode(T &connection, const NodeId &id, bool deleteReferences) noexcept
Delete node.
auto deleteReferenceAsync(Client &connection, const NodeId &sourceId, const NodeId &targetId, const NodeId &referenceType, bool isForward, bool deleteBidirectional, CompletionToken &&token)
Delete reference.
StatusCode deleteReference(T &connection, const NodeId &sourceId, const NodeId &targetId, const NodeId &referenceType, bool isForward, bool deleteBidirectional) noexcept
Delete reference.
auto readDataValueAsync(Client &connection, const NodeId &id, CompletionToken &&token)
Read the AttributeId::Value attribute of a node as a DataValue object.
Result< bool > readContainsNoLoops(T &connection, const NodeId &id) noexcept
Read the AttributeId::ContainsNoLoops attribute of a node.
Result< double > readMinimumSamplingInterval(T &connection, const NodeId &id) noexcept
Read the AttributeId::MinimumSamplingInterval attribute of a node.
Result< NodeId > readDataType(T &connection, const NodeId &id) noexcept
Read the AttributeId::DataType attribute of a node.
Result< bool > readUserExecutable(T &connection, const NodeId &id) noexcept
Read the AttributeId::UserExecutable attribute of a node.
Result< LocalizedText > readInverseName(T &connection, const NodeId &id) noexcept
Read the AttributeId::InverseName attribute of a node.
Result< NodeClass > readNodeClass(T &connection, const NodeId &id) noexcept
Read the AttributeId::NodeClass attribute of a node.
auto readArrayDimensionsAsync(Client &connection, const NodeId &id, CompletionToken &&token)
Read the AttributeId::ArrayDimensions attribute of a node.
Result< Bitmask< EventNotifier > > readEventNotifier(T &connection, const NodeId &id) noexcept
Read the AttributeId::EventNotifier attribute of a node.
auto readDataTypeDefinitionAsync(Client &connection, const NodeId &id, CompletionToken &&token)
Read the AttributeId::DataTypeDefinition attribute of a node.
Result< DataValue > readDataValue(T &connection, const NodeId &id) noexcept
Read the AttributeId::Value attribute of a node as a DataValue object.
Result< Bitmask< WriteMask > > readUserWriteMask(T &connection, const NodeId &id) noexcept
Read the AttributeId::UserWriteMask attribute of a node.
Result< bool > readHistorizing(T &connection, const NodeId &id) noexcept
Read the AttributeId::Historizing attribute of a node.
auto readDescriptionAsync(Client &connection, const NodeId &id, CompletionToken &&token)
Read the AttributeId::Description attribute of a node.
auto readNodeClassAsync(Client &connection, const NodeId &id, CompletionToken &&token)
Read the AttributeId::NodeClass attribute of a node.
Result< LocalizedText > readDisplayName(T &connection, const NodeId &id) noexcept
Read the AttributeId::DisplayName attribute of a node.
auto readAccessLevelAsync(Client &connection, const NodeId &id, CompletionToken &&token)
Read the AttributeId::AccessLevel attribute of a node.
auto readUserExecutableAsync(Client &connection, const NodeId &id, CompletionToken &&token)
Read the AttributeId::UserExecutable attribute of a node.
Result< QualifiedName > readBrowseName(T &connection, const NodeId &id) noexcept
Read the AttributeId::BrowseName attribute of a node.
auto readEventNotifierAsync(Client &connection, const NodeId &id, CompletionToken &&token)
Read the AttributeId::EventNotifier attribute of a node.
auto readDisplayNameAsync(Client &connection, const NodeId &id, CompletionToken &&token)
Read the AttributeId::DisplayName attribute of a node.
Result< bool > readExecutable(T &connection, const NodeId &id) noexcept
Read the AttributeId::Executable attribute of a node.
auto readIsAbstractAsync(Client &connection, const NodeId &id, CompletionToken &&token)
Read the AttributeId::IsAbstract attribute of a node.
auto readDataTypeAsync(Client &connection, const NodeId &id, CompletionToken &&token)
Read the AttributeId::DataType attribute of a node.
auto readWriteMaskAsync(Client &connection, const NodeId &id, CompletionToken &&token)
Read the AttributeId::WriteMask attribute of a node.
auto readUserWriteMaskAsync(Client &connection, const NodeId &id, CompletionToken &&token)
Read the AttributeId::UserWriteMask attribute of a node.
Result< Variant > readDataTypeDefinition(T &connection, const NodeId &id) noexcept
Read the AttributeId::DataTypeDefinition attribute of a node.
Result< Bitmask< WriteMask > > readWriteMask(T &connection, const NodeId &id) noexcept
Read the AttributeId::WriteMask attribute of a node.
auto readExecutableAsync(Client &connection, const NodeId &id, CompletionToken &&token)
Read the AttributeId::Executable attribute of a node.
Result< LocalizedText > readDescription(T &connection, const NodeId &id) noexcept
Read the AttributeId::Description attribute of a node.
Result< Variant > readValue(T &connection, const NodeId &id) noexcept
Read the AttributeId::Value attribute of a node.
auto readContainsNoLoopsAsync(Client &connection, const NodeId &id, CompletionToken &&token)
Read the AttributeId::ContainsNoLoops attribute of a node.
auto readSymmetricAsync(Client &connection, const NodeId &id, CompletionToken &&token)
Read the AttributeId::Symmetric attribute of a node.
auto readMinimumSamplingIntervalAsync(Client &connection, const NodeId &id, CompletionToken &&token)
Read the AttributeId::MinimumSamplingInterval attribute of a node.
auto readUserAccessLevelAsync(Client &connection, const NodeId &id, CompletionToken &&token)
Read the AttributeId::UserAccessLevel attribute of a node.
auto readHistorizingAsync(Client &connection, const NodeId &id, CompletionToken &&token)
Read the AttributeId::Historizing attribute of a node.
Result< ValueRank > readValueRank(T &connection, const NodeId &id) noexcept
Read the AttributeId::ValueRank attribute of a node.
auto readBrowseNameAsync(Client &connection, const NodeId &id, CompletionToken &&token)
Read the AttributeId::BrowseName attribute of a node.
Result< bool > readIsAbstract(T &connection, const NodeId &id) noexcept
Read the AttributeId::IsAbstract attribute of a node.
auto readValueAsync(Client &connection, const NodeId &id, CompletionToken &&token)
Read the AttributeId::Value attribute of a node.
Result< bool > readSymmetric(T &connection, const NodeId &id) noexcept
Read the AttributeId::Symmetric attribute of a node.
Result< Bitmask< AccessLevel > > readUserAccessLevel(T &connection, const NodeId &id) noexcept
Read the AttributeId::UserAccessLevel attribute of a node.
Result< Bitmask< AccessLevel > > readAccessLevel(T &connection, const NodeId &id) noexcept
Read the AttributeId::AccessLevel attribute of a node.
Result< std::vector< uint32_t > > readArrayDimensions(T &connection, const NodeId &id) noexcept
Read the AttributeId::ArrayDimensions attribute of a node.
auto readInverseNameAsync(Client &connection, const NodeId &id, CompletionToken &&token)
Read the AttributeId::InverseName attribute of a node.
auto readValueRankAsync(Client &connection, const NodeId &id, CompletionToken &&token)
Read the AttributeId::ValueRank attribute of a node.
BrowsePathResult translateBrowsePathToNodeIds(T &connection, const BrowsePath &browsePath) noexcept
Translate a browse path to NodeIds.
BrowsePathResult browseSimplifiedBrowsePath(T &connection, const NodeId &origin, Span< const QualifiedName > browsePath)
A simplified version of translateBrowsePathToNodeIds.
Definition view.hpp:230
BrowseDirection
Browse direction.
Definition types.hpp:995
StatusCode writeDataType(T &connection, const NodeId &id, const NodeId &dataType) noexcept
Write the AttributeId::DataType attribute of a node.
StatusCode writeHistorizing(T &connection, const NodeId &id, bool historizing) noexcept
Write the AttributeId::Historizing attribute of a node.
StatusCode writeUserWriteMask(T &connection, const NodeId &id, Bitmask< WriteMask > userWriteMask) noexcept
Write the AttributeId::UserWriteMask attribute of a node.
auto writeAccessLevelAsync(Client &connection, const NodeId &id, Bitmask< AccessLevel > accessLevel, CompletionToken &&token)
Write the AttributeId::AccessLevel attribute of a node.
StatusCode writeContainsNoLoops(T &connection, const NodeId &id, const bool &containsNoLoops) noexcept
Write the AttributeId::ContainsNoLoops attribute of a node.
StatusCode writeArrayDimensions(T &connection, const NodeId &id, Span< const uint32_t > arrayDimensions) noexcept
Write the AttributeId::ArrayDimensions attribute of a node.
auto writeHistorizingAsync(Client &connection, const NodeId &id, bool historizing, CompletionToken &&token)
Write the AttributeId::Historizing attribute of a node.
auto writeEventNotifierAsync(Client &connection, const NodeId &id, Bitmask< EventNotifier > eventNotifier, CompletionToken &&token)
Write the AttributeId::EventNotifier attribute of a node.
StatusCode writeEventNotifier(T &connection, const NodeId &id, Bitmask< EventNotifier > eventNotifier) noexcept
Write the AttributeId::EventNotifier attribute of a node.
StatusCode writeExecutable(T &connection, const NodeId &id, bool executable) noexcept
Write the AttributeId::Executable attribute of a node.
auto writeDataValueAsync(Client &connection, const NodeId &id, const DataValue &value, CompletionToken &&token)
Write the AttributeId::Value attribute of a node as a DataValue object.
StatusCode writeIsAbstract(T &connection, const NodeId &id, bool isAbstract) noexcept
Write the AttributeId::IsAbstract attribute of a node.
auto writeArrayDimensionsAsync(Client &connection, const NodeId &id, Span< const uint32_t > arrayDimensions, CompletionToken &&token)
Write the AttributeId::ArrayDimensions attribute of a node.
StatusCode writeValue(T &connection, const NodeId &id, const Variant &value) noexcept
Write the AttributeId::Value attribute of a node.
StatusCode writeDataValue(T &connection, const NodeId &id, const DataValue &value) noexcept
Write the AttributeId::Value attribute of a node as a DataValue object.
auto writeContainsNoLoopsAsync(Client &connection, const NodeId &id, const bool &containsNoLoops, CompletionToken &&token)
Write the AttributeId::ContainsNoLoops attribute of a node.
StatusCode writeValueRank(T &connection, const NodeId &id, ValueRank valueRank) noexcept
Write the AttributeId::ValueRank attribute of a node.
auto writeUserWriteMaskAsync(Client &connection, const NodeId &id, Bitmask< WriteMask > userWriteMask, CompletionToken &&token)
Write the AttributeId::UserWriteMask attribute of a node.
auto writeValueRankAsync(Client &connection, const NodeId &id, ValueRank valueRank, CompletionToken &&token)
Write the AttributeId::ValueRank attribute of a node.
StatusCode writeInverseName(T &connection, const NodeId &id, const LocalizedText &inverseName) noexcept
Write the AttributeId::InverseName attribute of a node.
auto writeDataTypeAsync(Client &connection, const NodeId &id, const NodeId &dataType, CompletionToken &&token)
Write the AttributeId::DataType attribute of a node.
auto writeDisplayNameAsync(Client &connection, const NodeId &id, const LocalizedText &displayName, CompletionToken &&token)
Write the AttributeId::DisplayName attribute of a node.
auto writeInverseNameAsync(Client &connection, const NodeId &id, const LocalizedText &inverseName, CompletionToken &&token)
Write the AttributeId::InverseName attribute of a node.
StatusCode writeDescription(T &connection, const NodeId &id, const LocalizedText &description) noexcept
Write the AttributeId::Description attribute of a node.
StatusCode writeDisplayName(T &connection, const NodeId &id, const LocalizedText &displayName) noexcept
Write the AttributeId::DisplayName attribute of a node.
StatusCode writeUserAccessLevel(T &connection, const NodeId &id, Bitmask< AccessLevel > userAccessLevel) noexcept
Write the AttributeId::UserAccessLevel attribute of a node.
StatusCode writeMinimumSamplingInterval(T &connection, const NodeId &id, double minimumSamplingInterval) noexcept
Write the AttributeId::MinimumSamplingInterval attribute of a node.
auto writeSymmetricAsync(Client &connection, const NodeId &id, bool symmetric, CompletionToken &&token)
Write the AttributeId::Symmetric attribute of a node.
StatusCode writeWriteMask(T &connection, const NodeId &id, Bitmask< WriteMask > writeMask) noexcept
Write the AttributeId::WriteMask attribute of a node.
auto writeMinimumSamplingIntervalAsync(Client &connection, const NodeId &id, double minimumSamplingInterval, CompletionToken &&token)
Write the AttributeId::MinimumSamplingInterval attribute of a node.
StatusCode writeSymmetric(T &connection, const NodeId &id, bool symmetric) noexcept
Write the AttributeId::Symmetric attribute of a node.
StatusCode writeAccessLevel(T &connection, const NodeId &id, Bitmask< AccessLevel > accessLevel) noexcept
Write the AttributeId::AccessLevel attribute of a node.
StatusCode writeUserExecutable(T &connection, const NodeId &id, bool userExecutable) noexcept
Write the AttributeId::UserExecutable attribute of a node.
auto writeValueAsync(Client &connection, const NodeId &id, const Variant &value, CompletionToken &&token)
Write the AttributeId::Value attribute of a node.
auto writeWriteMaskAsync(Client &connection, const NodeId &id, Bitmask< WriteMask > writeMask, CompletionToken &&token)
Write the AttributeId::WriteMask attribute of a node.
auto writeIsAbstractAsync(Client &connection, const NodeId &id, bool isAbstract, CompletionToken &&token)
Write the AttributeId::IsAbstract attribute of a node.
auto writeDescriptionAsync(Client &connection, const NodeId &id, const LocalizedText &description, CompletionToken &&token)
Write the AttributeId::Description attribute of a node.
auto writeUserExecutableAsync(Client &connection, const NodeId &id, bool userExecutable, CompletionToken &&token)
Write the AttributeId::UserExecutable attribute of a node.
auto writeExecutableAsync(Client &connection, const NodeId &id, bool executable, CompletionToken &&token)
Write the AttributeId::Executable attribute of a node.
auto writeUserAccessLevelAsync(Client &connection, const NodeId &id, Bitmask< AccessLevel > userAccessLevel, CompletionToken &&token)
Write the AttributeId::UserAccessLevel attribute of a node.
NodeClass
Node class.
Definition common.hpp:71
ValueRank
Value rank.
Definition common.hpp:157
ModellingRule
Modelling rules.
Definition common.hpp:190
#define UA_STATUSCODE_BADNOTFOUND
#define UA_STATUSCODE_BADNODEIDUNKNOWN
#define UA_STATUSCODE_BADNOMATCH
Future completion token type.
Definition async.hpp:54
If a reference is symmetric
Definition symmetric.dox:1