1 #ifndef teca_programmable_algorithm_h
2 #define teca_programmable_algorithm_h
4 #include "teca_config.h"
5 #include "teca_algorithm.h"
7 #include "teca_metadata.h"
8 #include "teca_dataset.h"
14 typedef void* report_callback_t;
15 typedef void* request_callback_t;
16 typedef void* execute_callback_t;
17 typedef void* threaded_execute_callback_t;
21 unsigned int,
const std::vector<teca_metadata>&)>;
24 using request_callback_t = std::function<std::vector<teca_metadata>(
25 unsigned int,
const std::vector<teca_metadata> &,
29 using execute_callback_t = std::function<const_p_teca_dataset(
30 unsigned int,
const std::vector<const_p_teca_dataset> &,
34 using threaded_execute_callback_t = std::function<const_p_teca_dataset(
35 unsigned int,
const std::vector<const_p_teca_dataset> &,
94 virtual int set_name(
const std::string &name);
97 {
return this->class_name; }
104 void use_default_report_action();
105 void use_default_request_action();
106 void use_default_execute_action();
116 TECA_ALGORITHM_CALLBACK_PROPERTY(
117 report_callback_t, report_callback)
129 TECA_ALGORITHM_CALLBACK_PROPERTY(
130 request_callback_t, request_callback)
141 TECA_ALGORITHM_CALLBACK_PROPERTY(
142 execute_callback_t, execute_callback)
152 const std::vector<teca_metadata> &input_md)
override;
156 const std::vector<teca_metadata> &input_md,
161 const std::vector<const_p_teca_dataset> &input_data,
165 report_callback_t report_callback;
166 request_callback_t request_callback;
167 execute_callback_t execute_callback;