High Performance OPC UA Server SDK  1.2.0.193
ua_dict

Provides structs to describe UA datatypes and implements base functions based on these structs. More...

Data Structures

struct  ua_dict_field
 Struct to describe each field of a structure. More...
 
struct  ua_dict_structure
 Struct to describe another structure. More...
 

Macros

#define UA_DICT_FLAG_DEFAULT   0x00
 None of the other flags is set.
 
#define UA_DICT_FLAG_NS0   0x01
 Flag to set for namespace zero fields.
 
#define UA_DICT_FLAG_ARRAY   0x02
 Flag to set for array fields.
 
#define UA_DICT_FLAG_OMITTED   0x04
 Flag to set for omitted fields.
 
#define UA_DICT_FLAG_FIXED_SIZE   0x08
 Flag to set for fixed size fields.
 
#define UA_DICT_FLAG_OPTIONAL   0x10
 Flag to set for optional fields in structures with optional fields.
 
#define UA_DICT_FLAG_UNION_TYPE   0x20
 Flag to set for the union type field in unions, must be the first field.
 
#define UA_DICT_FLAG_ENCODING_MASK   0x40
 Flag to set for the encoding mask field in structures with optional fields, must be the first field.
 
#define UA_DICT_ENABLE_NAME
 
#define UA_DICT_NAME(name)   name,
 
#define UA_DICT_FLAG_DIAGNOSITICINFO   UA_DICT_FLAG_DEFAULT
 Flag for diagnostic info fields, handles the omitted field flag depending on the ENABLE_DIAGNOSTICS define.
 

Typedefs

typedef uint16_t ua_dict_type_t
 Type of the type field, determines maximum number of types.
 
typedef uint16_t ua_dict_size_t
 Type of size related fields, determines maximum size of structures.
 
typedef uint8_t ua_dict_ns_t
 Type of the ns field, determines maximum number and value of namespaces.
 

Functions

void ua_dict_clear_structure (const struct ua_dict_structure *strct, void *val)
 Frees all memory referenced by the structure and sets all direct members to zero. More...
 
void ua_dict_free_structure (const struct ua_dict_structure *strct, void *val)
 Frees all memory referenced by the structure. More...
 
int ua_dict_compare_structure (const struct ua_dict_structure *strct, const void *a, const void *b)
 Compare two structures of the same type. More...
 
int ua_dict_copy_structure (const struct ua_dict_structure *strct, void *dst, const void *src)
 Create a copy of a structure. More...
 
int ua_dict_get_scalar (const struct ua_dict_structure *strct, void *val, int field_idx, void **scalar)
 
int ua_dict_get_array (const struct ua_dict_structure *strct, void *val, int field_idx, void **array, int32_t *array_len)
 
int ua_dict_resize_array (const struct ua_dict_structure *strct, void *val, int field_idx, int32_t new_len)
 
int ua_dict_get_field_info (const struct ua_dict_structure *strct, int field_idx, uint32_t *ua_dict_flags, struct ua_nodeid *type_id, struct ua_nodeid *binary_encoding_id)
 
int ua_dict_field_name_to_idx (const struct ua_dict_structure *strct, const char *field_name)
 
static int ua_dict_get_scalar_by_name (const struct ua_dict_structure *strct, void *val, const char *field_name, void **scalar)
 
static int ua_dict_get_array_by_name (const struct ua_dict_structure *strct, void *val, const char *field_name, void **array, int32_t *array_len)
 
static int ua_dict_resize_array_by_name (const struct ua_dict_structure *strct, void *val, const char *field_name, int32_t new_len)
 
static int ua_dict_get_field_info_by_name (const struct ua_dict_structure *strct, const char *field_name, uint32_t *ua_dict_flags, struct ua_nodeid *type_id, struct ua_nodeid *binary_encoding_id)
 

Detailed Description

Provides structs to describe UA datatypes and implements base functions based on these structs.

Function Documentation

void ua_dict_clear_structure ( const struct ua_dict_structure strct,
void *  val 
)

Frees all memory referenced by the structure and sets all direct members to zero.

Parameters
strctDescription of the structure to clear.
valStructure to clear.
int ua_dict_compare_structure ( const struct ua_dict_structure strct,
const void *  a,
const void *  b 
)

Compare two structures of the same type.

Compares the content of the structure a to the content of the structure b. If a is smaller than b, an integer less than zero is returned, if a is bigger than b, an integer greater than zero is returned. If both structs are equal zero is returned.

Parameters
strctDescription of the structures to compare.
int ua_dict_copy_structure ( const struct ua_dict_structure strct,
void *  dst,
const void *  src 
)

Create a copy of a structure.

Copy all fields from structure src to structre dst. Creates a deep copy so all content is recusively copied and both src and dst can be used and must be freed separately.

Parameters
strctDescription of the structure to copy.
dstDestination structure, must be allocated by the caller.
Returns
Zero on success or errorcode on failure.
void ua_dict_free_structure ( const struct ua_dict_structure strct,
void *  val 
)

Frees all memory referenced by the structure.

Pointers inside the structure must not be accessd after calling this function. The structure itself is not freed.

Parameters
strctDescription of the structure to free.
valStructure to free.