UA_StatusCode UA_Node_copyAnyNodeClass(const UA_Node *src, UA_Node *dst) { if(src->nodeClass != dst->nodeClass) return UA_STATUSCODE_BADINTERNALERROR; /* copy standard content */ UA_StatusCode retval = UA_NodeId_copy(&src->nodeId, &dst->nodeId); dst->nodeClass = src->nodeClass; retval |= UA_QualifiedName_copy(&src->browseName, &dst->browseName); retval |= UA_LocalizedText_copy(&src->displayName, &dst->displayName); retval |= UA_LocalizedText_copy(&src->description, &dst->description); dst->writeMask = src->writeMask; dst->userWriteMask = src->userWriteMask; if(retval != UA_STATUSCODE_GOOD) { UA_Node_deleteMembersAnyNodeClass(dst); return retval; } retval |= UA_Array_copy(src->references, src->referencesSize, (void**)&dst->references, &UA_TYPES[UA_TYPES_REFERENCENODE]); if(retval != UA_STATUSCODE_GOOD) { UA_Node_deleteMembersAnyNodeClass(dst); return retval; } dst->referencesSize = src->referencesSize; /* copy unique content of the nodeclass */ switch(src->nodeClass) { case UA_NODECLASS_OBJECT: retval = UA_ObjectNode_copy((const UA_ObjectNode*)src, (UA_ObjectNode*)dst); break; case UA_NODECLASS_VARIABLE: retval = UA_VariableNode_copy((const UA_VariableNode*)src, (UA_VariableNode*)dst); break; case UA_NODECLASS_METHOD: retval = UA_MethodNode_copy((const UA_MethodNode*)src, (UA_MethodNode*)dst); break; case UA_NODECLASS_OBJECTTYPE: retval = UA_ObjectTypeNode_copy((const UA_ObjectTypeNode*)src, (UA_ObjectTypeNode*)dst); break; case UA_NODECLASS_VARIABLETYPE: retval = UA_VariableTypeNode_copy((const UA_VariableTypeNode*)src, (UA_VariableTypeNode*)dst); break; case UA_NODECLASS_REFERENCETYPE: retval = UA_ReferenceTypeNode_copy((const UA_ReferenceTypeNode*)src, (UA_ReferenceTypeNode*)dst); break; case UA_NODECLASS_DATATYPE: retval = UA_DataTypeNode_copy((const UA_DataTypeNode*)src, (UA_DataTypeNode*)dst); break; case UA_NODECLASS_VIEW: retval = UA_ViewNode_copy((const UA_ViewNode*)src, (UA_ViewNode*)dst); break; default: break; } if(retval != UA_STATUSCODE_GOOD) UA_Node_deleteMembersAnyNodeClass(dst); return retval; }
static void OV_NodeStore_deleteNode(UA_Node *node){ if (node){ if (node->nodeClass == UA_NODECLASS_METHOD){ ov_string_setvalue((OV_STRING*) (&(((UA_MethodNode*) node)->methodHandle)), NULL); } UA_Node_deleteMembersAnyNodeClass(node); } UA_free(node); }
static void deleteEntry(UA_NodeStoreEntry *entry) { UA_Node_deleteMembersAnyNodeClass(&entry->node); UA_free(entry); }
/* Marks the entry dead and deletes if necessary. */ static UA_INLINE void deleteEntry(UA_NodeStoreEntry *entry) { UA_Node_deleteMembersAnyNodeClass(&entry->node.node); entry->taken = UA_FALSE; }
static void OV_NodeStore_deleteNode(UA_Node *node){ if (node){ UA_Node_deleteMembersAnyNodeClass(node); } UA_free(node); }
void UA_Node_deleteAnyNodeClass(UA_Node *node) { UA_Node_deleteMembersAnyNodeClass(node); UA_free(node); }