High Performance OPC UA Server SDK  1.2.0.193
ua_floatstore Struct Reference

Implementation of a store using in-memory float values. More...

#include <floatstore.h>

Public Member Functions

static void ua_floatstore_get_value (void *floatstore, ua_node_t node, unsigned int idx, bool source_ts, struct ua_indexrange *range, unsigned int num_ranges, struct ua_datavalue *result)
 
static ua_statuscode ua_floatstore_attach_value (void *floatstore, ua_node_t node, unsigned int idx, struct ua_indexrange *range, unsigned int num_ranges, struct ua_datavalue *value)
 
int ua_floatstore_register_node (struct ua_floatstore *store, float initial_value, ua_node_t node)
 Registers the given node in the floatstore. More...
 
float * ua_floatstore_clear (struct ua_floatstore *store)
 Clears the given store. More...
 
int ua_floatstore_init (struct ua_floatstore *store, uint8_t storeidx, float *values, unsigned int num_values)
 Initializes the float store. More...
 
uint8_t ua_floatstore_get_storeindex (struct ua_floatstore *store)
 Get the storeindex of a memorystore.
 

Data Fields

float * values
 Array with values.
 
unsigned int num_values
 Number of currently used values.
 
unsigned int max_values
 Number of elements in the array.
 
uint8_t storeidx
 Index of the store.
 

Detailed Description

Implementation of a store using in-memory float values.

A new floatstore must be initialized with a user provided array of float values using ua_floatstore_init(). The number of elements in the array is the capacity of the store. Then variables can be registered using ua_floatstore_register_node(), which connects the variable value attribute with one store element.

The raw float array is the data source of this store and can be directly accessed to set new float values.

Member Function Documentation

static ua_statuscode ua_floatstore_attach_value ( void *  floatstore,
ua_node_t  node,
unsigned int  idx,
struct ua_indexrange range,
unsigned int  num_ranges,
struct ua_datavalue value 
)

Implementation of the ua_store_attach function for the floatstore.

float * ua_floatstore_clear ( struct ua_floatstore store)

Clears the given store.

Parameters
storePointer to store context.
Returns
The values array passed in ua_floatstore_init.
static void ua_floatstore_get_value ( void *  floatstore,
ua_node_t  node,
unsigned int  idx,
bool  source_ts,
struct ua_indexrange range,
unsigned int  num_ranges,
struct ua_datavalue result 
)

Implementation of the ua_store_get function for the floatstore.

int ua_floatstore_init ( struct ua_floatstore store,
uint8_t  storeidx,
float *  values,
unsigned int  num_values 
)

Initializes the float store.

Parameters
storePointer to store context.
storeidxRequested store index. 0 = auto assign new index.
valuesArray of float values.
num_valuesArray size of values.
Returns
Zero on success or errorcode on failure.
int ua_floatstore_register_node ( struct ua_floatstore store,
float  initial_value,
ua_node_t  node 
)

Registers the given node in the floatstore.

This allocated a new slot in the real store and assigns the correct value_index to the node.

Parameters
storeContext of the floatstore.
initial_valueInitial value for this variable.
nodeHandle of node associated with the value.
Returns
Zero on success or errorcode on failure.

The documentation for this struct was generated from the following files: