Diffusion C API  6.10.3
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
value-stream.h File Reference

Value stream related callback functions. More...

Data Structures

struct  value_stream_s
 

Typedefs

typedef int(* value_stream_on_subscription )(const char *const topic_path, const TOPIC_SPECIFICATION_T *specification, void *context)
 Callback for subscription. More...
 
typedef int(* value_stream_on_unsubscription )(const char *const topic_path, const TOPIC_SPECIFICATION_T *const specification, NOTIFY_UNSUBSCRIPTION_REASON_T reason, void *context)
 Callback for unsubscription. More...
 
typedef int(* value_stream_on_value )(const char *const topic_path, const TOPIC_SPECIFICATION_T *const specification, DIFFUSION_DATATYPE datatype, const DIFFUSION_VALUE_T *const old_value, const DIFFUSION_VALUE_T *const new_value, void *context)
 Callback for when a value has been received for the topic. More...
 
typedef void(* value_stream_on_close )(void)
 Callback for when a value stream has been closed.
 
typedef void(* value_stream_on_error )(const DIFFUSION_ERROR_T *error)
 Callback for when a value stream has encountered an error. More...
 

Detailed Description

Value stream related callback functions.

Typedef Documentation

typedef void(* value_stream_on_error)(const DIFFUSION_ERROR_T *error)

Callback for when a value stream has encountered an error.

Parameters
errorcontaining the error code and description of the error. The context to this will be the value stream's context.
typedef int(* value_stream_on_subscription)(const char *const topic_path, const TOPIC_SPECIFICATION_T *specification, void *context)

Callback for subscription.

Parameters
topic_paththe path of the topic subscribed to
specificationthe specification of the topic
contextuser-supplied context from the initial add_topic_from_specification call.
Returns
HANDLER_SUCCESS or HANDLER_FAILURE.
typedef int(* value_stream_on_unsubscription)(const char *const topic_path, const TOPIC_SPECIFICATION_T *const specification, NOTIFY_UNSUBSCRIPTION_REASON_T reason, void *context)

Callback for unsubscription.

Parameters
topic_paththe path of the topic subscribed to
specificationthe specification of the topic
reasonthe unsubscription reason
contextuser-supplied context from the initial add_topic_from_specification call.
Returns
HANDLER_SUCCESS or HANDLER_FAILURE.
typedef int(* value_stream_on_value)(const char *const topic_path, const TOPIC_SPECIFICATION_T *const specification, DIFFUSION_DATATYPE datatype, const DIFFUSION_VALUE_T *const old_value, const DIFFUSION_VALUE_T *const new_value, void *context)

Callback for when a value has been received for the topic.

Parameters
topic_paththe path of the topic subscribed to
specificationthe specification of the topic
datatypethe value stream datatype
old_valuethe previous value for topic. Will be null for the initial call to on_value for a topic. It can also be null if the topic's data type supports null values. This value is intended to be called with its corresponding datatype value reader. i.e read_diffusion_string_value, read_diffusion_binary_value, read_diffusion_int64_value, etc.
new_valuethe new value derived from the last update received from the server. It can be null if the topic's data type supports null values. This value is intended to be called with its corresponding datatype value reader. i.e read_diffusion_string_value, read_diffusion_binary_value, read_diffusion_int64_value, etc.
contextUser-supplied context from the initial add_topic_from_specification call.
Returns
HANDLER_SUCCESS or HANDLER_FAILURE.