High Performance OPC UA Server SDK
1.7.1.383
|
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_idx_table |
Index table for a type table to enable an efficient lookup using the encoding id. 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, UA_TYPE_TABLE_SORTING_IDX_TABLE } |
Possible sortings for custom type tables to be registered. More... | |
Functions | |
BASE_EXPORT const struct ua_type_table * | ua_type_table_find (uint16_t ns) |
Lookup the type table for a certain namespace index. More... | |
BASE_EXPORT int | ua_type_table_register_table (const char *ns_url, 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... | |
BASE_EXPORT int | ua_type_table_register_const_table (const char *ns_url, 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... | |
BASE_EXPORT int | ua_type_table_register_const_table_with_idx_table (const char *ns_url, uint16_t nsidx, const struct ua_dict_structure *structures, uint16_t num_structures, const struct ua_type_table_idx_table *idx_table) |
Like ua_type_table_register_const_table, but with an additional index table for efficient lookup. More... | |
BASE_EXPORT 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... | |
BASE_EXPORT 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... | |
BASE_EXPORT void | ua_type_table_clear (void) |
Clear all registered type tables. More... | |
BASE_EXPORT 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. More... | |
BASE_EXPORT 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. More... | |
BASE_EXPORT 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. More... | |
BASE_EXPORT void | ua_type_table_clear_structure (uint16_t local_ns, uint32_t local_type, void *val) |
Clear a structure identified by its local namespace and type. | |
BASE_EXPORT int | ua_type_table_compare_structure (uint16_t local_ns, uint32_t local_type, const void *a, const void *b) |
Compare two structures of the same type identified by their local namespace and type. | |
BASE_EXPORT int | ua_type_table_copy_structure (uint16_t local_ns, uint32_t local_type, void *dst, const void *src) |
Copy a structure identified by its local namespace and type. | |
BASE_EXPORT SDK_INTERNAL int | ua_type_table_create_nsidx_mapping (const struct ua_string *ns_array, uint16_t num_ns_array, struct ua_nsmap **map, int32_t *num_map) |
Create a namespace index mapping table for the locally registered type tables and the given remote urls. More... | |
Variables | |
BASE_EXPORT 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) | |
BASE_EXPORT const struct ua_dict_structure | g_type_table_ns0 [UA_TYPE_NUM_VALUES - countof(g_base_fcts_ns0)] |
Array with namespace zero structures. | |
BASE_EXPORT const struct ua_type_table_idx_table | g_type_table_ns0_idx_table [UA_TYPE_NUM_VALUES - countof(g_base_fcts_ns0)] |
Index table for g_type_table_ns0. | |
Management for builtin and custom structures registered at the encoder.
These are automatically decoded when found inside an extensionobject.
Possible sortings for custom type tables to be registered.
Based on the sorting the lookup function is chosen.
BASE_EXPORT void ua_type_table_clear | ( | void | ) |
Clear all registered type tables.
Called during encoder cleanup.
BASE_EXPORT SDK_INTERNAL int ua_type_table_create_nsidx_mapping | ( | const struct ua_string * | ns_array, |
uint16_t | num_ns_array, | ||
struct ua_nsmap ** | map, | ||
int32_t * | num_map | ||
) |
Create a namespace index mapping table for the locally registered type tables and the given remote urls.
ns_array | Array of namespace urls, the index in the array is used as the remote index in the resulting map. |
num_ns_array | Number of entries in the array. |
map | The nsidx map is allocated by this function and must be freed by the caller with ipc_free, if the function indicates success. |
num_map | Number of entries in the map. |
BASE_EXPORT const struct ua_type_table* ua_type_table_find | ( | uint16_t | ns | ) |
Lookup the type table for a certain namespace index.
ns | The namespace index to search for. |
BASE_EXPORT 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.
BASE_EXPORT 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.
binary_encoding_id | The node id of the binary encoding node. |
local_type | If not NULL the local type of the found structure is written to this address. |
BASE_EXPORT 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.
local_ns | The namespace index of the type. |
local_type | The SDK internal typeid of this type. |
BASE_EXPORT 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.
type_id | The node id of the type node. |
local_type | If not NULL the local type of the found structure is written to this address. |
BASE_EXPORT int ua_type_table_register_const_table | ( | const char * | ns_url, |
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.
ns_url | Namespace url of the new types, there can only be one table for each namespace. |
nsidx | Namespace index of the new types, there can only be one table for each namespace. |
structures | Array with descriptions of the new types. |
num_structures | Number of valid entries in the structures array. |
sorting | Sorting of the new types, in case of UA_TYPE_TABLE_SORTING_NONE this function will try to use a better sorting. |
BASE_EXPORT int ua_type_table_register_const_table_with_idx_table | ( | const char * | ns_url, |
uint16_t | nsidx, | ||
const struct ua_dict_structure * | structures, | ||
uint16_t | num_structures, | ||
const struct ua_type_table_idx_table * | idx_table | ||
) |
Like ua_type_table_register_const_table, but with an additional index table for efficient lookup.
In case it is not possible to sort the structures array by both type id and encoding id ascending, this function allows the structures array to be sorted by type id and and additional index table that is sorted by encoding id. This allows an efficient lookup when searching by type id and encoding id. The index table must be of the same length as the structures array.
BASE_EXPORT 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.
nsidx | Namespace index of the new type. |
structure | The 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. |
BASE_EXPORT int ua_type_table_register_table | ( | const char * | ns_url, |
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.
ns_url | Namespace url of the new types, there can only be one table for each namespace. |
nsidx | Namespace index of the new types, there can only be one table for each namespace. |
structures | Array with descriptions of the new types. |
num_structures | Number of valid entries in the structures array, may also be 0. |
max_structures | Maximum number of entries in the structres array. The difference to num_structes determines the number of types that can be added later. |
sorting | Sorting of the types and all types added later. |