// // population_load_saver.hpp // mc_electron // // Created by Christian Reiling on 11.06.19. // Copyright © 2019 Christian Reiling. All rights reserved. // #ifndef population_load_saver_hpp #define population_load_saver_hpp #include "population_builder.hpp" class Population_Load_Saver { Population_Manager *populations; Timer *timer; public: Population_Load_Saver() {}; Population_Load_Saver(Population_Manager *populations, Timer *timer) { this->populations = populations; this->timer = timer; } void save(); private: std::string get_save_path(); void write_overhead(std::ofstream *save_stream); void write_species(std::ofstream *save_stream, species this_species); int calc_number_pops(); public: void load(); private: void goto_nextline(std::ifstream *load_stream); int get_num_populations_line(std::ifstream *load_stream); double get_offset_time_line(std::ifstream *load_stream); void check_katrin_geo_line(std::ifstream *load_stream); void check_katrin_T2_line(std::ifstream *load_stream); species get_species_line(std::ifstream *load_stream); void append_check_vector(std::vector *check_vector, species add_species); void load_species(std::ifstream *load_stream, species add_species); }; #endif /* population_load_saver_hpp */