High Performance OPC UA Server SDK  1.1.0.158
valuestore

Functions and definitions for using the valuestore infrastructure of the SDK. More...

Data Structures

struct  ua_valuestore_interface
 
struct  ua_floatstore
 Implementation of a store using in-memory float values. More...
 
struct  ua_memorystore
 Implementation of a store using in-memory values. More...
 
struct  ua_staticstore
 Implementation of a store using preencoded values. More...
 

Typedefs

typedef void(* ua_valuestore_get )(void *store, ua_node_t node, unsigned int valueindex, bool source_ts, struct ua_indexrange *range, unsigned int num_ranges, struct ua_datavalue *value)
 Get the value identified with valueindex from the store. More...
 
typedef ua_statuscode(* ua_valuestore_attach )(void *store, ua_node_t node, unsigned int valueindex, struct ua_indexrange *range, unsigned int num_ranges, struct ua_datavalue *value)
 Attach the value identified with valueindex to the store. More...
 
typedef int(* ua_valuestore_add )(void *store, unsigned int *valueindex, const char *data, unsigned int len)
 Adds a new value to the store. More...
 

Functions

void ua_valuestore_interface_init (struct ua_valuestore_interface *store_interface)
 Initialize a ua_store_interface structure.
 
int ua_valuestore_register_store (struct ua_valuestore_interface *store_if, uint8_t *storeindex)
 Register a new store. More...
 
int ua_valuestore_unregister_store (uint8_t storeindex)
 Unregister a store. More...
 
struct ua_valuestore_interfaceua_valuestore_get_storeif (uint8_t storeindex)
 
int ua_valuestore_get_store_index (const void *store)
 

Detailed Description

Functions and definitions for using the valuestore infrastructure of the SDK.

For store implementations provided by the SDK see:

Typedef Documentation

typedef int(* ua_valuestore_add)(void *store, unsigned int *valueindex, const char *data, unsigned int len)

Adds a new value to the store.

This function is used for populating a value store at startup, e.g. by loading a binary file.

Parameters
storeThe store to add the value to.
valueindexThe assigned valueindex returned by the store.
valueThe value to add.
typedef ua_statuscode(* ua_valuestore_attach)(void *store, ua_node_t node, unsigned int valueindex, struct ua_indexrange *range, unsigned int num_ranges, struct ua_datavalue *value)

Attach the value identified with valueindex to the store.

This function may take responsibility for the given ua_datavalue struct and clear it. In case of an error a bad statuscode must be returned.

This function is used to implement writing of the value attribute. It is designed to take the ownership of the value and does not perform a deep copy. Hence it is named attach instead of write or set.

For an example how to implement this function see: Write Value

typedef void(* ua_valuestore_get)(void *store, ua_node_t node, unsigned int valueindex, bool source_ts, struct ua_indexrange *range, unsigned int num_ranges, struct ua_datavalue *value)

Get the value identified with valueindex from the store.

The function must copy the value in the provided ua_datavalue struct. In case of an error while getting the value the statuscode of the value be set to the corresponding bad statuscode.

This function is used to implement reading of the value attribute.

For an example how to implement this function see: Read Value

Function Documentation

int ua_valuestore_register_store ( struct ua_valuestore_interface store_if,
uint8_t *  storeindex 
)

Register a new store.

Parameters
store_ifStore context and functions for the new store. This function will create a copy of the struct so caller is responsible for freeing memory.
storeindexPointer to store index. If the store index is 0 the next free index will be assigned and written to this value. If the store index is not 0 this index will be assigned to the store, if this index was already taken by another store an error is returned.
Returns
Zero on success or errorcode on failure.
int ua_valuestore_unregister_store ( uint8_t  storeindex)

Unregister a store.

Parameters
storeindexIndex of store to unregister.
Returns
Zero on success or errorcode on failure.