High Performance OPC UA Server SDK  1.2.0.193
ua_type_table

Management for builtin and custom structures registered at the encoder. More...

Data Structures

struct  ua_type_table_base_fcts
 Base functions for builtin types. More...
 
struct  ua_type_table_encoder_fcts
 Encode and decode functions for builtin types. More...
 
struct  ua_type_table
 Struct for one entry in the type table. More...
 

Enumerations

enum  ua_type_table_sorting { UA_TYPE_TABLE_SORTING_NONE, UA_TYPE_TABLE_SORTING_ASC }
 Possible sortings for custom type tables to be registered. More...
 

Functions

const struct ua_type_tableua_type_table_find (uint16_t ns)
 Lookup the type table for a certain namespace index.
 
int ua_type_table_register_table (uint16_t nsidx, struct ua_dict_structure *structures, uint16_t num_structures, uint16_t max_structures, enum ua_type_table_sorting sorting)
 Register new type table for a certain namespace. More...
 
int ua_type_table_register_const_table (uint16_t nsidx, const struct ua_dict_structure *structures, uint16_t num_structures, enum ua_type_table_sorting sorting)
 Register new constant type table for a certain namespace. More...
 
int ua_type_table_register_structure (uint16_t nsidx, const struct ua_dict_structure *structure)
 Add a new type to an existing type table. More...
 
int ua_type_table_init (const struct ua_type_table_encoder_fcts *ns0_encoder_fcts)
 Register the encoder functions for ns 0 and validate ns 0 types. More...
 
void ua_type_table_clear (void)
 Clear all registered type tables. More...
 
const struct ua_dict_structureua_type_table_lookup_local_type (uint16_t local_ns, uint32_t local_type)
 Lookup a structure description by its local type. More...
 
const struct ua_dict_structureua_type_table_lookup_binary_encoding (const struct ua_nodeid *binary_encoding_id, uint32_t *local_type)
 Lookup a structure description by its binary encoding id. More...
 
const struct ua_dict_structureua_type_table_lookup_type_id (const struct ua_nodeid *type_id, uint32_t *local_type)
 Lookup a structure description by its type id. More...
 

Variables

const struct
ua_type_table_base_fcts 
g_base_fcts_ns0 [UA_TYPE_TABLE_NUM_NS0_FCTS]
 Array with namespace zero builtin base functions (copy, compare, clear)
 
const struct ua_dict_structure g_type_table_ns0 [UA_TYPE_NUM_VALUES-countof(g_base_fcts_ns0)]
 Array with namespace zero structures.
 

Detailed Description

Management for builtin and custom structures registered at the encoder.

These are automatically decoded when found inside an extensionobject.

Enumeration Type Documentation

Possible sortings for custom type tables to be registered.

Based on the sorting the lookup function is chosen.

Enumerator
UA_TYPE_TABLE_SORTING_NONE 

The table is not sorted at all.

UA_TYPE_TABLE_SORTING_ASC 

The type ids and encoding ids are each sorted numerical ascending.

Function Documentation

void ua_type_table_clear ( void  )

Clear all registered type tables.

Called during encoder cleanup.

int ua_type_table_init ( const struct ua_type_table_encoder_fcts ns0_encoder_fcts)

Register the encoder functions for ns 0 and validate ns 0 types.

Called during the encoder initialization.

const struct ua_dict_structure* ua_type_table_lookup_binary_encoding ( const struct ua_nodeid binary_encoding_id,
uint32_t *  local_type 
)

Lookup a structure description by its binary encoding id.

Parameters
local_typeIf not NULL the local type of the found structure is written to this address.
Returns
Pointer to the structure description or NULL if not found.
const struct ua_dict_structure* ua_type_table_lookup_local_type ( uint16_t  local_ns,
uint32_t  local_type 
)

Lookup a structure description by its local type.

Returns
Pointer to the structure description or NULL if not found.
const struct ua_dict_structure* ua_type_table_lookup_type_id ( const struct ua_nodeid type_id,
uint32_t *  local_type 
)

Lookup a structure description by its type id.

Parameters
local_typeIf not NULL the local type of the found structure is written to this address.
Returns
Pointer to the structure description or NULL if not found.
int ua_type_table_register_const_table ( uint16_t  nsidx,
const struct ua_dict_structure structures,
uint16_t  num_structures,
enum ua_type_table_sorting  sorting 
)

Register new constant type table for a certain namespace.

Parameters
nsidxNamespace index of the new types, there can only be one table for each namespace.
structuresArray with descriptions of the new types.
num_structuresNumber of valid entries in the structures array.
sortingSorting of the new types, in case of UA_TYPE_TABLE_SORTING_NONE this function will try to use a better sorting.
Returns
Zero on success or errorcode on error.
int ua_type_table_register_structure ( uint16_t  nsidx,
const struct ua_dict_structure structure 
)

Add a new type to an existing type table.

The existing type table must have been registered with ua_type_table_register_table and still a free entry.

All memory referenced by the struct will be freed with ipc_free at shutdown. The struct itself will not be freed.

Parameters
nsidxNamespace index of the new type.
structureThe new type to add. All memory referenced by this struct will be freed with ipc_free at shutdown. The struct itself will not be freed.
Returns
Zero on success or errorcode on error.
int ua_type_table_register_table ( uint16_t  nsidx,
struct ua_dict_structure structures,
uint16_t  num_structures,
uint16_t  max_structures,
enum ua_type_table_sorting  sorting 
)

Register new type table for a certain namespace.

This functions allows to register new types right now, but also add single types later using ua_type_table_register_structure. At server shutdown the table and their referenced fields are freed using ipc_free.

Parameters
nsidxNamespace index of the new types, there can only be one table for each namespace.
structuresArray with descriptions of the new types.
num_structuresNumber of valid entries in the structures array, may also be 0.
max_structuresMaximum number of entries in the structres array. The difference to num_structes determines the number of types that can be added later.
sortingSorting of the types and all types added later.
Returns
Zero on success or errorcode on error.