Transformer SDK For C  7.0.1.307702
pipeline.h
Go to the documentation of this file.
1 /*
2  * Pipeline Transformer Module
3  *
4  * Copyright CAPLIN Systems Ltd 2000-2013
5  *
6  * $Author: andys $
7  * $DateTime: 2016/08/03 10:20:02 $
8  * $Change: 306911 $
9  * $Id: //CDev/V-7_0/rtas/modules/pipeline/pipeline.h#6 $
10  *
11  * Public API into the pipeline module
12  */
13 
14 #ifndef PIPELINE_H
15 #define PIPELINE_H
16 
17 
18 #include "transformer.h"
19 
20 #ifndef WIN32
21 #ifndef MODULEAPI
22 #define MODULEAPI
23 #endif
24 #else /* WIN32 */
25 #ifndef MODULEAPI
26 #define MODULEAPI _declspec(dllimport)
27 #endif
28 #endif /* WIN32 */
29 
30 
31 #define EMBED_LUA /* We only support lua at the moment */
32 
39 typedef struct _pipeline pipeline_t;
40 typedef struct pipeline_argument_s pipeline_argument_t;
41 
50 struct _pipeline {
51  void (*recv_update)(pipeline_t *pipeline, int feed, ds_data_t *dsdata, time_t tim, int update_from_memory_file);
52  void (*recv_nodata)(pipeline_t *pipeline, int feed, const char *subject, int flags);
53  void (*recv_status)(pipeline_t *pipeline, int feed, const char *subject, int status, int code, char *status_message);
54  int (*handle_request)(pipeline_t *pipeline, int feed, const char *subject);
55  int (*handle_discard)(pipeline_t *pipeline, int feed, const char *subject);
56  void (*recv_udp_signal)(pipeline_t *pipeline, const char *msg);
57  int (*exec_function)(pipeline_t *pipe, const char *func, int argc, char *argv[]); /* Execute an arbitrary function */
58  int (*exec_with_args)(pipeline_t *pipe, const char *func, int num_args, pipeline_argument_t *args);
59 };
60 
64 typedef struct {
65  char *initialise;
66  char *update;
67  char *nodata;
68  char *status;
69  char *request;
70  char *discard;
71  char *udpsig;
73 
80 typedef enum {
91 
92 
93 struct pipeline_argument_s {
95  int size;
96  union {
97  int num;
98  double fnum;
99  const char *str;
100  ds_data_t *dsdata;
101  pipeline_argument_t *values;
102  } value;
103 };
104 
105 
106 
108 #ifdef EMBED_LUA
109 #define NATIVE_FUNC(funcname,paramname) pipeline_return_type_t (funcname)(void *(paramname))
110 typedef int pipeline_return_type_t;
111 typedef pipeline_return_type_t (*pipeline_cb)(void *state);
112 #endif
113 
114 
122 typedef struct {
123  const char *lua_name;
124  const char *js_name;
125  int (*func)(void *state);
127 
151 typedef struct {
152  char *name;
153  int value;
154  const char *string;
156 
171 typedef struct {
172  int version;
173  int patch;
174  /* Functions for user extensions */
175  int (*pipeline_register_function)(char *name, pipeline_cb callback);
187  int (*pipeline_getarg)(void *state, int argnum, pipeline_datatype_t type, void *dest);
207  int (*pipeline_setret)(void *state, pipeline_datatype_t type, void *retval);
218  pipeline_return_type_t (*pipeline_return)(void *state);
224  /* Functions to control the generation and execution of a pipeline */
225  pipeline_t *(*pipeline_generate)(char *file, pipeline_eventnames_t *eventnames);
236  int (*pipeline_initialise)(pipeline_t *pipe);
247  int (*pipeline_release)(pipeline_t *pipeline);
256  /* Functions to store and retrieve data items from the object's database */
257  int (*pipeline_database_insert)(const char *symbol, const char *key, pipeline_datatype_t type, void *dataptr);
268  int (*pipeline_database_retrieve)(const char *symbol, const char *key, pipeline_datatype_t *type, void **dataptr);
282  int (*pipeline_database_delete)(const char *symbol);
291  int (*pipeline_register_function_closure)(char *name, pipeline_cb callback, void *closure);
304  void *(*pipeline_get_closure)(void *state);
310  int (*pipeline_setret_array)(void *state, int num, char **array);
321  int (*pipeline_setret_map)(void *state, int num, char **map_values);
341  int (*pipeline_getarg_from_map)(void *state, int argnum, const char *key, pipeline_datatype_t type, void *dest);
357  int (*pipeline_getarg_map_keys)(void *state, int argnum, char ***dest);
369  pipeline_t *(*pipeline_generate_with_log)(char *file, ds_log_t *logfile, pipeline_eventnames_t *eventnames);
380  int (*pipeline_get_num_args)(void *state);
388  int (*pipeline_register_library)(const char *libname, const pipeline_module_func_t *funcs, const pipeline_module_const_t *constants);
401  int (*pipeline_call_func)(void *state, int argnum, pipeline_argument_t *args, int num_args);
403 
404 
405 
406 
407 
408 #endif /* PIPELINE_H */
409 
Pipeline execution functions.
Definition: pipeline.h:50
void(* recv_nodata)(pipeline_t *pipeline, int feed, const char *subject, int flags)
Definition: pipeline.h:52
Interface returned to other modules which require integration with the pipeline.
Definition: pipeline.h:171
List of library functions to be registered.
Definition: pipeline.h:122
Definition: pipeline.h:89
char * initialise
Definition: pipeline.h:65
Definition: pipeline.h:84
int version
Definition: pipeline.h:172
char * nodata
Definition: pipeline.h:67
char * request
Definition: pipeline.h:69
void(* recv_update)(pipeline_t *pipeline, int feed, ds_data_t *dsdata, time_t tim, int update_from_memory_file)
Definition: pipeline.h:51
Definition: pipeline.h:85
void(* recv_udp_signal)(pipeline_t *pipeline, const char *msg)
Definition: pipeline.h:56
int(* handle_discard)(pipeline_t *pipeline, int feed, const char *subject)
Definition: pipeline.h:55
char * discard
Definition: pipeline.h:70
Definition: pipeline.h:87
char * status
Definition: pipeline.h:68
List of library constants to be registered.
Definition: pipeline.h:151
const char * string
Definition: pipeline.h:154
int patch
Definition: pipeline.h:173
int(* handle_request)(pipeline_t *pipeline, int feed, const char *subject)
Definition: pipeline.h:54
Definition: pipeline.h:81
struct _ds_log ds_log_t
The log file object.
Definition: datasrc.h:175
pipeline_datatype_t
Argument types.
Definition: pipeline.h:80
Names of the event handlers within the pipeline.
Definition: pipeline.h:64
char * update
Definition: pipeline.h:66
const char * js_name
Definition: pipeline.h:124
Definition: pipeline.h:86
A data update object.
Definition: datasrc.h:2420
int value
Definition: pipeline.h:153
Definition: pipeline.h:82
Definition: pipeline.h:88
Definition: pipeline.h:83
char * name
Definition: pipeline.h:152
const char * lua_name
Definition: pipeline.h:123
char * udpsig
Definition: pipeline.h:71
void(* recv_status)(pipeline_t *pipeline, int feed, const char *subject, int status, int code, char *status_message)
Definition: pipeline.h:53

Generated on Thu Oct 20 2016 17:27:24 for Transformer SDK For C