Pārlūkot izejas kodu

nodestore: align recent changes in code not covered by travis and unit tests

Julius Pfrommer 9 gadi atpakaļ
vecāks
revīzija
4d553b9c1f

+ 3 - 3
src/server/ua_services_view.c

@@ -58,7 +58,7 @@ returnRelevantNodeExternal(UA_ExternalNodeStore *ens, const UA_BrowseDescription
                    indicesSize, readNodesResults, UA_FALSE, diagnosticInfos);
                    indicesSize, readNodesResults, UA_FALSE, diagnosticInfos);
 
 
     /* create and fill a dummy nodeStructure */
     /* create and fill a dummy nodeStructure */
-    UA_Node *node = (UA_Node*) UA_ObjectNode_new();
+    UA_Node *node = (UA_Node*) UA_NodeStore_newObjectNode();
     UA_NodeId_copy(&(reference->targetId.nodeId), &(node->nodeId));
     UA_NodeId_copy(&(reference->targetId.nodeId), &(node->nodeId));
     if(readNodesResults[0].status == UA_STATUSCODE_GOOD)
     if(readNodesResults[0].status == UA_STATUSCODE_GOOD)
         UA_NodeClass_copy((UA_NodeClass*)readNodesResults[0].value.data, &(node->nodeClass));
         UA_NodeClass_copy((UA_NodeClass*)readNodesResults[0].value.data, &(node->nodeClass));
@@ -77,7 +77,7 @@ returnRelevantNodeExternal(UA_ExternalNodeStore *ens, const UA_BrowseDescription
     UA_Array_delete(readNodesResults, &UA_TYPES[UA_TYPES_DATAVALUE], 6);
     UA_Array_delete(readNodesResults, &UA_TYPES[UA_TYPES_DATAVALUE], 6);
     UA_Array_delete(diagnosticInfos, &UA_TYPES[UA_TYPES_DIAGNOSTICINFO], 6);
     UA_Array_delete(diagnosticInfos, &UA_TYPES[UA_TYPES_DIAGNOSTICINFO], 6);
     if(node && descr->nodeClassMask != 0 && (node->nodeClass & descr->nodeClassMask) == 0) {
     if(node && descr->nodeClassMask != 0 && (node->nodeClass & descr->nodeClassMask) == 0) {
-        UA_ObjectNode_delete((UA_ObjectNode*)node);
+        UA_NodeStore_deleteNode(node);
         return NULL;
         return NULL;
     }
     }
     return node;
     return node;
@@ -303,7 +303,7 @@ Service_Browse_single(UA_Server *server, UA_Session *session, struct Continuatio
             referencesCount++;
             referencesCount++;
         }
         }
 #ifdef UA_ENABLE_EXTERNAL_NAMESPACES
 #ifdef UA_ENABLE_EXTERNAL_NAMESPACES
-        /* relevant_node returns a node malloced with UA_ObjectNode_new
+        /* relevant_node returns a node malloced by the nodestore.
            if it is external (there is no UA_Node_new function) */
            if it is external (there is no UA_Node_new function) */
         if(isExternal == UA_TRUE)
         if(isExternal == UA_TRUE)
         	UA_ObjectNode_delete((UA_ObjectNode*)(uintptr_t)current);
         	UA_ObjectNode_delete((UA_ObjectNode*)(uintptr_t)current);

+ 1 - 1
tools/pyUANamespace/open62541_MacroHelper.py

@@ -170,7 +170,7 @@ class open62541_MacroHelper():
       code.append("/* undefined nodeclass */")
       code.append("/* undefined nodeclass */")
       return;
       return;
 
 
-    code.append("UA_" + nodetype + "Node *" + node.getCodePrintableID() + " = UA_" + nodetype + "Node_new();")
+    code.append("UA_" + nodetype + "Node *" + node.getCodePrintableID() + " = UA_NodeStore_new" + nodetype + "Node();")
     if not "browsename" in self.supressGenerationOfAttribute:
     if not "browsename" in self.supressGenerationOfAttribute:
       extrNs = node.browseName().split(":")
       extrNs = node.browseName().split(":")
       if len(extrNs) > 1:
       if len(extrNs) > 1:

+ 1 - 1
tools/pyUANamespace/ua_node_types.py

@@ -685,7 +685,7 @@ class opcua_node_t:
       code = code + codegen.getCreateNodeBootstrap(self)
       code = code + codegen.getCreateNodeBootstrap(self)
       code = code + self.printOpen62541CCode_Subtype(unPrintedReferences = unPrintedReferences, bootstrapping = True)
       code = code + self.printOpen62541CCode_Subtype(unPrintedReferences = unPrintedReferences, bootstrapping = True)
       code.append("// Parent node does not exist yet. This node will be bootstrapped and linked later.")
       code.append("// Parent node does not exist yet. This node will be bootstrapped and linked later.")
-      code.append("UA_NodeStore_insert(server->nodestore, (UA_Node*) " + self.getCodePrintableID() + ", NULL);")
+      code.append("UA_NodeStore_insert(server->nodestore, (UA_Node*) " + self.getCodePrintableID() + ");")
       
       
     # Try to print all references to nodes that already exist
     # Try to print all references to nodes that already exist
     # Note: we know the reference types exist, because the namespace class made sure they were
     # Note: we know the reference types exist, because the namespace class made sure they were