Added quantiling UDAFs
[com/gs-lite.git] / src / lib / gscphost / include / callbackregistries.h
index 8f3edc7..9937f56 100644 (file)
-/* ------------------------------------------------
- Copyright 2014 AT&T Intellectual Property
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
- http://www.apache.org/licenses/LICENSE-2.0
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- ------------------------------------------- */
-#ifndef CALLBACKREGISTRIES_H
-#define CALLBACKREGISTRIES_H
-#include "gsconfig.h"
-#include "gstypes.h"
-
-#include "fta.h"
-#include "gscpipc.h"
-
-
-/* This registry is used to keep track of FTAswithin the current process
- * they are registerd when they are initiated and unregisterd if
- * they are freed
- */
-
-/* registers an alloc function of an FTA and returns a unique index */
-gs_retval_t ftacallback_add_alloc(FTAname name, alloc_fta fta_alloc_functionptr, gs_uint64_t prefilter);
-
-/* unregisters an alloc function of an FTA and makes the index available
- * for reuse
- */
-
-gs_retval_t ftacallback_rm_alloc(gs_uint32_t index);
-
-/* returns the function pointer of the callback function for a given
- * index
- */
-
-alloc_fta ftacallback_get_alloc(gs_int32_t index);
-
-/* returns the prefilter for a given
- * index
- */
-
-gs_uint64_t ftacallback_get_prefilter(gs_int32_t index);
-
-/* The second registry is used to keep track of to which process a particular
- stream ID should be posted too.
- */
-
-/* associate ringbuffer with streamid (using refcounting) */
-gs_retval_t ftacallback_add_streamid(struct ringbuf * r, gs_uint32_t streamid);
-
-/* unassosciate a ringbuffer from a streamid */
-
-gs_retval_t ftacallback_rm_streamid(struct ringbuf * r, gs_uint32_t streamid);
-
-/* starts an itteration through all ringbuffers for a particular streamid */
-
-gs_retval_t ftacallback_start_streamid(gs_int32_t streamid);
-
-/* returns all the ringbuffer associated with the streamid passed in
- * ftacallback_start_streamid
- */
-struct ringbuf * ftacallback_next_streamid(gs_int32_t * state);
-
-/* set the state for a given streamid and destination process */
-
-gs_retval_t ftacallback_state_streamid(gs_int32_t streamid,FTAID process, gs_int32_t state);
-
-/* The third registry is used to keep track of which process is blocked
- on which ringbuf
- */
-
-/* associate msgid with ringbuf  */
-gs_retval_t ftacallback_add_wakeup(FTAID ftaid, struct ringbuf * r);
-
-/* starts an itteration through all msgids associated with
- a streamid. This also uses data kept in the second
- registry
- */
-gs_retval_t ftacallback_start_wakeup(gs_uint32_t streamid);
-
-/* returns all the msgid blocked on the streamid passed in
- * ftacallback_start_streamid and removes the msgid from
- * the wakeup list
- */
-FTAID * ftacallback_next_wakeup();
-
-
-/*
- * the following two functions insert and remove an  instance
- * of an FTA from the active list.
- */
-
-gs_retval_t ftaexec_insert(struct FTA * after, struct FTA * new);
-gs_retval_t ftaexec_remove(struct FTA * id);
-
-/*
- * FTA's cannot be dynamically installed (since we currently don't
- * have a run-time linker in the card).  however, new parameterized
- * instances of previously installed FTAs can be created.  The FTA
- * template IDs have to defined in an include file.  the following
- * call will result in a call to the FTA's alloc_fta function.
- */
-
-struct FTA * ftaexec_alloc_instance(gs_uint32_t index, struct FTA * reuse,
-                                    gs_uint32_t reusable,
-                                    gs_int32_t command, gs_int32_t sz, void *  data);
-
-
-/*
- * the next two functions result in callouts to the corresponding FTA
- * functions (fta_free, control_fta).
- */
-
-gs_retval_t ftaexec_free_instance(struct FTA * FTA_id, gs_uint32_t recursive);
-
-gs_retval_t ftaexec_control(struct FTA * FTA_id, gs_int32_t command, gs_int32_t sz, void * value);
-
-gs_retval_t ftaexec_process_control(gs_int32_t command, gs_int32_t sz, void * value);
-
-/* Start itteration through list of active FTA */
-
-gs_retval_t ftaexec_start();
-
-/* get one FTA at a time */
-
-struct FTA * ftaexec_next();
-
-
-/* HFTA internal print function*/
-
-gs_retval_t add_printfunction_to_stream(struct FTA * ftaid, gs_sp_t schema, gs_sp_t path, gs_sp_t basename,
-                                        gs_sp_t temporal_field, gs_sp_t split_field, gs_uint32_t delta, gs_uint32_t split);
-
-gs_retval_t print_stream(struct FTA * self, gs_int32_t sz, void *tuple);
-
-
-#endif
+/* ------------------------------------------------\r
+ Copyright 2014 AT&T Intellectual Property\r
+ Licensed under the Apache License, Version 2.0 (the "License");\r
+ you may not use this file except in compliance with the License.\r
+ You may obtain a copy of the License at\r
\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+ ------------------------------------------- */\r
+#ifndef CALLBACKREGISTRIES_H\r
+#define CALLBACKREGISTRIES_H\r
+#include "gsconfig.h"\r
+#include "gstypes.h"\r
+\r
+#include "fta.h"\r
+#include "gscpipc.h"\r
+\r
+\r
+/* This registry is used to keep track of FTAswithin the current process\r
+ * they are registerd when they are initiated and unregisterd if\r
+ * they are freed\r
+ */\r
+\r
+/* registers an alloc function of an FTA and returns a unique index */\r
+gs_retval_t ftacallback_add_alloc(FTAname name, alloc_fta fta_alloc_functionptr, gs_uint64_t prefilter);\r
+\r
+/* unregisters an alloc function of an FTA and makes the index available\r
+ * for reuse\r
+ */\r
+\r
+gs_retval_t ftacallback_rm_alloc(gs_uint32_t index);\r
+\r
+/* returns the function pointer of the callback function for a given\r
+ * index\r
+ */\r
+\r
+alloc_fta ftacallback_get_alloc(gs_int32_t index);\r
+\r
+/* returns the prefilter for a given\r
+ * index\r
+ */\r
+\r
+gs_uint64_t ftacallback_get_prefilter(gs_int32_t index);\r
+\r
+/* The second registry is used to keep track of to which process a particular\r
+ stream ID should be posted too.\r
+ */\r
+\r
+/* associate ringbuffer with streamid (using refcounting) */\r
+gs_retval_t ftacallback_add_streamid(struct ringbuf * r, gs_uint32_t streamid);\r
+\r
+/* unassosciate a ringbuffer from a streamid */\r
+\r
+gs_retval_t ftacallback_rm_streamid(struct ringbuf * r, gs_uint32_t streamid);\r
+\r
+/* starts an itteration through all ringbuffers for a particular streamid */\r
+\r
+gs_retval_t ftacallback_start_streamid(gs_int32_t streamid);\r
+\r
+/* returns all the ringbuffer associated with the streamid passed in\r
+ * ftacallback_start_streamid\r
+ */\r
+struct ringbuf * ftacallback_next_streamid(gs_int32_t * state);\r
+\r
+/* set the state for a given streamid and destination process */\r
+\r
+gs_retval_t ftacallback_state_streamid(gs_int32_t streamid,FTAID process, gs_int32_t state);\r
+\r
+/* The third registry is used to keep track of which process is blocked\r
+ on which ringbuf\r
+ */\r
+\r
+/* associate msgid with ringbuf  */\r
+gs_retval_t ftacallback_add_wakeup(FTAID ftaid, struct ringbuf * r);\r
+\r
+/* starts an itteration through all msgids associated with\r
+ a streamid. This also uses data kept in the second\r
+ registry\r
+ */\r
+gs_retval_t ftacallback_start_wakeup(gs_uint32_t streamid);\r
+\r
+/* returns all the msgid blocked on the streamid passed in\r
+ * ftacallback_start_streamid and removes the msgid from\r
+ * the wakeup list\r
+ */\r
+FTAID * ftacallback_next_wakeup();\r
+\r
+\r
+/*\r
+ * the following two functions insert and remove an  instance\r
+ * of an FTA from the active list.\r
+ */\r
+\r
+gs_retval_t ftaexec_insert(struct FTA * after, struct FTA * new);\r
+gs_retval_t ftaexec_remove(struct FTA * id);\r
+\r
+/*\r
+ * FTA's cannot be dynamically installed (since we currently don't\r
+ * have a run-time linker in the card).  however, new parameterized\r
+ * instances of previously installed FTAs can be created.  The FTA\r
+ * template IDs have to defined in an include file.  the following\r
+ * call will result in a call to the FTA's alloc_fta function.\r
+ */\r
+\r
+struct FTA * ftaexec_alloc_instance(gs_uint32_t index, struct FTA * reuse,\r
+                                    gs_uint32_t reusable,\r
+                                    gs_int32_t command, gs_int32_t sz, void *  data);\r
+\r
+\r
+/*\r
+ * the next two functions result in callouts to the corresponding FTA\r
+ * functions (fta_free, control_fta).\r
+ */\r
+\r
+gs_retval_t ftaexec_free_instance(struct FTA * FTA_id, gs_uint32_t recursive);\r
+\r
+gs_retval_t ftaexec_control(struct FTA * FTA_id, gs_int32_t command, gs_int32_t sz, void * value);\r
+\r
+gs_retval_t ftaexec_process_control(gs_int32_t command, gs_int32_t sz, void * value);\r
+\r
+/* Start itteration through list of active FTA */\r
+\r
+gs_retval_t ftaexec_start();\r
+\r
+/* get one FTA at a time */\r
+\r
+struct FTA * ftaexec_next();\r
+\r
+\r
+/* HFTA internal print function*/\r
+\r
+gs_retval_t add_printfunction_to_stream(struct FTA * ftaid, gs_sp_t schema, gs_sp_t path, gs_sp_t basename,\r
+                                        gs_sp_t temporal_field, gs_sp_t split_field, gs_uint32_t delta, gs_uint32_t split);\r
+\r
+gs_retval_t print_stream(struct FTA * self, gs_int32_t sz, void *tuple);\r
+\r
+\r
+#endif\r