TECA
teca_dataset_source.h
1 #ifndef teca_dataset_source_h
2 #define teca_dataset_source_h
3 
4 #include "teca_algorithm.h"
5 #include "teca_metadata.h"
6 #include "teca_dataset_fwd.h"
7 #include "teca_shared_object.h"
8 
9 #include <vector>
10 
11 TECA_SHARED_OBJECT_FORWARD_DECL(teca_dataset_source)
12 
13 
19 {
20 public:
21  TECA_ALGORITHM_STATIC_NEW(teca_dataset_source)
22  TECA_ALGORITHM_DELETE_COPY_ASSIGN(teca_dataset_source)
23  TECA_ALGORITHM_CLASS_NAME(teca_dataset_source)
25 
26  // report/initialize to/from Boost program options
27  // objects.
28  TECA_GET_ALGORITHM_PROPERTIES_DESCRIPTION()
29  TECA_SET_ALGORITHM_PROPERTIES()
30 
31  // set/get the dataset to insert into the pipeline
32  TECA_ALGORITHM_VECTOR_PROPERTY(p_teca_dataset, dataset)
33 
34  void set_dataset(const p_teca_dataset &ds)
35  { this->set_datasets({ds}); }
36 
37  // set/get the metadata to insert into the pipeline
38  TECA_ALGORITHM_PROPERTY(teca_metadata, metadata)
39 
40 protected:
42 
43 private:
44  teca_metadata get_output_metadata(unsigned int port,
45  const std::vector<teca_metadata> &input_md) override;
46 
47  const_p_teca_dataset execute(unsigned int port,
48  const std::vector<const_p_teca_dataset> &input_data,
49  const teca_metadata &request) override;
50 
51 private:
52  std::vector<p_teca_dataset> datasets;
53  teca_metadata metadata;
54 };
55 
56 #endif
teca_metadata
Definition: teca_metadata.h:17
teca_dataset_source
Definition: teca_dataset_source.h:19
teca_algorithm
Definition: teca_algorithm.h:25