Transformer SDK For C  6.2.11.309924
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 11:14:36 $
8  * $Change: 306914 $
9  * $Id: //CDev/V-6_2/rtas/modules/pipeline/pipeline.h#4 $
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 
38 typedef struct pipeline_argument_s pipeline_argument_t;
39 typedef struct _pipeline pipeline_t;
40 
49 struct _pipeline {
50  void (*recv_update)(pipeline_t *pipeline, int feed, ds_data_t *dsdata, time_t tim, int update_from_memory_file);
51  void (*recv_nodata)(pipeline_t *pipeline, int feed, const char *subject, int flags);
52  void (*recv_status)(pipeline_t *pipeline, int feed, const char *subject, int status, int code, char *status_message);
53  int (*handle_request)(pipeline_t *pipeline, int feed, const char *subject);
54  int (*handle_discard)(pipeline_t *pipeline, int feed, const char *subject);
55  void (*recv_udp_signal)(pipeline_t *pipeline, const char *msg);
56  int (*exec_function)(pipeline_t *pipe, const char *func, int argc, char *argv[]); /* Execute an arbitrary function */
57  int (*exec_with_args)(pipeline_t *pipe, const char *func, int num_args, pipeline_argument_t *args);
58 };
59 
63 typedef struct {
64  char *initialise;
65  char *update;
66  char *nodata;
67  char *status;
68  char *request;
69  char *discard;
70  char *udpsig;
72 
79 typedef enum {
87 
88 struct pipeline_argument_s {
90  union {
91  int num;
92  double fnum;
93  const char *str;
94  ds_data_t *dsdata;
95  } value;
96 };
97 
98 
100 #ifdef EMBED_LUA
101 #define NATIVE_FUNC(funcname,paramname) pipeline_return_type_t (funcname)(void *(paramname))
102 typedef int (*pipeline_cb)(void *state);
103 typedef int pipeline_return_type_t;
104 #endif
105 
120 typedef struct {
121  int version;
122  int patch;
123  /* Functions for user extensions */
124  int (*pipeline_register_function)(char *name, pipeline_cb callback);
136  int (*pipeline_getarg)(void *state, int argnum, pipeline_datatype_t type, void *dest);
151  int (*pipeline_setret)(void *state, pipeline_datatype_t type, void *retval);
162  pipeline_return_type_t (*pipeline_return)(void *state);
168  /* Functions to control the generation and execution of a pipeline */
169  pipeline_t *(*pipeline_generate)(char *file, pipeline_eventnames_t *eventnames);
179  int (*pipeline_initialise)(pipeline_t *pipe);
190  int (*pipeline_release)(pipeline_t *pipeline);
199  /* Functions to store and retrieve data items from the object's database */
200  int (*pipeline_database_insert)(const char *symbol, const char *key, pipeline_datatype_t type, void *dataptr);
211  int (*pipeline_database_retrieve)(const char *symbol, const char *key, pipeline_datatype_t *type, void **dataptr);
225  int (*pipeline_database_delete)(const char *symbol);
234  int (*pipeline_register_function_closure)(char *name, pipeline_cb callback, void *closure);
247  void *(*pipeline_get_closure)(void *state);
253  int (*pipeline_setret_array)(void *state, int num, char **array);
264  int (*pipeline_setret_map)(void *state, int num, char **map_values);
284  int (*pipeline_getarg_from_map)(void *state, int argnum, const char *key, pipeline_datatype_t type, void *dest);
300  int (*pipeline_getarg_map_keys)(void *state, int argnum, char ***dest);
313  pipeline_t *(*pipeline_generate_with_log)(char *file, ds_log_t *logfile, pipeline_eventnames_t *eventnames);
325  int (*pipeline_get_num_args)(void *state);
334 
335 
336 
337 
338 
339 #endif /* PIPELINE_H */
340 
Pipeline execution functions.
Definition: pipeline.h:49
void(* recv_nodata)(pipeline_t *pipeline, int feed, const char *subject, int flags)
Definition: pipeline.h:51
Interface returned to other modules which require integration with the pipeline.
Definition: pipeline.h:120
char * initialise
Definition: pipeline.h:64
Definition: pipeline.h:83
int version
Definition: pipeline.h:121
char * nodata
Definition: pipeline.h:66
char * request
Definition: pipeline.h:68
void(* recv_update)(pipeline_t *pipeline, int feed, ds_data_t *dsdata, time_t tim, int update_from_memory_file)
Definition: pipeline.h:50
Definition: pipeline.h:84
void(* recv_udp_signal)(pipeline_t *pipeline, const char *msg)
Definition: pipeline.h:55
int(* handle_discard)(pipeline_t *pipeline, int feed, const char *subject)
Definition: pipeline.h:54
char * discard
Definition: pipeline.h:69
char * status
Definition: pipeline.h:67
int patch
Definition: pipeline.h:122
int(* handle_request)(pipeline_t *pipeline, int feed, const char *subject)
Definition: pipeline.h:53
Definition: pipeline.h:80
struct _ds_log ds_log_t
The log file object.
Definition: datasrc.h:186
pipeline_datatype_t
Argument types.
Definition: pipeline.h:79
Names of the event handlers within the pipeline.
Definition: pipeline.h:63
char * update
Definition: pipeline.h:65
Definition: pipeline.h:85
A data update object.
Definition: datasrc.h:2425
Definition: pipeline.h:81
Definition: pipeline.h:82
char * udpsig
Definition: pipeline.h:70
void(* recv_status)(pipeline_t *pipeline, int feed, const char *subject, int status, int code, char *status_message)
Definition: pipeline.h:52

Generated on Sat Aug 26 2017 12:36:31 for Transformer SDK For C