Diffusion C API  5.9.4
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
svc-state.h File Reference

This file contains functions required to implement a state provider; that is, a control client which provides the content of one or more Diffusion topics. More...

Data Structures

struct  svc_state_request_s
 When a request for state is passed to a registered handler, this structure is populated with information regarding the client and topic name for which state is being requested. More...
 
struct  svc_state_response_s
 A handler which provides topic state will populate a structure of this type. More...
 
struct  state_handlers_s
 
struct  state_params_s
 Structure supplied to a register_state_provider() call. More...
 

Macros

#define STATE_HANDLERS
 Callbacks which can be registered by a state provider.
 

Typedefs

typedef struct svc_state_request_s SVC_STATE_REQUEST_T
 When a request for state is passed to a registered handler, this structure is populated with information regarding the client and topic name for which state is being requested.
 
typedef struct svc_state_response_s SVC_STATE_RESPONSE_T
 A handler which provides topic state will populate a structure of this type.
 
typedef int(* on_topic_control_registration_cb )(SESSION_T *session, const char *topic_path, void *context)
 Callback for on_topic_control_registration(). More...
 
typedef int(* on_state_provider_cb )(SESSION_T *session, const SVC_STATE_REQUEST_T *request, SVC_STATE_RESPONSE_T *response, void *context)
 Callback for on_state_provider(). More...
 
typedef struct state_params_s STATE_PARAMS_T
 Structure supplied to a register_state_provider() call.
 

Functions

void register_state_provider (SESSION_T *session, const STATE_PARAMS_T params)
 Register a state provider with Diffusion. More...
 

Detailed Description

This file contains functions required to implement a state provider; that is, a control client which provides the content of one or more Diffusion topics.

Typedef Documentation

typedef int(* on_state_provider_cb)(SESSION_T *session, const SVC_STATE_REQUEST_T *request, SVC_STATE_RESPONSE_T *response, void *context)

Callback for on_state_provider().

Parameters
sessionThe current active session.
requestThe incoming state request.
responseA structure to be populated with the state response.
contextUser-supplied context from the register_state_provider() call.
Returns
HANDLER_SUCCESS or HANDLER_FAILURE.
typedef int(* on_topic_control_registration_cb)(SESSION_T *session, const char *topic_path, void *context)

Callback for on_topic_control_registration().

Parameters
sessionThe current active session.
pathThe path for which a handler has been registered.
contextUser-supplied context from the register_state_provider() call.
Returns
HANDLER_SUCCESS or HANDLER_FAILURE.