S2OPC OPCUA Toolkit
sopc_address_space.h
Go to the documentation of this file.
1 /*
2  * Licensed to Systerel under one or more contributor license
3  * agreements. See the NOTICE file distributed with this work
4  * for additional information regarding copyright ownership.
5  * Systerel licenses this file to you under the Apache
6  * License, Version 2.0 (the "License"); you may not use this
7  * file except in compliance with the License. You may obtain
8  * a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15  * KIND, either express or implied. See the License for the
16  * specific language governing permissions and limitations
17  * under the License.
18  */
19 
20 #ifndef SOPC_ADDRESS_SPACE_H_
21 #define SOPC_ADDRESS_SPACE_H_
22 
23 #include <stdint.h>
24 
25 #include "sopc_types.h"
26 
37 #define FOR_EACH_ELEMENT_TYPE(x, extra) \
38  x(DataType, data_type, extra) x(Method, method, extra) x(Object, object, extra) x(ObjectType, object_type, extra) \
39  x(ReferenceType, reference_type, extra) x(Variable, variable, extra) x(VariableType, variable_type, extra) \
40  x(View, view, extra)
41 
42 typedef struct SOPC_Value_Timestamp
43 {
45  uint16_t picoSeconds;
47 
48 typedef struct
49 {
53  union
54  {
61  variable; // Note: variable.Value shall never be accessed directly (it is an index in const @space)
64  } data;
66 
67 /* Address space structure */
68 typedef struct _SOPC_AddressSpace SOPC_AddressSpace;
69 
81 
91 
114  SOPC_AddressSpace_Node* nodes,
115  uint32_t nb_variables,
116  SOPC_Variant* variables);
117 
126 
137 
146 
148 
157 typedef void SOPC_AddressSpace_ForEach_Fct(const uintptr_t key, const uintptr_t value, uintptr_t user_data);
158 
160 
161 /* Common attributes */
164  SOPC_AttributeId attribute);
174 /* Variable and VariableType common attributes */
176 
184 /* Types common attribute */
186 
189 
192 
193 /* Address space node structure */
196  OpcUa_NodeClass element_type);
198 
199 #endif /* SOPC_ADDRESS_SPACE_H_ */
SOPC_AddressSpace_AreNodesReleasable
bool SOPC_AddressSpace_AreNodesReleasable(const SOPC_AddressSpace *space)
Returns true if the AddressSpace will release nodes on SOPC_AddressSpace_Delete. It means it has been...
SOPC_AddressSpace_Node
Definition: sopc_address_space.h:49
SOPC_NodeId
This structure describes a basic NodeID in OPC UA.
Definition: sopc_builtintypes.h:187
sopc_types.h
_OpcUa_DataTypeNode
Definition: sopc_types.h:2026
SOPC_AddressSpace_Get_SourceTs
SOPC_Value_Timestamp SOPC_AddressSpace_Get_SourceTs(SOPC_AddressSpace *space, SOPC_AddressSpace_Node *node)
SOPC_Value_Timestamp::picoSeconds
uint16_t picoSeconds
Definition: sopc_address_space.h:45
SOPC_AddressSpace_Get_NodeId
SOPC_NodeId * SOPC_AddressSpace_Get_NodeId(SOPC_AddressSpace *space, SOPC_AddressSpace_Node *node)
_OpcUa_VariableTypeNode
Definition: sopc_types.h:1877
SOPC_ExtensionObject
An ExtensionObject is a container for any Structured DataTypes which cannot be encoded as one of the ...
Definition: sopc_builtintypes.h:260
SOPC_StatusCode
uint32_t SOPC_StatusCode
Definition: libs2opc_client.h:60
SOPC_LocalizedText
Definition: sopc_builtintypes.h:232
SOPC_AddressSpace_Get_DisplayName
SOPC_LocalizedText * SOPC_AddressSpace_Get_DisplayName(SOPC_AddressSpace *space, SOPC_AddressSpace_Node *node)
SOPC_AddressSpace_Has_Attribute
bool SOPC_AddressSpace_Has_Attribute(SOPC_AddressSpace *space, SOPC_AddressSpace_Node *node, SOPC_AttributeId attribute)
SOPC_AddressSpace_Node_Initialize
void SOPC_AddressSpace_Node_Initialize(SOPC_AddressSpace *space, SOPC_AddressSpace_Node *node, OpcUa_NodeClass element_type)
SOPC_AddressSpace_Set_StatusCode
bool SOPC_AddressSpace_Set_StatusCode(SOPC_AddressSpace *space, SOPC_AddressSpace_Node *node, SOPC_StatusCode status)
_OpcUa_ReferenceNode
Definition: sopc_types.h:1638
SOPC_AddressSpace_Get_NoOfArrayDimensions
int32_t SOPC_AddressSpace_Get_NoOfArrayDimensions(SOPC_AddressSpace *space, SOPC_AddressSpace_Node *node)
SOPC_AddressSpace_CreateReadOnlyNodes
SOPC_AddressSpace * SOPC_AddressSpace_CreateReadOnlyNodes(uint32_t nb_nodes, SOPC_AddressSpace_Node *nodes, uint32_t nb_variables, SOPC_Variant *variables)
Create an AddressSpace filled with given nodes and variants for variables values. The nodes are read ...
SOPC_AddressSpace_Get_ArrayDimensions
uint32_t * SOPC_AddressSpace_Get_ArrayDimensions(SOPC_AddressSpace *space, SOPC_AddressSpace_Node *node)
_OpcUa_ObjectTypeNode
Definition: sopc_types.h:1798
SOPC_AddressSpace_Node::method
OpcUa_MethodNode method
Definition: sopc_address_space.h:56
_OpcUa_ReferenceTypeNode
Definition: sopc_types.h:1917
SOPC_AddressSpace_ForEach
void SOPC_AddressSpace_ForEach(SOPC_AddressSpace *space, SOPC_AddressSpace_ForEach_Fct *pFunc, uintptr_t user_data)
SOPC_AddressSpace_Get_Value
SOPC_Variant * SOPC_AddressSpace_Get_Value(SOPC_AddressSpace *space, SOPC_AddressSpace_Node *node)
SOPC_AddressSpace_Get_References
OpcUa_ReferenceNode ** SOPC_AddressSpace_Get_References(SOPC_AddressSpace *space, SOPC_AddressSpace_Node *node)
SOPC_Value_Timestamp
Definition: sopc_address_space.h:43
SOPC_AddressSpace_Delete
void SOPC_AddressSpace_Delete(SOPC_AddressSpace *space)
Deletes the AddressSpace content. It clears the Variable / VariableType nodes values and clear/free e...
OpcUa_NodeClass
enum _OpcUa_NodeClass OpcUa_NodeClass
SOPC_AddressSpace_Get_BrowseName
SOPC_QualifiedName * SOPC_AddressSpace_Get_BrowseName(SOPC_AddressSpace *space, SOPC_AddressSpace_Node *node)
SOPC_AddressSpace_Get_DataType
SOPC_NodeId * SOPC_AddressSpace_Get_DataType(SOPC_AddressSpace *space, SOPC_AddressSpace_Node *node)
SOPC_AddressSpace_Node::reference_type
OpcUa_ReferenceTypeNode reference_type
Definition: sopc_address_space.h:59
SOPC_AddressSpace_Get_NodeClass
OpcUa_NodeClass * SOPC_AddressSpace_Get_NodeClass(SOPC_AddressSpace *space, SOPC_AddressSpace_Node *node)
SOPC_AddressSpace_AreReadOnlyNodes
bool SOPC_AddressSpace_AreReadOnlyNodes(const SOPC_AddressSpace *space)
Returns true if the AddressSpace has been created using SOPC_AddressSpace_CreateReadOnlyNodes.
SOPC_AddressSpace_Get_AccessLevel
SOPC_Byte SOPC_AddressSpace_Get_AccessLevel(SOPC_AddressSpace *space, SOPC_AddressSpace_Node *node)
SOPC_AddressSpace_Node::data_type
OpcUa_DataTypeNode data_type
Definition: sopc_address_space.h:55
SOPC_AddressSpace_Get_DataTypeDefinition
SOPC_ExtensionObject * SOPC_AddressSpace_Get_DataTypeDefinition(SOPC_AddressSpace *space, SOPC_AddressSpace_Node *node)
SOPC_AddressSpace_Append
SOPC_ReturnStatus SOPC_AddressSpace_Append(SOPC_AddressSpace *space, SOPC_AddressSpace_Node *node)
Appends a new node to the AddressSpace.
_OpcUa_ObjectNode
Definition: sopc_types.h:1763
SOPC_AttributeId
SOPC_AttributeId
Enumerated for all possible OPC UA attribute ids.
Definition: sopc_builtintypes.h:72
SOPC_AddressSpace_Get_Description
SOPC_LocalizedText * SOPC_AddressSpace_Get_Description(SOPC_AddressSpace *space, SOPC_AddressSpace_Node *node)
SOPC_AddressSpace_Get_UserWriteMask
uint32_t * SOPC_AddressSpace_Get_UserWriteMask(SOPC_AddressSpace *space, SOPC_AddressSpace_Node *node)
SOPC_AddressSpace_Get_ValueRank
int32_t * SOPC_AddressSpace_Get_ValueRank(SOPC_AddressSpace *space, SOPC_AddressSpace_Node *node)
SOPC_AddressSpace_Node::value_source_ts
SOPC_Value_Timestamp value_source_ts
Definition: sopc_address_space.h:52
SOPC_Byte
uint8_t SOPC_Byte
Definition: sopc_builtintypes.h:139
SOPC_AddressSpace_Get_Executable
SOPC_Boolean SOPC_AddressSpace_Get_Executable(SOPC_AddressSpace *space, SOPC_AddressSpace_Node *node)
SOPC_AddressSpace_Node::variable
OpcUa_VariableNode variable
Definition: sopc_address_space.h:61
SOPC_AddressSpace_Get_Node
SOPC_AddressSpace_Node * SOPC_AddressSpace_Get_Node(SOPC_AddressSpace *space, const SOPC_NodeId *key, bool *found)
SOPC_AddressSpace_ForEach_Fct
void SOPC_AddressSpace_ForEach_Fct(const uintptr_t key, const uintptr_t value, uintptr_t user_data)
Type of callback functions for SOPC_AddressSpace_ForEach. Both the key and value belong to the addres...
Definition: sopc_address_space.h:157
SOPC_AddressSpace
struct _SOPC_AddressSpace SOPC_AddressSpace
Definition: sopc_address_space.h:68
SOPC_AddressSpace_Node::variable_type
OpcUa_VariableTypeNode variable_type
Definition: sopc_address_space.h:62
SOPC_Variant
This structure provides variant encapsulation.
Definition: sopc_builtintypes.h:372
SOPC_AddressSpace_Get_WriteMask
uint32_t * SOPC_AddressSpace_Get_WriteMask(SOPC_AddressSpace *space, SOPC_AddressSpace_Node *node)
SOPC_AddressSpace_Node::object_type
OpcUa_ObjectTypeNode object_type
Definition: sopc_address_space.h:58
SOPC_Value_Timestamp::timestamp
SOPC_DateTime timestamp
Definition: sopc_address_space.h:44
SOPC_AddressSpace_Node_Clear
void SOPC_AddressSpace_Node_Clear(SOPC_AddressSpace *space, SOPC_AddressSpace_Node *node)
SOPC_DateTime
int64_t SOPC_DateTime
Definition: sopc_builtintypes.h:158
_OpcUa_VariableNode
Definition: sopc_types.h:1833
SOPC_AddressSpace_Create
SOPC_AddressSpace * SOPC_AddressSpace_Create(bool free_nodes)
Create an empty AddressSpace to fill with nodes with SOPC_AddressSpace_Append.
SOPC_Value_Timestamp
struct SOPC_Value_Timestamp SOPC_Value_Timestamp
SOPC_AddressSpace_Get_IsAbstract
SOPC_Boolean * SOPC_AddressSpace_Get_IsAbstract(SOPC_AddressSpace *space, SOPC_AddressSpace_Node *node)
SOPC_Boolean
SOPC_Byte SOPC_Boolean
Definition: sopc_builtintypes.h:141
SOPC_AddressSpace_Node::value_status
SOPC_StatusCode value_status
Definition: sopc_address_space.h:51
SOPC_AddressSpace_Get_NoOfReferences
int32_t * SOPC_AddressSpace_Get_NoOfReferences(SOPC_AddressSpace *space, SOPC_AddressSpace_Node *node)
SOPC_QualifiedName
Definition: sopc_builtintypes.h:226
SOPC_AddressSpace_Node::view
OpcUa_ViewNode view
Definition: sopc_address_space.h:63
SOPC_AddressSpace_Node::node_class
OpcUa_NodeClass node_class
Definition: sopc_address_space.h:50
SOPC_AddressSpace_Set_SourceTs
bool SOPC_AddressSpace_Set_SourceTs(SOPC_AddressSpace *space, SOPC_AddressSpace_Node *node, SOPC_Value_Timestamp ts)
SOPC_AddressSpace_Node::object
OpcUa_ObjectNode object
Definition: sopc_address_space.h:57
_OpcUa_MethodNode
Definition: sopc_types.h:1954
SOPC_AddressSpace_Get_StatusCode
SOPC_StatusCode SOPC_AddressSpace_Get_StatusCode(SOPC_AddressSpace *space, SOPC_AddressSpace_Node *node)
_OpcUa_ViewNode
Definition: sopc_types.h:1990
SOPC_ReturnStatus
SOPC_ReturnStatus
Definition: libs2opc_client.h:64