.. _program_listing_file_src_io_OutputManager.hpp: Program Listing for File OutputManager.hpp ========================================== |exhale_lsh| :ref:`Return to documentation for file ` (``src/io/OutputManager.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #ifndef OUTPUTMANAGER_HPP #define OUTPUTMANAGER_HPP #include "SimControls.hpp" #include #include #include namespace core { class Cluster; class Galaxy; } // namespace core namespace io { class OutputManager { public: explicit OutputManager(const SimControls& simControls); virtual ~OutputManager() = default; // Disallow copying and moving: subclasses represent exclusive // ownership of on-disk output, so duplicating them makes no sense OutputManager(const OutputManager&) = delete; auto operator=(const OutputManager&) -> OutputManager& = delete; OutputManager(OutputManager&&) = delete; auto operator=(OutputManager&&) -> OutputManager& = delete; virtual void writeCluster(unsigned long trial, const core::Cluster& cluster) = 0; virtual void writeClusterSpec(unsigned long trial, double time, core::Cluster& cluster) = 0; virtual void writeClusterPhot(unsigned long trial, double time, core::Cluster& cluster) = 0; virtual void writeClusterYields(unsigned long trial, double time, core::Cluster& cluster) = 0; virtual void writeGalaxy(unsigned long trial, double time, core::Galaxy& galaxy) = 0; virtual void writeGalaxySpec(unsigned long trial, double time, core::Galaxy& galaxy) = 0; virtual void writeGalaxyPhot(unsigned long trial, double time, core::Galaxy& galaxy) = 0; virtual void writeGalaxyYields(unsigned long trial, double time, core::Galaxy& galaxy) = 0; virtual void writeClusterFeedback(unsigned long trial, double time, core::Cluster& cluster) = 0; virtual void writeGalaxyFeedback(unsigned long trial, double time, core::Galaxy& galaxy) = 0; virtual void checkpoint(unsigned long trialsCompleted) = 0; [[nodiscard]] virtual auto restartTrialsDone() const -> unsigned long = 0; [[nodiscard]] virtual auto restartMaxTrial() const -> unsigned long = 0; virtual void notifyEarlyTermination(unsigned long trialsCompleted) = 0; protected: static auto currentDateAndTime() -> std::pair; static auto currentRngStateString() -> std::string; static auto feedbackRow(core::Cluster& cluster) -> std::array; static auto feedbackRow(core::Galaxy& galaxy) -> std::array; const SimControls& simControls_; }; } // namespace io #endif // OUTPUTMANAGER_HPP