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; }
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"; }
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:17
A dataset used to read NetCDF CF2 time and metadata in parallel.
Definition: teca_cf_time_axis_data.h:22
std::string get_class_name() const override
return a unique string identifier
Definition: teca_cf_time_axis_data.h:68
int get_type_code() const override
return an integer identifier uniquely naming the dataset type
bool empty() const noexcept override
return true if the dataset is empty.
void append(const const_p_teca_dataset &other)
append the data from the other instance
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
static const teca_metadata & get_metadata(const elem_t &elem)
given an element extract metadata
Definition: teca_cf_time_axis_data.h:48
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
Interface for TECA datasets.
Definition: teca_dataset.h:232
virtual teca_metadata & get_metadata() noexcept
get the dataset metadata
p_teca_error_handler error_handler TECA_EXPORT
The global error handler instance.
TECA_EXPORT bool copy(teca_variant_array *varr, PyObject *obj)
Copy values from the object into variant array.
Definition: teca_py_array.h:290
auto data(V &&... args)
Definition: teca_variant_array_util.h:255
std::shared_ptr< teca_variant_array > p_teca_variant_array
Definition: teca_variant_array.h:27
std::shared_ptr< const teca_variant_array > const_p_teca_variant_array
Definition: teca_variant_array.h:27