1 #ifndef teca_cf_layout_manager_h
2 #define teca_cf_layout_manager_h
4 #include "teca_config.h"
5 #include "teca_metadata.h"
7 #include "teca_array_collection.h"
17 using p_teca_cf_layout_manager = std::shared_ptr<teca_cf_layout_manager>;
27 static p_teca_cf_layout_manager New(MPI_Comm comm,
28 long file_id,
long first_index,
long n_indices)
30 return p_teca_cf_layout_manager(
32 first_index, n_indices));
36 int create(
const std::string &file_name,
const std::string &date_format,
37 const teca_metadata &md_in,
int mode_flags,
int use_unlimited_dim);
44 const std::vector<std::string> &point_arrays,
45 const std::vector<std::string> &info_arrays,
int compression_level);
50 const const_p_teca_array_collection &point_arrays,
51 const const_p_teca_array_collection &info_arrays);
54 int close() {
return this->handle.close(); }
57 bool opened() {
return bool(this->handle); }
60 bool defined() {
return this->n_dims > 0; }
66 return this->n_written == this->n_indices;
73 int to_stream(std::ostream &os);
77 first_index(-1), n_indices(-1), n_written(0), n_dims(0),
82 long fid,
long first_id,
long n_ids) : comm(fcomm), file_id(fid),
83 first_index(first_id), n_indices(n_ids), n_written(0), n_dims(0),
99 std::string file_name;
110 int use_unlimited_dim;
116 var_def_t() : var_id(0), type_code(0), active_dims{0,0,0,0} {}
118 var_def_t(
int aid,
unsigned int atc,
const std::array<int,4> &ada) :
119 var_id(aid), type_code(atc), active_dims(ada) {}
122 var_id(aid), type_code(atc), active_dims{0,0,0,0} {}
125 unsigned int type_code;
126 std::array<int,4> active_dims;
129 std::map<std::string, var_def_t> var_def;
130 std::string t_variable;