open62541 1.4.15
Open source implementation of OPC UA
Loading...
Searching...
No Matches
nodestore.h
Go to the documentation of this file.
1/** This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
4 *
5 * Copyright 2017, 2021 (c) Fraunhofer IOSB (Author: Julius Pfrommer)
6 * Copyright 2017 (c) Julian Grothoff
7 * Copyright 2017 (c) Stefan Profanter, fortiss GmbH
8 */
9
10#ifndef UA_NODESTORE_H_
11#define UA_NODESTORE_H_
12
13/** !!! Warning !!!
14 *
15 * If you are not developing a nodestore plugin, then you should not work with
16 * the definitions from this file directly. The underlying node structures are
17 * not meant to be used directly by end users. Please use the public server API
18 * / OPC UA services to interact with the information model. */
19
20#include <open62541/util.h>
21
23
24/** Forward declaration */
25#ifdef UA_ENABLE_SUBSCRIPTIONS
26struct UA_MonitoredItem;
28#endif
29
30
31
32typedef struct {
33 /* Can be NULL. May replace the nodeContext */
34 UA_StatusCode (*constructor)(UA_Server *server,
35 const UA_NodeId *sessionId, void *sessionContext,
36 const UA_NodeId *nodeId, void **nodeContext);
37
38 /* Can be NULL. The context cannot be replaced since the node is destroyed
39 * immediately afterwards anyway. */
40 void (*destructor)(UA_Server *server,
41 const UA_NodeId *sessionId, void *sessionContext,
42 const UA_NodeId *nodeId, void *nodeContext);
43
44 /* Can be NULL. Called during recursive node instantiation. While mandatory
45 * child nodes are automatically created if not already present, optional child
46 * nodes are not. This callback can be used to define whether an optional child
47 * node should be created.
48 *
49 * @param server The server executing the callback
50 * @param sessionId The identifier of the session
51 * @param sessionContext Additional data attached to the session in the
52 * access control layer
53 * @param sourceNodeId Source node from the type definition. If the new node
54 * shall be created, it will be a copy of this node.
55 * @param targetParentNodeId Parent of the potential new child node
56 * @param referenceTypeId Identifies the reference type which that the parent
57 * node has to the new node.
58 * @return Return UA_TRUE if the child node shall be instantiated,
59 * UA_FALSE otherwise. */
60 UA_Boolean (*createOptionalChild)(UA_Server *server,
61 const UA_NodeId *sessionId,
62 void *sessionContext,
63 const UA_NodeId *sourceNodeId,
64 const UA_NodeId *targetParentNodeId,
65 const UA_NodeId *referenceTypeId);
66
67 /* Can be NULL. Called when a node is to be copied during recursive
68 * node instantiation. Allows definition of the NodeId for the new node.
69 * If the callback is set to NULL or the resulting NodeId is UA_NODEID_NUMERIC(X,0)
70 * an unused nodeid in namespace X will be used. E.g. passing UA_NODEID_NULL will
71 * result in a NodeId in namespace 0.
72 *
73 * @param server The server executing the callback
74 * @param sessionId The identifier of the session
75 * @param sessionContext Additional data attached to the session in the
76 * access control layer
77 * @param sourceNodeId Source node of the copy operation
78 * @param targetParentNodeId Parent node of the new node
79 * @param referenceTypeId Identifies the reference type which that the parent
80 * node has to the new node. */
81 UA_StatusCode (*generateChildNodeId)(UA_Server *server,
82 const UA_NodeId *sessionId, void *sessionContext,
83 const UA_NodeId *sourceNodeId,
84 const UA_NodeId *targetParentNodeId,
85 const UA_NodeId *referenceTypeId,
86 UA_NodeId *targetNodeId);
88
89
90typedef struct {
91 /* Can be NULL. May replace the nodeContext */
92 UA_StatusCode (*constructor)(UA_Server *server,
93 const UA_NodeId *sessionId, void *sessionContext,
94 const UA_NodeId *typeNodeId, void *typeNodeContext,
95 const UA_NodeId *nodeId, void **nodeContext);
96
97 /* Can be NULL. May replace the nodeContext. */
98 void (*destructor)(UA_Server *server,
99 const UA_NodeId *sessionId, void *sessionContext,
100 const UA_NodeId *typeNodeId, void *typeNodeContext,
101 const UA_NodeId *nodeId, void **nodeContext);
103
104
105#define UA_REFERENCETYPEINDEX_REFERENCES 0
106#define UA_REFERENCETYPEINDEX_HASSUBTYPE 1
107#define UA_REFERENCETYPEINDEX_AGGREGATES 2
108#define UA_REFERENCETYPEINDEX_HIERARCHICALREFERENCES 3
109#define UA_REFERENCETYPEINDEX_NONHIERARCHICALREFERENCES 4
110#define UA_REFERENCETYPEINDEX_HASCHILD 5
111#define UA_REFERENCETYPEINDEX_ORGANIZES 6
112#define UA_REFERENCETYPEINDEX_HASEVENTSOURCE 7
113#define UA_REFERENCETYPEINDEX_HASMODELLINGRULE 8
114#define UA_REFERENCETYPEINDEX_HASENCODING 9
115#define UA_REFERENCETYPEINDEX_HASDESCRIPTION 10
116#define UA_REFERENCETYPEINDEX_HASTYPEDEFINITION 11
117#define UA_REFERENCETYPEINDEX_GENERATESEVENT 12
118#define UA_REFERENCETYPEINDEX_HASPROPERTY 13
119#define UA_REFERENCETYPEINDEX_HASCOMPONENT 14
120#define UA_REFERENCETYPEINDEX_HASNOTIFIER 15
121#define UA_REFERENCETYPEINDEX_HASORDEREDCOMPONENT 16
122#define UA_REFERENCETYPEINDEX_HASINTERFACE 17
123
124/** The maximum number of ReferrenceTypes. Must be a multiple of 32. */
125#define UA_REFERENCETYPESET_MAX 128
129
130UA_EXPORT extern const UA_ReferenceTypeSet UA_REFERENCETYPESET_NONE;
131UA_EXPORT extern const UA_ReferenceTypeSet UA_REFERENCETYPESET_ALL;
132
133static void
134UA_ReferenceTypeSet_init(UA_ReferenceTypeSet *set) {
135 memset(set, 0, sizeof(UA_ReferenceTypeSet));
136}
137
139UA_REFTYPESET(UA_Byte index) {
140 UA_Byte i = index / 32, j = index % 32;
142 UA_ReferenceTypeSet_init(&set);
143 set.bits[i] |= ((UA_UInt32)1) << j;
144 return set;
145}
146
148UA_ReferenceTypeSet_union(const UA_ReferenceTypeSet setA,
149 const UA_ReferenceTypeSet setB) {
151 for(size_t i = 0; i < UA_REFERENCETYPESET_MAX / 32; i++)
152 set.bits[i] = setA.bits[i] | setB.bits[i];
153 return set;
154}
155
156static UA_Boolean
157UA_ReferenceTypeSet_contains(const UA_ReferenceTypeSet *set, UA_Byte index) {
158 UA_Byte i = index / 32, j = index % 32;
159 return !!(set->bits[i] & (((UA_UInt32)1) << j));
160}
161
162
163
164/** Forward declaration. All node structures begin with the NodeHead. */
165struct UA_NodeHead;
167
168/** Tagged Pointer structure. */
169typedef union {
170 uintptr_t immediate; /* 00: Small numerical NodeId */
171 const UA_NodeId *id; /* 01: Pointer to NodeId */
172 const UA_ExpandedNodeId *expandedId; /* 10: Pointer to ExternalNodeId */
173 const UA_NodeHead *node; /* 11: Pointer to a node */
175
176/** Sets the pointer to an immediate NodeId "ns=0;i=0" similar to a freshly
177 * initialized UA_NodeId */
178static void
179UA_NodePointer_init(UA_NodePointer *np) { np->immediate = 0; }
180
181/** NodeId and ExpandedNodeId targets are freed */
182void
184
185/** Makes a deep copy */
188
189/** Test if an ExpandedNodeId or a local NodeId */
192
195
196static UA_Boolean
197UA_NodePointer_equal(UA_NodePointer p1, UA_NodePointer p2) {
198 return (UA_NodePointer_order(p1, p2) == UA_ORDER_EQ);
199}
200
201/** Cannot fail. The resulting NodePointer can point to the memory from the
202 * NodeId. Make a deep copy if required. */
205
206/** Cannot fail. The resulting NodePointer can point to the memory from the
207 * ExpandedNodeId. Make a deep copy if required. */
210
211/** Can point to the memory from the NodePointer */
214
215/** Can point to the memory from the NodePointer. Discards the ServerIndex and
216 * NamespaceUri of a potential ExpandedNodeId inside the NodePointer. Test
217 * before if the NodePointer is local. */
220
221
222
223typedef struct {
224 UA_NodePointer targetId; /* Has to be the first entry */
225 UA_UInt32 targetNameHash; /* Hash of the target's BrowseName. Set to zero
226 * if the target is remote. */
228
241
242
243/** List of reference targets with the same reference type and direction. Uses
244 * either an array or a tree structure. The SDK will not change the type of
245 * reference target structure internally. The nodestore implementations may
246 * switch internally when a node is updated.
247 *
248 * The recommendation is to switch to a tree once the number of refs > 8. */
249typedef struct {
250 union {
251 /* Organize the references in an array. Uses less memory, but incurs
252 * lookups in linear time. Recommended if the number of references is
253 * known to be small. */
255
256 /* Organize the references in a tree for fast lookup. Use
257 * UA_Node_addReference and UA_Node_deleteReference to modify the
258 * tree-structure. The binary tree implementation (and absolute ordering
259 * / duplicate browseNames are allowed) are not exposed otherwise in the
260 * public API. */
261 struct {
262 UA_ReferenceTargetTreeElem *idRoot; /* Lookup based on target id */
263 UA_ReferenceTargetTreeElem *nameRoot; /* Lookup based on browseName*/
264 } tree;
265 } targets;
267 UA_Boolean hasRefTree; /* RefTree or RefArray? */
271
272/** Iterate over the references. Aborts when the first callback return a non-NULL
273 * pointer and returns that pointer. Do not modify the reference targets during
274 * the iteration. */
275typedef void *
276(*UA_NodeReferenceKind_iterateCallback)(void *context, UA_ReferenceTarget *target);
277
278UA_EXPORT void *
281 void *context);
282
283/** Returns the entry for the targetId or NULL if not found */
284UA_EXPORT const UA_ReferenceTarget *
286 const UA_ExpandedNodeId *targetId);
287
288/** Switch between array and tree representation. Does nothing upon error (e.g.
289 * out-of-memory). */
290UA_EXPORT UA_StatusCode
292
293/** Singly-linked LocalizedText list */
298
299/** Every Node starts with these attributes */
304
305 /* A node can have different localizations for displayName and description.
306 * The server selects a suitable localization depending on the locale ids
307 * that are set for the current session.
308 *
309 * Locales are added simply by writing a LocalizedText value with a new
310 * locale. A locale can be removed by writing a LocalizedText value of the
311 * corresponding locale with an empty text field. */
314
318
319 /* Members specific to open62541 */
320 void *context;
321 UA_Boolean constructed; /* Constructors were called */
322#ifdef UA_ENABLE_SUBSCRIPTIONS
323 UA_MonitoredItem *monitoredItems; /* MonitoredItems for Events and immediate
324 * DataChanges (no sampling interval). */
325#endif
326};
327
328
329
330/** Indicates whether a variable contains data inline or whether it points to an
331 * external data source */
336
337typedef struct {
338 /* Called before the value attribute is read. It is possible to write into the
339 * value attribute during onRead (using the write service). The node is
340 * re-opened afterwards so that changes are considered in the following read
341 * operation.
342 *
343 * @param handle Points to user-provided data for the callback.
344 * @param nodeid The identifier of the node.
345 * @param data Points to the current node value.
346 * @param range Points to the numeric range the client wants to read from
347 * (or NULL). */
348 void (*onRead)(UA_Server *server, const UA_NodeId *sessionId,
349 void *sessionContext, const UA_NodeId *nodeid,
350 void *nodeContext, const UA_NumericRange *range,
351 const UA_DataValue *value);
352
353 /* Called after writing the value attribute. The node is re-opened after
354 * writing so that the new value is visible in the callback.
355 *
356 * @param server The server executing the callback
357 * @sessionId The identifier of the session
358 * @sessionContext Additional data attached to the session
359 * in the access control layer
360 * @param nodeid The identifier of the node.
361 * @param nodeUserContext Additional data attached to the node by
362 * the user.
363 * @param nodeConstructorContext Additional data attached to the node
364 * by the type constructor(s).
365 * @param range Points to the numeric range the client wants to write to (or
366 * NULL). */
367 void (*onWrite)(UA_Server *server, const UA_NodeId *sessionId,
368 void *sessionContext, const UA_NodeId *nodeId,
369 void *nodeContext, const UA_NumericRange *range,
370 const UA_DataValue *data);
372
373typedef struct {
374 /* Copies the data from the source into the provided value.
375 *
376 * !! ZERO-COPY OPERATIONS POSSIBLE !!
377 * It is not required to return a copy of the actual content data. You can
378 * return a pointer to memory owned by the user. Memory can be reused
379 * between read callbacks of a DataSource, as the result is already encoded
380 * on the network buffer between each read operation.
381 *
382 * To use zero-copy reads, set the value of the `value->value` Variant
383 * without copying, e.g. with `UA_Variant_setScalar`. Then, also set
384 * `value->value.storageType` to `UA_VARIANT_DATA_NODELETE` to prevent the
385 * memory being cleaned up. Don't forget to also set `value->hasValue` to
386 * true to indicate the presence of a value.
387 *
388 * @param server The server executing the callback
389 * @param sessionId The identifier of the session
390 * @param sessionContext Additional data attached to the session in the
391 * access control layer
392 * @param nodeId The identifier of the node being read from
393 * @param nodeContext Additional data attached to the node by the user
394 * @param includeSourceTimeStamp If true, then the datasource is expected to
395 * set the source timestamp in the returned value
396 * @param range If not null, then the datasource shall return only a
397 * selection of the (nonscalar) data. Set
398 * UA_STATUSCODE_BADINDEXRANGEINVALID in the value if this does not
399 * apply
400 * @param value The (non-null) DataValue that is returned to the client. The
401 * data source sets the read data, the result status and optionally a
402 * sourcetimestamp.
403 * @return Returns a status code for logging. Error codes intended for the
404 * original caller are set in the value. If an error is returned,
405 * then no releasing of the value is done
406 */
407 UA_StatusCode (*read)(UA_Server *server, const UA_NodeId *sessionId,
408 void *sessionContext, const UA_NodeId *nodeId,
409 void *nodeContext, UA_Boolean includeSourceTimeStamp,
410 const UA_NumericRange *range, UA_DataValue *value);
411
412 /* Write into a data source. This method pointer can be NULL if the
413 * operation is unsupported.
414 *
415 * @param server The server executing the callback
416 * @param sessionId The identifier of the session
417 * @param sessionContext Additional data attached to the session in the
418 * access control layer
419 * @param nodeId The identifier of the node being written to
420 * @param nodeContext Additional data attached to the node by the user
421 * @param range If not NULL, then the datasource shall return only a
422 * selection of the (nonscalar) data. Set
423 * UA_STATUSCODE_BADINDEXRANGEINVALID in the value if this does not
424 * apply
425 * @param value The (non-NULL) DataValue that has been written by the client.
426 * The data source contains the written data, the result status and
427 * optionally a sourcetimestamp
428 * @return Returns a status code for logging. Error codes intended for the
429 * original caller are set in the value. If an error is returned,
430 * then no releasing of the value is done
431 */
432 UA_StatusCode (*write)(UA_Server *server, const UA_NodeId *sessionId,
433 void *sessionContext, const UA_NodeId *nodeId,
434 void *nodeContext, const UA_NumericRange *range,
435 const UA_DataValue *value);
437
438
439typedef struct {
440 /* Called before the value attribute is read. The external value source can be
441 * be updated and/or locked during this notification call. After this function returns
442 * to the core, the external value source is readed immediately.
443 */
444 UA_StatusCode (*notificationRead)(UA_Server *server, const UA_NodeId *sessionId,
445 void *sessionContext, const UA_NodeId *nodeid,
446 void *nodeContext, const UA_NumericRange *range);
447
448 /* Called after writing the value attribute. The node is re-opened after
449 * writing so that the new value is visible in the callback.
450 *
451 * @param server The server executing the callback
452 * @sessionId The identifier of the session
453 * @sessionContext Additional data attached to the session
454 * in the access control layer
455 * @param nodeid The identifier of the node.
456 * @param nodeUserContext Additional data attached to the node by
457 * the user.
458 * @param nodeConstructorContext Additional data attached to the node
459 * by the type constructor(s).
460 * @param range Points to the numeric range the client wants to write to (or
461 * NULL). */
462 UA_StatusCode (*userWrite)(UA_Server *server, const UA_NodeId *sessionId,
463 void *sessionContext, const UA_NodeId *nodeId,
464 void *nodeContext, const UA_NumericRange *range,
465 const UA_DataValue *data);
467
474
489
490#define UA_NODE_VARIABLEATTRIBUTES \
491 /* Constraints on possible values */ \
492 UA_NodeId dataType; \
493 UA_Int32 valueRank; \
494 size_t arrayDimensionsSize; \
495 UA_UInt32 *arrayDimensions; \
496 \
497 UA_ValueBackend valueBackend; \
498 \
499 /* The current value */ \
500 UA_ValueSource valueSource; \
501 union { \
502 struct { \
503 UA_DataValue value; \
504 UA_ValueCallback callback; \
505 } data; \
506 UA_DataSource dataSource; \
507 } value;
508
509typedef struct {
515
516 /* Members specific to open62541 */
517 UA_Boolean isDynamic; /* Some variables are "static" in the sense that they
518 * are not attached to a dynamic process in the
519 * background. Only dynamic variables conserve source
520 * and server timestamp for the value attribute.
521 * Static variables have timestamps of "now". */
523
524
525
534
535
536
538(*UA_MethodCallback)(UA_Server *server, const UA_NodeId *sessionId,
539 void *sessionContext, const UA_NodeId *methodId,
540 void *methodContext, const UA_NodeId *objectId,
541 void *objectContext, size_t inputSize,
542 const UA_Variant *input, size_t outputSize,
543 UA_Variant *output);
544
545typedef struct {
548
549 /* Members specific to open62541 */
551#if UA_MULTITHREADING >= 100
552 UA_Boolean async; /* Indicates an async method call */
553#endif
555
556
557
562
563
564
565typedef struct {
568
569 /* Members specific to open62541 */
572
573
574
575typedef struct {
580
581 /* Members specific to open62541 */
583 UA_ReferenceTypeSet subTypes; /* contains the type itself as well */
585
586
587
592
593
594
600
601
602
614
615
616
617typedef void (*UA_NodestoreVisitor)(void *visitorCtx, const UA_Node *node);
618
619typedef struct {
620 /* Nodestore context and lifecycle */
621 void *context;
622 void (*clear)(void *nsCtx);
623
624 /* The following definitions are used to create empty nodes of the different
625 * node types. The memory is managed by the nodestore. Therefore, the node
626 * has to be removed via a special deleteNode function. (If the new node is
627 * not added to the nodestore.) */
628 UA_Node * (*newNode)(void *nsCtx, UA_NodeClass nodeClass);
629
630 void (*deleteNode)(void *nsCtx, UA_Node *node);
631
632 /* ``Get`` returns a pointer to an immutable node. Call ``releaseNode`` to
633 * indicate when the pointer is no longer accessed.
634 *
635 * It can be indicated if only a subset of the attributes and referencs need
636 * to be accessed. That is relevant when the nodestore accesses a slow
637 * storage backend for the attributes. The attribute mask is a bitfield with
638 * ORed entries from UA_NodeAttributesMask.
639 *
640 * The returned node always contains the context-pointer and other fields
641 * specific to open626541 (not official attributes).
642 *
643 * The NodeStore does not complain if attributes and references that don't
644 * exist (for that node) are requested. Attributes and references in
645 * addition to those specified can be returned. For example, if the full
646 * node already is kept in memory by the Nodestore. */
647 const UA_Node * (*getNode)(void *nsCtx, const UA_NodeId *nodeId,
648 UA_UInt32 attributeMask,
649 UA_ReferenceTypeSet references,
650 UA_BrowseDirection referenceDirections);
651
652 /* Similar to the normal ``getNode``. But it can take advantage of the
653 * NodePointer structure, e.g. if it contains a direct pointer. */
654 const UA_Node * (*getNodeFromPtr)(void *nsCtx, UA_NodePointer ptr,
655 UA_UInt32 attributeMask,
656 UA_ReferenceTypeSet references,
657 UA_BrowseDirection referenceDirections);
658
659 /* Release a node that has been retrieved with ``getNode`` or
660 * ``getNodeFromPtr``. */
661 void (*releaseNode)(void *nsCtx, const UA_Node *node);
662
663 /* Returns an editable copy of a node (needs to be deleted with the
664 * deleteNode function or inserted / replaced into the nodestore). */
665 UA_StatusCode (*getNodeCopy)(void *nsCtx, const UA_NodeId *nodeId,
666 UA_Node **outNode);
667
668 /* Inserts a new node into the nodestore. If the NodeId is zero, then a
669 * fresh numeric NodeId is assigned. If insertion fails, the node is
670 * deleted. */
671 UA_StatusCode (*insertNode)(void *nsCtx, UA_Node *node,
672 UA_NodeId *addedNodeId);
673
674 /* To replace a node, get an editable copy of the node, edit and replace
675 * with this function. If the node was already replaced since the copy was
676 * made, UA_STATUSCODE_BADINTERNALERROR is returned. If the NodeId is not
677 * found, UA_STATUSCODE_BADNODEIDUNKNOWN is returned. In both error cases,
678 * the editable node is deleted. */
679 UA_StatusCode (*replaceNode)(void *nsCtx, UA_Node *node);
680
681 /* Removes a node from the nodestore. */
682 UA_StatusCode (*removeNode)(void *nsCtx, const UA_NodeId *nodeId);
683
684 /* Maps the ReferenceTypeIndex used for the references to the NodeId of the
685 * ReferenceType. The returned pointer is stable until the Nodestore is
686 * deleted. */
687 const UA_NodeId * (*getReferenceTypeId)(void *nsCtx, UA_Byte refTypeIndex);
688
689 /* Execute a callback for every node in the nodestore. */
690 void (*iterate)(void *nsCtx, UA_NodestoreVisitor visitor,
691 void *visitorCtx);
693
694/** Attributes must be of a matching type (VariableAttributes, ObjectAttributes,
695 * and so on). The attributes are copied. Note that the attributes structs do
696 * not contain NodeId, NodeClass and BrowseName. The NodeClass of the node needs
697 * to be correctly set before calling this method. UA_Node_clear is called on
698 * the node when an error occurs internally. */
700UA_Node_setAttributes(UA_Node *node, const void *attributes,
701 const UA_DataType *attributeType);
702
703/** Reset the destination node and copy the content of the source */
706
707/** Allocate new node and copy the values from src */
708UA_EXPORT UA_Node *
710
711/** Add a single reference to the node */
713UA_Node_addReference(UA_Node *node, UA_Byte refTypeIndex, UA_Boolean isForward,
714 const UA_ExpandedNodeId *targetNodeId,
715 UA_UInt32 targetBrowseNameHash);
716
717/** Delete a single reference from the node */
719UA_Node_deleteReference(UA_Node *node, UA_Byte refTypeIndex, UA_Boolean isForward,
720 const UA_ExpandedNodeId *targetNodeId);
721
722/** Deletes references from the node which are not matching any type in the given
723 * array. Could be used to e.g. delete all the references, except
724 * 'HASMODELINGRULE' */
725void
727
728/** Delete all references of the node */
729void
731
732/** Remove all malloc'ed members of the node and reset */
733void
735
737
738#endif /* UA_NODESTORE_H_ */
struct UA_Server UA_Server
Definition common.h:198
UA_Order
Definition common.h:114
@ UA_ORDER_EQ
Definition common.h:116
#define _UA_BEGIN_DECLS
#undef UA_DEBUG_DUMP_PKGS
Definition config.h:100
#define _UA_END_DECLS
Definition config.h:107
void UA_Node_deleteReferences(UA_Node *node)
Delete all references of the node.
UA_EXPORT const UA_ReferenceTarget * UA_NodeReferenceKind_findTarget(const UA_NodeReferenceKind *rk, const UA_ExpandedNodeId *targetId)
Returns the entry for the targetId or NULL if not found.
UA_Order UA_NodePointer_order(UA_NodePointer p1, UA_NodePointer p2)
UA_EXPORT void * UA_NodeReferenceKind_iterate(UA_NodeReferenceKind *rk, UA_NodeReferenceKind_iterateCallback callback, void *context)
UA_NodePointer UA_NodePointer_fromNodeId(const UA_NodeId *id)
Cannot fail.
void(* UA_NodestoreVisitor)(void *visitorCtx, const UA_Node *node)
Definition nodestore.h:617
UA_NodeId UA_NodePointer_toNodeId(UA_NodePointer np)
Can point to the memory from the NodePointer.
UA_StatusCode UA_Node_setAttributes(UA_Node *node, const void *attributes, const UA_DataType *attributeType)
Attributes must be of a matching type (VariableAttributes, ObjectAttributes, and so on).
UA_EXPORT UA_StatusCode UA_NodeReferenceKind_switch(UA_NodeReferenceKind *rk)
Switch between array and tree representation.
void UA_Node_deleteReferencesSubset(UA_Node *node, const UA_ReferenceTypeSet *keepSet)
Deletes references from the node which are not matching any type in the given array.
UA_EXPORT UA_Node * UA_Node_copy_alloc(const UA_Node *src)
Allocate new node and copy the values from src.
UA_NodePointer UA_NodePointer_fromExpandedNodeId(const UA_ExpandedNodeId *id)
Cannot fail.
struct UA_MonitoredItem UA_MonitoredItem
Definition nodestore.h:27
#define UA_REFERENCETYPESET_MAX
The maximum number of ReferrenceTypes.
Definition nodestore.h:125
UA_ValueBackendType
Definition nodestore.h:468
@ UA_VALUEBACKENDTYPE_INTERNAL
Definition nodestore.h:470
@ UA_VALUEBACKENDTYPE_DATA_SOURCE_CALLBACK
Definition nodestore.h:471
@ UA_VALUEBACKENDTYPE_EXTERNAL
Definition nodestore.h:472
@ UA_VALUEBACKENDTYPE_NONE
Definition nodestore.h:469
UA_StatusCode UA_NodePointer_copy(UA_NodePointer in, UA_NodePointer *out)
Makes a deep copy.
void UA_NodePointer_clear(UA_NodePointer *np)
NodeId and ExpandedNodeId targets are freed.
UA_StatusCode(* UA_MethodCallback)(UA_Server *server, const UA_NodeId *sessionId, void *sessionContext, const UA_NodeId *methodId, void *methodContext, const UA_NodeId *objectId, void *objectContext, size_t inputSize, const UA_Variant *input, size_t outputSize, UA_Variant *output)
Definition nodestore.h:538
UA_StatusCode UA_Node_copy(const UA_Node *src, UA_Node *dst)
Reset the destination node and copy the content of the source.
void UA_Node_clear(UA_Node *node)
Remove all malloc'ed members of the node and reset.
UA_EXPORT const UA_ReferenceTypeSet UA_REFERENCETYPESET_NONE
void *(* UA_NodeReferenceKind_iterateCallback)(void *context, UA_ReferenceTarget *target)
Iterate over the references.
Definition nodestore.h:276
UA_ExpandedNodeId UA_NodePointer_toExpandedNodeId(UA_NodePointer np)
Can point to the memory from the NodePointer.
UA_StatusCode UA_Node_deleteReference(UA_Node *node, UA_Byte refTypeIndex, UA_Boolean isForward, const UA_ExpandedNodeId *targetNodeId)
Delete a single reference from the node.
UA_EXPORT const UA_ReferenceTypeSet UA_REFERENCETYPESET_ALL
UA_Boolean UA_NodePointer_isLocal(UA_NodePointer np)
Test if an ExpandedNodeId or a local NodeId.
UA_StatusCode UA_Node_addReference(UA_Node *node, UA_Byte refTypeIndex, UA_Boolean isForward, const UA_ExpandedNodeId *targetNodeId, UA_UInt32 targetBrowseNameHash)
Add a single reference to the node.
#define UA_NODE_VARIABLEATTRIBUTES
Definition nodestore.h:490
UA_ValueSource
Indicates whether a variable contains data inline or whether it points to an external data source.
Definition nodestore.h:332
@ UA_VALUESOURCE_DATASOURCE
Definition nodestore.h:334
@ UA_VALUESOURCE_DATA
Definition nodestore.h:333
UA_NodeHead head
Definition nodestore.h:589
UA_Boolean isAbstract
Definition nodestore.h:590
Singly-linked LocalizedText list.
Definition nodestore.h:294
UA_LocalizedText localizedText
Definition nodestore.h:296
struct UA_LocalizedTextListEntry * next
Definition nodestore.h:295
UA_MethodCallback method
Definition nodestore.h:550
UA_NodeHead head
Definition nodestore.h:546
UA_Boolean executable
Definition nodestore.h:547
Every Node starts with these attributes.
Definition nodestore.h:300
UA_NodeClass nodeClass
Definition nodestore.h:302
UA_LocalizedTextListEntry * description
Definition nodestore.h:313
UA_Boolean constructed
Definition nodestore.h:321
UA_NodeId nodeId
Definition nodestore.h:301
UA_NodeReferenceKind * references
Definition nodestore.h:317
UA_LocalizedTextListEntry * displayName
Definition nodestore.h:312
UA_QualifiedName browseName
Definition nodestore.h:303
size_t referencesSize
Definition nodestore.h:316
void * context
Definition nodestore.h:320
UA_MonitoredItem * monitoredItems
Definition nodestore.h:323
UA_UInt32 writeMask
Definition nodestore.h:315
List of reference targets with the same reference type and direction.
Definition nodestore.h:249
UA_ReferenceTargetTreeElem * nameRoot
Definition nodestore.h:263
UA_Boolean isInverse
Definition nodestore.h:269
UA_ReferenceTarget * array
Definition nodestore.h:254
UA_ReferenceTargetTreeElem * idRoot
Definition nodestore.h:262
UA_Boolean hasRefTree
Definition nodestore.h:267
UA_Byte referenceTypeIndex
Definition nodestore.h:268
void * context
Definition nodestore.h:621
UA_NodeHead head
Definition nodestore.h:559
UA_Byte eventNotifier
Definition nodestore.h:560
UA_NodeTypeLifecycle lifecycle
Definition nodestore.h:570
UA_Boolean isAbstract
Definition nodestore.h:567
UA_NodeHead head
Definition nodestore.h:566
struct UA_ReferenceTargetTreeElem::@13 nameTreeEntry
struct UA_ReferenceTargetTreeElem::@12 idTreeEntry
struct UA_ReferenceTargetTreeElem * left
Definition nodestore.h:233
struct UA_ReferenceTargetTreeElem * right
Definition nodestore.h:234
UA_ReferenceTarget target
Definition nodestore.h:230
UA_UInt32 targetNameHash
Definition nodestore.h:225
UA_NodePointer targetId
Definition nodestore.h:224
UA_Boolean isAbstract
Definition nodestore.h:577
UA_Boolean symmetric
Definition nodestore.h:578
UA_Byte referenceTypeIndex
Definition nodestore.h:582
UA_LocalizedText inverseName
Definition nodestore.h:579
UA_ReferenceTypeSet subTypes
Definition nodestore.h:583
UA_UInt32 bits[128/32]
Definition nodestore.h:127
UA_DataValue value
Definition nodestore.h:479
UA_DataValue ** value
Definition nodestore.h:484
UA_DataSource dataSource
Definition nodestore.h:482
UA_ValueBackendType backendType
Definition nodestore.h:476
UA_ExternalValueCallback callback
Definition nodestore.h:485
UA_ValueCallback callback
Definition nodestore.h:480
UA_Double minimumSamplingInterval
Definition nodestore.h:513
UA_Byte accessLevel
Definition nodestore.h:512
UA_NodeHead head
Definition nodestore.h:510
UA_Boolean isDynamic
Definition nodestore.h:517
UA_Boolean historizing
Definition nodestore.h:514
UA_Boolean isAbstract
Definition nodestore.h:529
UA_NodeHead head
Definition nodestore.h:527
UA_NodeTypeLifecycle lifecycle
Definition nodestore.h:532
UA_Boolean containsNoLoops
Definition nodestore.h:598
UA_Byte eventNotifier
Definition nodestore.h:597
UA_NodeHead head
Definition nodestore.h:596
char id nodeId
Definition types.h:440
_UA_BEGIN_DECLS typedef bool UA_Boolean
This Source Code Form is subject to the terms of the Mozilla Public License, v.
Definition types.h:27
uint32_t UA_UInt32
Definition types.h:57
void * dst
Definition types.h:948
uint32_t UA_StatusCode
Definition types.h:82
double UA_Double
Definition types.h:77
uint8_t UA_Byte
Definition types.h:37
UA_BrowseDirection
BrowseDirection.
UA_NodeClass
NodeClass.
Tagged Pointer structure.
Definition nodestore.h:169
const UA_ExpandedNodeId * expandedId
Definition nodestore.h:172
const UA_NodeId * id
Definition nodestore.h:171
const UA_NodeHead * node
Definition nodestore.h:173
uintptr_t immediate
Definition nodestore.h:170
UA_VariableNode variableNode
Definition nodestore.h:605
UA_VariableTypeNode variableTypeNode
Definition nodestore.h:606
UA_ObjectNode objectNode
Definition nodestore.h:608
UA_DataTypeNode dataTypeNode
Definition nodestore.h:611
UA_NodeHead head
Definition nodestore.h:604
UA_ObjectTypeNode objectTypeNode
Definition nodestore.h:609
UA_ReferenceTypeNode referenceTypeNode
Definition nodestore.h:610
UA_ViewNode viewNode
Definition nodestore.h:612
UA_MethodNode methodNode
Definition nodestore.h:607