Molecular Dynamics Simulation  1.0
FileOutputHandler.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <memory>
4 #include <string>
5 
6 #include "io/output/FileWriter.h"
9 
17  private:
22 
26  std::unique_ptr<FileWriter> file_writer;
27 
28  public:
35  explicit FileOutputHandler(const OutputFormat output_format, const SimulationParams& params);
36 
45  std::optional<const std::filesystem::path> writeFile(size_t iteration,
46  const std::unique_ptr<ParticleContainer>& particle_container) const;
47 
56  std::optional<const std::filesystem::path> writeFile(size_t iteration, const std::vector<Particle>& particles) const;
57 };
OutputFormat
Enum class to specify the output format.
Definition: OutputFormats.h:9
Wrapper class to abstract the writing of output files.
std::optional< const std::filesystem::path > writeFile(size_t iteration, const std::unique_ptr< ParticleContainer > &particle_container) const
Writes the given ParticleContainers particle data to a file.
std::unique_ptr< FileWriter > file_writer
Pointer to the FileWriter object to use.
const SimulationParams & params
SimulationParams object which provides the output directory path.
FileOutputHandler(const OutputFormat output_format, const SimulationParams &params)
Construct a new FileOutputHandler object.
Contains all parameters needed to run a simulation.