1 #ifndef teca_cf_layout_manager_h
2 #define teca_cf_layout_manager_h
4 #include "teca_metadata.h"
6 #include "teca_array_collection.h"
16 using p_teca_cf_layout_manager = std::shared_ptr<teca_cf_layout_manager>;
26 static p_teca_cf_layout_manager New(MPI_Comm comm,
27 long file_id,
long first_index,
long n_indices)
29 return p_teca_cf_layout_manager(
31 first_index, n_indices));
35 int create(
const std::string &file_name,
const std::string &date_format,
36 const teca_metadata &md_in,
int mode_flags,
int use_unlimited_dim);
43 const std::vector<std::string> &point_arrays,
44 const std::vector<std::string> &info_arrays,
int compression_level);
49 const const_p_teca_array_collection &point_arrays,
50 const const_p_teca_array_collection &info_arrays);
53 int close() {
return this->handle.
close(); }
56 bool opened() {
return bool(this->handle); }
59 bool defined() {
return this->n_dims > 0; }
65 return this->n_written == this->n_indices;
72 int to_stream(std::ostream &os);
76 first_index(-1), n_indices(-1), n_written(0), n_dims(0),
81 long fid,
long first_id,
long n_ids) : comm(fcomm), file_id(fid),
82 first_index(first_id), n_indices(n_ids), n_written(0), n_dims(0),
98 std::string file_name;
109 int use_unlimited_dim;
115 var_def_t() : var_id(0), type_code(0), active_dims{0,0,0,0} {}
117 var_def_t(
int aid,
unsigned int atc,
const std::array<int,4> &ada) :
118 var_id(aid), type_code(atc), active_dims(ada) {}
121 var_id(aid), type_code(atc), active_dims{0,0,0,0} {}
124 unsigned int type_code;
125 std::array<int,4> active_dims;
128 std::map<std::string, var_def_t> var_def;
129 std::string t_variable;
130 p_teca_double_array t;