Molecular Dynamics Simulation  1.0
FrameWriterInterceptor.h
Go to the documentation of this file.
1 #pragma once
2 #include <chrono>
3 
7 
9  public:
14 
19  void onSimulationStart(Simulation& simulation) override;
20 
28  void operator()(size_t iteration, Simulation& simulation) override;
29 
36  void onSimulationEnd(size_t iteration, Simulation& simulation) override;
37 
46  explicit operator std::string() const override;
47 
51  void logSummary(int depth) const override;
52 
53  private:
54  size_t file_counter = 0;
55  std::unique_ptr<FileOutputHandler> file_output_handler;
57  size_t fps;
58  size_t video_length;
59 };
OutputFormat
Enum class to specify the output format.
Definition: OutputFormats.h:9
FrameWriterInterceptor(OutputFormat output_format, int fps, int video_length)
Construct a new Save File Interceptor object.
void onSimulationStart(Simulation &simulation) override
This function saves the initial state of the simulation.
void onSimulationEnd(size_t iteration, Simulation &simulation) override
This function saves the final state of the simulation.
void operator()(size_t iteration, Simulation &simulation) override
This function is called on every nth iteration. It writes the current state of the simulation to a fi...
std::unique_ptr< FileOutputHandler > file_output_handler
void logSummary(int depth) const override
Logs the summary of the thermostat.
Class to run a simulation.
Definition: Simulation.h:20