open62541 1.3.12
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_SERVER_NODES_H_
11#define UA_SERVER_NODES_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#include "aa_tree.h"
22
24
25/** Forward declaration */
26#ifdef UA_ENABLE_SUBSCRIPTIONS
27struct UA_MonitoredItem;
29#endif
30
31
32
33typedef struct {
34 /* Can be NULL. May replace the nodeContext */
35 UA_StatusCode (*constructor)(UA_Server *server,
36 const UA_NodeId *sessionId, void *sessionContext,
37 const UA_NodeId *nodeId, void **nodeContext);
38
39 /* Can be NULL. The context cannot be replaced since the node is destroyed
40 * immediately afterwards anyway. */
41 void (*destructor)(UA_Server *server,
42 const UA_NodeId *sessionId, void *sessionContext,
43 const UA_NodeId *nodeId, void *nodeContext);
44
45 /* Can be NULL. Called during recursive node instantiation. While mandatory
46 * child nodes are automatically created if not already present, optional child
47 * nodes are not. This callback can be used to define whether an optional child
48 * node should be created.
49 *
50 * @param server The server executing the callback
51 * @param sessionId The identifier of the session
52 * @param sessionContext Additional data attached to the session in the
53 * access control layer
54 * @param sourceNodeId Source node from the type definition. If the new node
55 * shall be created, it will be a copy of this node.
56 * @param targetParentNodeId Parent of the potential new child node
57 * @param referenceTypeId Identifies the reference type which that the parent
58 * node has to the new node.
59 * @return Return UA_TRUE if the child node shall be instantiated,
60 * UA_FALSE otherwise. */
61 UA_Boolean (*createOptionalChild)(UA_Server *server,
62 const UA_NodeId *sessionId,
63 void *sessionContext,
64 const UA_NodeId *sourceNodeId,
65 const UA_NodeId *targetParentNodeId,
66 const UA_NodeId *referenceTypeId);
67
68 /* Can be NULL. Called when a node is to be copied during recursive
69 * node instantiation. Allows definition of the NodeId for the new node.
70 * If the callback is set to NULL or the resulting NodeId is UA_NODEID_NUMERIC(X,0)
71 * an unused nodeid in namespace X will be used. E.g. passing UA_NODEID_NULL will
72 * result in a NodeId in namespace 0.
73 *
74 * @param server The server executing the callback
75 * @param sessionId The identifier of the session
76 * @param sessionContext Additional data attached to the session in the
77 * access control layer
78 * @param sourceNodeId Source node of the copy operation
79 * @param targetParentNodeId Parent node of the new node
80 * @param referenceTypeId Identifies the reference type which that the parent
81 * node has to the new node. */
82 UA_StatusCode (*generateChildNodeId)(UA_Server *server,
83 const UA_NodeId *sessionId, void *sessionContext,
84 const UA_NodeId *sourceNodeId,
85 const UA_NodeId *targetParentNodeId,
86 const UA_NodeId *referenceTypeId,
87 UA_NodeId *targetNodeId);
89
90
91typedef struct {
92 /* Can be NULL. May replace the nodeContext */
93 UA_StatusCode (*constructor)(UA_Server *server,
94 const UA_NodeId *sessionId, void *sessionContext,
95 const UA_NodeId *typeNodeId, void *typeNodeContext,
96 const UA_NodeId *nodeId, void **nodeContext);
97
98 /* Can be NULL. May replace the nodeContext. */
99 void (*destructor)(UA_Server *server,
100 const UA_NodeId *sessionId, void *sessionContext,
101 const UA_NodeId *typeNodeId, void *typeNodeContext,
102 const UA_NodeId *nodeId, void **nodeContext);
104
105
106#define UA_REFERENCETYPEINDEX_REFERENCES 0
107#define UA_REFERENCETYPEINDEX_HASSUBTYPE 1
108#define UA_REFERENCETYPEINDEX_AGGREGATES 2
109#define UA_REFERENCETYPEINDEX_HIERARCHICALREFERENCES 3
110#define UA_REFERENCETYPEINDEX_NONHIERARCHICALREFERENCES 4
111#define UA_REFERENCETYPEINDEX_HASCHILD 5
112#define UA_REFERENCETYPEINDEX_ORGANIZES 6
113#define UA_REFERENCETYPEINDEX_HASEVENTSOURCE 7
114#define UA_REFERENCETYPEINDEX_HASMODELLINGRULE 8
115#define UA_REFERENCETYPEINDEX_HASENCODING 9
116#define UA_REFERENCETYPEINDEX_HASDESCRIPTION 10
117#define UA_REFERENCETYPEINDEX_HASTYPEDEFINITION 11
118#define UA_REFERENCETYPEINDEX_GENERATESEVENT 12
119#define UA_REFERENCETYPEINDEX_HASPROPERTY 13
120#define UA_REFERENCETYPEINDEX_HASCOMPONENT 14
121#define UA_REFERENCETYPEINDEX_HASNOTIFIER 15
122#define UA_REFERENCETYPEINDEX_HASORDEREDCOMPONENT 16
123#define UA_REFERENCETYPEINDEX_HASINTERFACE 17
124
125/** The maximum number of ReferrenceTypes. Must be a multiple of 32. */
126#define UA_REFERENCETYPESET_MAX 128
128
129static void
130UA_ReferenceTypeSet_init(UA_ReferenceTypeSet *set) {
131 memset(set, 0, sizeof(UA_ReferenceTypeSet));
132}
133
134static void
135UA_ReferenceTypeSet_any(UA_ReferenceTypeSet *set) {
136 memset(set, -1, sizeof(UA_ReferenceTypeSet));
137}
138
140UA_REFTYPESET(UA_Byte index) {
141 UA_Byte i = index / 32, j = index % 32;
143 UA_ReferenceTypeSet_init(&set);
144 set.bits[i] |= ((UA_UInt32)1) << j;
145 return set;
146}
147
149UA_ReferenceTypeSet_union(const UA_ReferenceTypeSet setA,
150 const UA_ReferenceTypeSet setB) {
152 for(size_t i = 0; i < UA_REFERENCETYPESET_MAX / 32; i++)
153 set.bits[i] = setA.bits[i] | setB.bits[i];
154 return set;
155}
156
157static UA_Boolean
158UA_ReferenceTypeSet_contains(const UA_ReferenceTypeSet *set, UA_Byte index) {
159 UA_Byte i = index / 32, j = index % 32;
160 return !!(set->bits[i] & (((UA_UInt32)1) << j));
161}
162
163
164
165/** Forward declaration. All node structures begin with the NodeHead. */
166struct UA_NodeHead;
168
169/** Tagged Pointer structure. */
170typedef union {
171 uintptr_t immediate; /* 00: Small numerical NodeId */
172 const UA_NodeId *id; /* 01: Pointer to NodeId */
173 const UA_ExpandedNodeId *expandedId; /* 10: Pointer to ExternalNodeId */
174 const UA_NodeHead *node; /* 11: Pointer to a node */
176
177/** Sets the pointer to an immediate NodeId "ns=0;i=0" similar to a freshly
178 * initialized UA_NodeId */
179static void
180UA_NodePointer_init(UA_NodePointer *np) { np->immediate = 0; }
181
182/** NodeId and ExpandedNodeId targets are freed */
183void
185
186/** Makes a deep copy */
189
190/** Test if an ExpandedNodeId or a local NodeId */
193
196
197static UA_Boolean
198UA_NodePointer_equal(UA_NodePointer p1, UA_NodePointer p2) {
199 return (UA_NodePointer_order(p1, p2) == UA_ORDER_EQ);
200}
201
202/** Cannot fail. The resulting NodePointer can point to the memory from the
203 * NodeId. Make a deep copy if required. */
206
207/** Cannot fail. The resulting NodePointer can point to the memory from the
208 * ExpandedNodeId. Make a deep copy if required. */
211
212/** Can point to the memory from the NodePointer */
215
216/** Can point to the memory from the NodePointer. Discards the ServerIndex and
217 * NamespaceUri of a potential ExpandedNodeId inside the NodePointer. Test
218 * before if the NodePointer is local. */
221
222
223
224typedef struct {
225 UA_NodePointer targetId; /* Has to be the first entry */
226 UA_UInt32 targetNameHash; /* Hash of the target's BrowseName. Set to zero
227 * if the target is remote. */
229
230typedef struct {
231 UA_ReferenceTarget target; /* Has to be the first entry */
232 UA_UInt32 targetIdHash; /* Hash of the targetId */
233 struct aa_entry idTreeEntry; /* Binary-Tree for fast lookup */
234 struct aa_entry nameTreeEntry;
236
237/** List of reference targets with the same reference type and direction. Uses
238 * either an array or a tree structure. The SDK will not change the type of
239 * reference target structure internally. The nodestore implementations may
240 * switch internally when a node is updated.
241 *
242 * The recommendation is to switch to a tree once the number of refs > 8. */
243typedef struct {
244 union {
245 /* Organize the references in an array. Uses less memory, but incurs
246 * lookups in linear time. Recommended if the number of references is
247 * known to be small. */
249
250 /* Organize the references in a tree for fast lookup */
251 struct {
252 struct aa_entry *idTreeRoot; /* Fast lookup based on the target id */
253 struct aa_entry *nameTreeRoot; /* Fast lookup based on the target browseName*/
254 } tree;
255 } targets;
257 UA_Boolean hasRefTree; /* RefTree or RefArray? */
261
262/** Iterate over the references. Assumes that "prev" points to a
263 * NodeReferenceKind. If prev == NULL, the first element is returned. At the end
264 * of the iteration, NULL is returned.
265 *
266 * Do not continue the iteration after the rk was modified. */
267UA_EXPORT const UA_ReferenceTarget *
269 const UA_ReferenceTarget *prev);
270
271/** Switch between array and tree representation. Does nothing upon error (e.g.
272 * out-of-memory). */
273UA_EXPORT UA_StatusCode
275
276/** Every Node starts with these attributes */
286
287 /* Members specific to open62541 */
288 void *context;
289 UA_Boolean constructed; /* Constructors were called */
290#ifdef UA_ENABLE_SUBSCRIPTIONS
291 UA_MonitoredItem *monitoredItems; /* MonitoredItems for Events and immediate
292 * DataChanges (no sampling interval). */
293#endif
294};
295
296
297
298/** Indicates whether a variable contains data inline or whether it points to an
299 * external data source */
304
305typedef struct {
306 /* Called before the value attribute is read. It is possible to write into the
307 * value attribute during onRead (using the write service). The node is
308 * re-opened afterwards so that changes are considered in the following read
309 * operation.
310 *
311 * @param handle Points to user-provided data for the callback.
312 * @param nodeid The identifier of the node.
313 * @param data Points to the current node value.
314 * @param range Points to the numeric range the client wants to read from
315 * (or NULL). */
316 void (*onRead)(UA_Server *server, const UA_NodeId *sessionId,
317 void *sessionContext, const UA_NodeId *nodeid,
318 void *nodeContext, const UA_NumericRange *range,
319 const UA_DataValue *value);
320
321 /* Called after writing the value attribute. The node is re-opened after
322 * writing so that the new value is visible in the callback.
323 *
324 * @param server The server executing the callback
325 * @sessionId The identifier of the session
326 * @sessionContext Additional data attached to the session
327 * in the access control layer
328 * @param nodeid The identifier of the node.
329 * @param nodeUserContext Additional data attached to the node by
330 * the user.
331 * @param nodeConstructorContext Additional data attached to the node
332 * by the type constructor(s).
333 * @param range Points to the numeric range the client wants to write to (or
334 * NULL). */
335 void (*onWrite)(UA_Server *server, const UA_NodeId *sessionId,
336 void *sessionContext, const UA_NodeId *nodeId,
337 void *nodeContext, const UA_NumericRange *range,
338 const UA_DataValue *data);
340
341typedef struct {
342 /* Copies the data from the source into the provided value.
343 *
344 * !! ZERO-COPY OPERATIONS POSSIBLE !!
345 * It is not required to return a copy of the actual content data. You can
346 * return a pointer to memory owned by the user. Memory can be reused
347 * between read callbacks of a DataSource, as the result is already encoded
348 * on the network buffer between each read operation.
349 *
350 * To use zero-copy reads, set the value of the `value->value` Variant
351 * without copying, e.g. with `UA_Variant_setScalar`. Then, also set
352 * `value->value.storageType` to `UA_VARIANT_DATA_NODELETE` to prevent the
353 * memory being cleaned up. Don't forget to also set `value->hasValue` to
354 * true to indicate the presence of a value.
355 *
356 * @param server The server executing the callback
357 * @param sessionId The identifier of the session
358 * @param sessionContext Additional data attached to the session in the
359 * access control layer
360 * @param nodeId The identifier of the node being read from
361 * @param nodeContext Additional data attached to the node by the user
362 * @param includeSourceTimeStamp If true, then the datasource is expected to
363 * set the source timestamp in the returned value
364 * @param range If not null, then the datasource shall return only a
365 * selection of the (nonscalar) data. Set
366 * UA_STATUSCODE_BADINDEXRANGEINVALID in the value if this does not
367 * apply
368 * @param value The (non-null) DataValue that is returned to the client. The
369 * data source sets the read data, the result status and optionally a
370 * sourcetimestamp.
371 * @return Returns a status code for logging. Error codes intended for the
372 * original caller are set in the value. If an error is returned,
373 * then no releasing of the value is done
374 */
375 UA_StatusCode (*read)(UA_Server *server, const UA_NodeId *sessionId,
376 void *sessionContext, const UA_NodeId *nodeId,
377 void *nodeContext, UA_Boolean includeSourceTimeStamp,
378 const UA_NumericRange *range, UA_DataValue *value);
379
380 /* Write into a data source. This method pointer can be NULL if the
381 * operation is unsupported.
382 *
383 * @param server The server executing the callback
384 * @param sessionId The identifier of the session
385 * @param sessionContext Additional data attached to the session in the
386 * access control layer
387 * @param nodeId The identifier of the node being written to
388 * @param nodeContext Additional data attached to the node by the user
389 * @param range If not NULL, then the datasource shall return only a
390 * selection of the (nonscalar) data. Set
391 * UA_STATUSCODE_BADINDEXRANGEINVALID in the value if this does not
392 * apply
393 * @param value The (non-NULL) DataValue that has been written by the client.
394 * The data source contains the written data, the result status and
395 * optionally a sourcetimestamp
396 * @return Returns a status code for logging. Error codes intended for the
397 * original caller are set in the value. If an error is returned,
398 * then no releasing of the value is done
399 */
400 UA_StatusCode (*write)(UA_Server *server, const UA_NodeId *sessionId,
401 void *sessionContext, const UA_NodeId *nodeId,
402 void *nodeContext, const UA_NumericRange *range,
403 const UA_DataValue *value);
405
406
407typedef struct {
408 /* Called before the value attribute is read. The external value source can be
409 * be updated and/or locked during this notification call. After this function returns
410 * to the core, the external value source is readed immediately.
411 */
412 UA_StatusCode (*notificationRead)(UA_Server *server, const UA_NodeId *sessionId,
413 void *sessionContext, const UA_NodeId *nodeid,
414 void *nodeContext, const UA_NumericRange *range);
415
416 /* Called after writing the value attribute. The node is re-opened after
417 * writing so that the new value is visible in the callback.
418 *
419 * @param server The server executing the callback
420 * @sessionId The identifier of the session
421 * @sessionContext Additional data attached to the session
422 * in the access control layer
423 * @param nodeid The identifier of the node.
424 * @param nodeUserContext Additional data attached to the node by
425 * the user.
426 * @param nodeConstructorContext Additional data attached to the node
427 * by the type constructor(s).
428 * @param range Points to the numeric range the client wants to write to (or
429 * NULL). */
430 UA_StatusCode (*userWrite)(UA_Server *server, const UA_NodeId *sessionId,
431 void *sessionContext, const UA_NodeId *nodeId,
432 void *nodeContext, const UA_NumericRange *range,
433 const UA_DataValue *data);
435
442
457
458#define UA_NODE_VARIABLEATTRIBUTES \
459 /* Constraints on possible values */ \
460 UA_NodeId dataType; \
461 UA_Int32 valueRank; \
462 size_t arrayDimensionsSize; \
463 UA_UInt32 *arrayDimensions; \
464 \
465 UA_ValueBackend valueBackend; \
466 \
467 /* The current value */ \
468 UA_ValueSource valueSource; \
469 union { \
470 struct { \
471 UA_DataValue value; \
472 UA_ValueCallback callback; \
473 } data; \
474 UA_DataSource dataSource; \
475 } value;
476
477typedef struct {
483
484 /* Members specific to open62541 */
485 UA_Boolean isDynamic; /* Some variables are "static" in the sense that they
486 * are not attached to a dynamic process in the
487 * background. Only dynamic variables conserve source
488 * and server timestamp for the value attribute.
489 * Static variables have timestamps of "now". */
491
492
493
502
503
504
506(*UA_MethodCallback)(UA_Server *server, const UA_NodeId *sessionId,
507 void *sessionContext, const UA_NodeId *methodId,
508 void *methodContext, const UA_NodeId *objectId,
509 void *objectContext, size_t inputSize,
510 const UA_Variant *input, size_t outputSize,
511 UA_Variant *output);
512
513typedef struct {
516
517 /* Members specific to open62541 */
519#if UA_MULTITHREADING >= 100
520 UA_Boolean async; /* Indicates an async method call */
521#endif
523
524
525
530
531
532
533typedef struct {
536
537 /* Members specific to open62541 */
540
541
542
543typedef struct {
548
549 /* Members specific to open62541 */
551 UA_ReferenceTypeSet subTypes; /* contains the type itself as well */
553
554
555
560
561
562
568
569
570
582
583
584
585typedef void (*UA_NodestoreVisitor)(void *visitorCtx, const UA_Node *node);
586
587typedef struct {
588 /* Nodestore context and lifecycle */
589 void *context;
590 void (*clear)(void *nsCtx);
591
592 /* The following definitions are used to create empty nodes of the different
593 * node types. The memory is managed by the nodestore. Therefore, the node
594 * has to be removed via a special deleteNode function. (If the new node is
595 * not added to the nodestore.) */
596 UA_Node * (*newNode)(void *nsCtx, UA_NodeClass nodeClass);
597
598 void (*deleteNode)(void *nsCtx, UA_Node *node);
599
600 /* ``Get`` returns a pointer to an immutable node. ``Release`` indicates
601 * that the pointer is no longer accessed afterwards. */
602 const UA_Node * (*getNode)(void *nsCtx, const UA_NodeId *nodeId);
603
604 void (*releaseNode)(void *nsCtx, const UA_Node *node);
605
606 /* Returns an editable copy of a node (needs to be deleted with the
607 * deleteNode function or inserted / replaced into the nodestore). */
608 UA_StatusCode (*getNodeCopy)(void *nsCtx, const UA_NodeId *nodeId,
609 UA_Node **outNode);
610
611 /* Inserts a new node into the nodestore. If the NodeId is zero, then a
612 * fresh numeric NodeId is assigned. If insertion fails, the node is
613 * deleted. */
614 UA_StatusCode (*insertNode)(void *nsCtx, UA_Node *node,
615 UA_NodeId *addedNodeId);
616
617 /* To replace a node, get an editable copy of the node, edit and replace
618 * with this function. If the node was already replaced since the copy was
619 * made, UA_STATUSCODE_BADINTERNALERROR is returned. If the NodeId is not
620 * found, UA_STATUSCODE_BADNODEIDUNKNOWN is returned. In both error cases,
621 * the editable node is deleted. */
622 UA_StatusCode (*replaceNode)(void *nsCtx, UA_Node *node);
623
624 /* Removes a node from the nodestore. */
625 UA_StatusCode (*removeNode)(void *nsCtx, const UA_NodeId *nodeId);
626
627 /* Maps the ReferenceTypeIndex used for the references to the NodeId of the
628 * ReferenceType. The returned pointer is stable until the Nodestore is
629 * deleted. */
630 const UA_NodeId * (*getReferenceTypeId)(void *nsCtx, UA_Byte refTypeIndex);
631
632 /* Execute a callback for every node in the nodestore. */
633 void (*iterate)(void *nsCtx, UA_NodestoreVisitor visitor,
634 void *visitorCtx);
636
637/** Attributes must be of a matching type (VariableAttributes, ObjectAttributes,
638 * and so on). The attributes are copied. Note that the attributes structs do
639 * not contain NodeId, NodeClass and BrowseName. The NodeClass of the node needs
640 * to be correctly set before calling this method. UA_Node_clear is called on
641 * the node when an error occurs internally. */
643UA_Node_setAttributes(UA_Node *node, const void *attributes,
644 const UA_DataType *attributeType);
645
646/** Reset the destination node and copy the content of the source */
648UA_Node_copy(const UA_Node *src, UA_Node *dst);
649
650/** Allocate new node and copy the values from src */
651UA_EXPORT UA_Node *
653
654/** Add a single reference to the node */
656UA_Node_addReference(UA_Node *node, UA_Byte refTypeIndex, UA_Boolean isForward,
657 const UA_ExpandedNodeId *targetNodeId,
658 UA_UInt32 targetBrowseNameHash);
659
660/** Delete a single reference from the node */
662UA_Node_deleteReference(UA_Node *node, UA_Byte refTypeIndex, UA_Boolean isForward,
663 const UA_ExpandedNodeId *targetNodeId);
664
665/** Deletes references from the node which are not matching any type in the given
666 * array. Could be used to e.g. delete all the references, except
667 * 'HASMODELINGRULE' */
668void
670
671/** Delete all references of the node */
672void
674
675/** Remove all malloc'ed members of the node and reset */
676void
678
680
681#endif /* UA_SERVER_NODES_H_ */
UA_Order
Definition common.h:112
@ UA_ORDER_EQ
Definition common.h:114
#define _UA_BEGIN_DECLS
#undef UA_DEBUG_DUMP_PKGS
Definition config.h:89
#define _UA_END_DECLS
Definition config.h:96
void UA_Node_deleteReferences(UA_Node *node)
Delete all references of the node.
UA_Order UA_NodePointer_order(UA_NodePointer p1, UA_NodePointer p2)
UA_NodePointer UA_NodePointer_fromNodeId(const UA_NodeId *id)
Cannot fail.
void(* UA_NodestoreVisitor)(void *visitorCtx, const UA_Node *node)
Definition nodestore.h:585
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_EXPORT const UA_ReferenceTarget * UA_NodeReferenceKind_iterate(const UA_NodeReferenceKind *rk, const UA_ReferenceTarget *prev)
Iterate over the references.
UA_NodePointer UA_NodePointer_fromExpandedNodeId(const UA_ExpandedNodeId *id)
Cannot fail.
#define UA_REFERENCETYPESET_MAX
The maximum number of ReferrenceTypes.
Definition nodestore.h:126
UA_ValueBackendType
Definition nodestore.h:436
@ UA_VALUEBACKENDTYPE_INTERNAL
Definition nodestore.h:438
@ UA_VALUEBACKENDTYPE_DATA_SOURCE_CALLBACK
Definition nodestore.h:439
@ UA_VALUEBACKENDTYPE_EXTERNAL
Definition nodestore.h:440
@ UA_VALUEBACKENDTYPE_NONE
Definition nodestore.h:437
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:506
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_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_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:458
UA_ValueSource
Indicates whether a variable contains data inline or whether it points to an external data source.
Definition nodestore.h:300
@ UA_VALUESOURCE_DATASOURCE
Definition nodestore.h:302
@ UA_VALUESOURCE_DATA
Definition nodestore.h:301
UA_NodeHead head
Definition nodestore.h:557
UA_Boolean isAbstract
Definition nodestore.h:558
UA_MethodCallback method
Definition nodestore.h:518
UA_NodeHead head
Definition nodestore.h:514
UA_Boolean executable
Definition nodestore.h:515
Every Node starts with these attributes.
Definition nodestore.h:277
UA_NodeClass nodeClass
Definition nodestore.h:279
UA_Boolean constructed
Definition nodestore.h:289
UA_NodeId nodeId
Definition nodestore.h:278
UA_NodeReferenceKind * references
Definition nodestore.h:285
UA_LocalizedText description
Definition nodestore.h:282
UA_QualifiedName browseName
Definition nodestore.h:280
size_t referencesSize
Definition nodestore.h:284
void * context
Definition nodestore.h:288
UA_MonitoredItem * monitoredItems
Definition nodestore.h:291
UA_UInt32 writeMask
Definition nodestore.h:283
UA_LocalizedText displayName
Definition nodestore.h:281
List of reference targets with the same reference type and direction.
Definition nodestore.h:243
struct aa_entry * idTreeRoot
Definition nodestore.h:252
UA_Boolean isInverse
Definition nodestore.h:259
UA_ReferenceTarget * array
Definition nodestore.h:248
UA_Boolean hasRefTree
Definition nodestore.h:257
struct aa_entry * nameTreeRoot
Definition nodestore.h:253
UA_Byte referenceTypeIndex
Definition nodestore.h:258
void * context
Definition nodestore.h:589
UA_NodeHead head
Definition nodestore.h:527
UA_Byte eventNotifier
Definition nodestore.h:528
UA_NodeTypeLifecycle lifecycle
Definition nodestore.h:538
UA_Boolean isAbstract
Definition nodestore.h:535
UA_NodeHead head
Definition nodestore.h:534
UA_ReferenceTarget target
Definition nodestore.h:231
UA_UInt32 targetNameHash
Definition nodestore.h:226
UA_NodePointer targetId
Definition nodestore.h:225
UA_Boolean isAbstract
Definition nodestore.h:545
UA_Boolean symmetric
Definition nodestore.h:546
UA_Byte referenceTypeIndex
Definition nodestore.h:550
UA_LocalizedText inverseName
Definition nodestore.h:547
UA_ReferenceTypeSet subTypes
Definition nodestore.h:551
UA_UInt32 bits[128/32]
Definition nodestore.h:127
UA_DataValue value
Definition nodestore.h:447
UA_DataValue ** value
Definition nodestore.h:452
UA_DataSource dataSource
Definition nodestore.h:450
UA_ValueBackendType backendType
Definition nodestore.h:444
UA_ExternalValueCallback callback
Definition nodestore.h:453
UA_ValueCallback callback
Definition nodestore.h:448
UA_Double minimumSamplingInterval
Definition nodestore.h:481
UA_Byte accessLevel
Definition nodestore.h:480
UA_NodeHead head
Definition nodestore.h:478
UA_Boolean isDynamic
Definition nodestore.h:485
UA_Boolean historizing
Definition nodestore.h:482
UA_Boolean isAbstract
Definition nodestore.h:497
UA_NodeHead head
Definition nodestore.h:495
UA_NodeTypeLifecycle lifecycle
Definition nodestore.h:500
UA_Boolean containsNoLoops
Definition nodestore.h:566
UA_Byte eventNotifier
Definition nodestore.h:565
UA_NodeHead head
Definition nodestore.h:564
Definition aa_tree.h:21
_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:26
uint32_t UA_UInt32
Definition types.h:56
uint32_t UA_StatusCode
Definition types.h:77
double UA_Double
Definition types.h:74
uint8_t UA_Byte
Definition types.h:36
UA_NodeClass
UA_StatusCode deleteNode(UA_Server *server, const UA_NodeId nodeId, UA_Boolean deleteReferences)
Internal function calls, without locks.
Tagged Pointer structure.
Definition nodestore.h:170
const UA_ExpandedNodeId * expandedId
Definition nodestore.h:173
const UA_NodeId * id
Definition nodestore.h:172
const UA_NodeHead * node
Definition nodestore.h:174
uintptr_t immediate
Definition nodestore.h:171
UA_VariableNode variableNode
Definition nodestore.h:573
UA_VariableTypeNode variableTypeNode
Definition nodestore.h:574
UA_ObjectNode objectNode
Definition nodestore.h:576
UA_DataTypeNode dataTypeNode
Definition nodestore.h:579
UA_NodeHead head
Definition nodestore.h:572
UA_ObjectTypeNode objectTypeNode
Definition nodestore.h:577
UA_ReferenceTypeNode referenceTypeNode
Definition nodestore.h:578
UA_ViewNode viewNode
Definition nodestore.h:580
UA_MethodNode methodNode
Definition nodestore.h:575