1 #ifndef teca_programmable_algorithm_h
2 #define teca_programmable_algorithm_h
4 #include "teca_algorithm.h"
6 #include "teca_metadata.h"
7 #include "teca_dataset.h"
13 typedef void* report_callback_t;
14 typedef void* request_callback_t;
15 typedef void* execute_callback_t;
16 typedef void* threaded_execute_callback_t;
20 unsigned int,
const std::vector<teca_metadata>&)>;
23 using request_callback_t = std::function<std::vector<teca_metadata>(
24 unsigned int,
const std::vector<teca_metadata> &,
28 using execute_callback_t = std::function<const_p_teca_dataset(
29 unsigned int,
const std::vector<const_p_teca_dataset> &,
33 using threaded_execute_callback_t = std::function<const_p_teca_dataset(
34 unsigned int,
const std::vector<const_p_teca_dataset> &,
93 virtual int set_name(
const std::string &name);
96 {
return this->class_name; }
103 void use_default_report_action();
104 void use_default_request_action();
105 void use_default_execute_action();
115 TECA_ALGORITHM_CALLBACK_PROPERTY(
116 report_callback_t, report_callback)
128 TECA_ALGORITHM_CALLBACK_PROPERTY(
129 request_callback_t, request_callback)
140 TECA_ALGORITHM_CALLBACK_PROPERTY(
141 execute_callback_t, execute_callback)
149 const std::vector<teca_metadata> &input_md)
override;
151 std::vector<teca_metadata> get_upstream_request(
153 const std::vector<teca_metadata> &input_md,
156 const_p_teca_dataset execute(
158 const std::vector<const_p_teca_dataset> &input_data,
162 report_callback_t report_callback;
163 request_callback_t request_callback;
164 execute_callback_t execute_callback;