1 #ifndef teca_programmable_reduce_h
2 #define teca_programmable_reduce_h
4 #include "teca_dataset.h"
5 #include "teca_metadata.h"
7 #include "teca_programmable_algorithm.h"
8 #include "teca_index_reduce.h"
17 typedef void* reduce_callback_t;
18 typedef void* finalize_callback_t;
21 using reduce_callback_t = std::function<p_teca_dataset(
22 const const_p_teca_dataset &,
const const_p_teca_dataset &)>;
25 using finalize_callback_t = std::function<p_teca_dataset(
26 const const_p_teca_dataset &)>;
46 int set_name(
const std::string &name);
49 {
return this->class_name; }
59 TECA_ALGORITHM_CALLBACK_PROPERTY(report_callback_t, report_callback)
69 TECA_ALGORITHM_CALLBACK_PROPERTY(request_callback_t, request_callback)
79 TECA_ALGORITHM_CALLBACK_PROPERTY(reduce_callback_t, reduce_callback)
88 TECA_ALGORITHM_CALLBACK_PROPERTY(finalize_callback_t, finalize_callback)
94 p_teca_dataset reduce(const const_p_teca_dataset &
left,
95 const const_p_teca_dataset &right) override;
97 p_teca_dataset finalize(const const_p_teca_dataset &input) override;
100 unsigned int port, const std::vector<
teca_metadata> &input_md,
107 reduce_callback_t reduce_callback;
108 finalize_callback_t finalize_callback;
109 request_callback_t request_callback;
110 report_callback_t report_callback;