// // h5tb_population_meta_interface.hpp // mc_electron // // Created by Christian Reiling on 03.06.19. // Copyright © 2019 Christian Reiling. All rights reserved. // #ifndef h5tb_population_meta_interface_hpp #define h5tb_population_meta_interface_hpp #include "error_types.h" #include "population_base.h" #include "hdf5.h" #include "hdf5_hl.h" struct pop_bin_meta_info { int z_bin; int r_bin; int phi_bin; int E_bin; double z_min_m; double z_max_m; double r_min_m; double r_max_m; double phi_min; double phi_max; double E_min_eV; double E_max_eV; }; class H5TB_Population_Meta_Interface { static const size_t size; static const char *fieldNames[12]; static const size_t offset[12]; static const hid_t fieldTypes[12]; static const hsize_t chunkSize; static const size_t sizes[12]; int buffer_size = 100; pop_bin_meta_info buffer[100]; int buffer_count = 0; std::string table_name; hid_t *loc_id; public: H5TB_Population_Meta_Interface() {}; ~H5TB_Population_Meta_Interface(); H5TB_Population_Meta_Interface(const std::string &table_name, hid_t *loc_id) { this->table_name = table_name; this->loc_id = loc_id; create(); } private: void create(); public: void write(const pop_bin_meta_info &log_meta_bin); void flush(); }; #endif /* h5tb_population_meta_interface_hpp */