|
TECA
The Toolkit for Extreme Climate Analysis
|
1 #ifndef teca_cf_time_axis_data_h
2 #define teca_cf_time_axis_data_h
4 #include "teca_dataset.h"
6 #include "teca_metadata.h"
20 TECA_DATASET_NEW_INSTANCE()
21 TECA_DATASET_NEW_COPY()
25 using elem_t = std::pair<p_teca_variant_array, teca_metadata>;
29 void transfer(
unsigned long file_id, elem_t &&data);
32 elem_t &get(
unsigned long file_id);
33 const elem_t &get(
unsigned long file_id)
const;
38 {
return elem.second; }
42 {
return elem.second; }
47 {
return elem.first; }
51 {
return elem.first; }
54 void append(
const const_p_teca_dataset &other);
55 void shallow_append(
const const_p_teca_dataset &other);
58 std::string get_class_name()
const override
59 {
return "teca_cf_time_axis_data"; }
62 int get_type_code()
const override;
66 explicit operator bool()
const noexcept
67 {
return !this->empty(); }
70 bool empty()
const noexcept
override;
78 int to_stream(std::ostream &)
const override;
79 int from_stream(std::istream &)
override;
83 void copy(
const const_p_teca_dataset &other)
override;
86 void copy(
const const_p_teca_cf_time_axis_data &other,
87 unsigned long first_row,
unsigned long last_row);
89 void shallow_copy(
const p_teca_dataset &other)
override;
92 void swap(
const p_teca_dataset &other)
override;
102 using internals_t = std::map<unsigned long, elem_t>;
103 internals_t *internals;
Serialize objects into a binary stream.
Definition: teca_binary_stream.h:15
Interface for TECA datasets.
Definition: teca_dataset.h:216
A dataset used to read NetCDF CF2 time and metadata in parallel.
Definition: teca_cf_time_axis_data.h:16
std::shared_ptr< const teca_variant_array > const_p_teca_variant_array
Definition: teca_variant_array.h:22
std::shared_ptr< teca_variant_array > p_teca_variant_array
Definition: teca_variant_array.h:22
bool append(teca_variant_array *varr, PyObject *obj)
Append values from the object to the variant array.
Definition: teca_py_array.h:213
bool copy(teca_variant_array *varr, PyObject *obj)
Copy values from the object into variant array.
Definition: teca_py_array.h:270