|
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_config.h"
5 #include "teca_dataset.h"
7 #include "teca_metadata.h"
25 TECA_DATASET_NEW_INSTANCE()
26 TECA_DATASET_NEW_COPY()
35 void transfer(
unsigned long file_id, elem_t &&data);
38 elem_t &get(
unsigned long file_id);
39 const elem_t &get(
unsigned long file_id) const;
44 {
return elem.second; }
49 {
return elem.second; }
51 using teca_dataset::get_metadata;
56 {
return elem.first; }
61 {
return elem.first; }
64 void append(
const const_p_teca_dataset &other);
65 void shallow_append(
const const_p_teca_dataset &other);
69 {
return "teca_cf_time_axis_data"; }
72 int get_type_code()
const override;
75 explicit operator bool() const noexcept
76 {
return !this->empty(); }
79 bool empty() const noexcept override;
86 int to_stream(std::ostream &) const override;
87 int from_stream(std::istream &) override;
90 void copy(const const_p_teca_dataset &other,
91 allocator alloc = allocator::malloc) override;
94 void shallow_copy(const p_teca_dataset &other) override;
97 void swap(const p_teca_dataset &other) override;
113 using internals_t = std::map<unsigned long, elem_t>;
114 internals_t *internals;
Serialize objects into a binary stream.
Definition: teca_binary_stream.h:16
Interface for TECA datasets.
Definition: teca_dataset.h:231
A dataset used to read NetCDF CF2 time and metadata in parallel.
Definition: teca_cf_time_axis_data.h:21
static const_p_teca_variant_array get_variant_array(const elem_t &elem)
given an element extract the time axis
Definition: teca_cf_time_axis_data.h:60
std::shared_ptr< const teca_variant_array > const_p_teca_variant_array
Definition: teca_variant_array.h:27
std::string get_class_name() const override
return a unique string identifier
Definition: teca_cf_time_axis_data.h:68
static const teca_metadata & get_metadata(const elem_t &elem)
given an element extract metadata
Definition: teca_cf_time_axis_data.h:48
TECA_EXPORT bool copy(teca_variant_array *varr, PyObject *obj)
Copy values from the object into variant array.
Definition: teca_py_array.h:290
std::shared_ptr< teca_variant_array > p_teca_variant_array
Definition: teca_variant_array.h:27
p_teca_error_handler error_handler TECA_EXPORT
The global error handler instance.
TECA_EXPORT bool append(teca_variant_array *varr, PyObject *obj)
Append values from the object to the variant array.
Definition: teca_py_array.h:221
static p_teca_variant_array get_variant_array(elem_t &elem)
given an element extract the time axis
Definition: teca_cf_time_axis_data.h:55