TECA
The Toolkit for Extreme Climate Analysis
teca_table_join.h
1 #ifndef teca_table_join_h
2 #define teca_table_join_h
3 
4 #include "teca_shared_object.h"
5 #include "teca_algorithm.h"
6 #include "teca_metadata.h"
7 
8 #include <string>
9 #include <vector>
10 
11 TECA_SHARED_OBJECT_FORWARD_DECL(teca_table_join)
12 
13 /** @brief An algorithm that joins the columns of tables generated on
14  * each of its inputs via a union.
15  * @details One must explicitly set the number of inputs and connect an
16  * upstream pipeline to each. Metadata including array names and attributes
17  * from all inputs are merged into the report. Incoming requests are forwarded
18  * to all inputs with the specific arrays belonging to the other inputs
19  * removed. When two inputs provide the same array, the data is fetched from
20  * the lower input.
21  */
23 {
24 public:
25  TECA_ALGORITHM_STATIC_NEW(teca_table_join)
26  TECA_ALGORITHM_DELETE_COPY_ASSIGN(teca_table_join)
27  TECA_ALGORITHM_CLASS_NAME(teca_table_join)
28  ~teca_table_join();
29 
30  // report/initialize to/from Boost program options
31  // objects.
32  TECA_GET_ALGORITHM_PROPERTIES_DESCRIPTION()
33  TECA_SET_ALGORITHM_PROPERTIES()
34 
35  /** Set the number input connections. The default is 2, this must be called
36  * when more than 2 tables are to be merged.
37  */
38  void set_number_of_input_connections(unsigned int n)
40 
41 protected:
43 
44 private:
46 
47  teca_metadata get_output_metadata(
48  unsigned int port,
49  const std::vector<teca_metadata> &input_md) override;
50 
51  std::vector<teca_metadata> get_upstream_request(
52  unsigned int port,
53  const std::vector<teca_metadata> &input_md,
54  const teca_metadata &request) override;
55 
56  const_p_teca_dataset execute(
57  unsigned int port,
58  const std::vector<const_p_teca_dataset> &input_data,
59  const teca_metadata &request) override;
60 
61 private:
62 };
63 
64 #endif
The interface to TECA pipeline architecture.
Definition: teca_algorithm.h:244
virtual teca_metadata get_output_metadata(unsigned int port, const std::vector< teca_metadata > &input_md)
void set_number_of_input_connections(unsigned int n)
A generic container for meta data in the form of name=value pairs.
Definition: teca_metadata.h:22
An algorithm that joins the columns of tables generated on each of its inputs via a union.
Definition: teca_table_join.h:23
p_teca_error_handler error_handler TECA_EXPORT
The global error handler instance.