12 #include <boost/filesystem.hpp> 14 #include <corsika/output/BaseOutput.hpp> 15 #include <corsika/output/YAMLStreamer.hpp> 27 enum class OutputState {
42 std::string
const& input_args, boost::filesystem::path
const& dir);
49 template <
typename TOutput>
50 void add(std::string
const& name, TOutput& output);
70 void writeConfig()
const;
75 void writeSummary()
const;
107 boost::filesystem::path root_;
108 OutputState state_{OutputState::NoInit};
109 std::string
const name_;
110 std::string
const cmnd_line_args_;
113 std::chrono::time_point<std::chrono::system_clock>
const start_time{
114 std::chrono::system_clock::now()};
115 inline static auto logger_{
get_logger(
"output")};
119 std::map<std::string, std::reference_wrapper<BaseOutput>> outputs_;
125 #include <corsika/detail/output/OutputManager.inl> YAML::Node getConfig() const
Produces the config YAML.
OutputManager(std::string const &name, const long &vseed, std::string const &input_args, boost::filesystem::path const &dir)
Construct an OutputManager instance with a name in a given directory.
~OutputManager()
Handle graceful closure of the outputs upon destruction.
This class automates the construction of simple tabular YAML files using the YAML::StreamWriter.
std::shared_ptr< spdlog::logger > get_logger(std::string const &name, bool const defaultlog=false)
Get a smart pointer to an existing logger.
int getEventId() const
Return current event number.
void startOfShower()
Called at the start of each event/shower.
CORSIKA8 logging utilities.
`, since they are used everywhere as integral part of the framework.
YAML::Node getSummary() const
Produces the summary YAML.
void endOfLibrary()
Called at the end of each library.
void endOfShower()
Called at the end of each event/shower.
void startOfLibrary()
Called at the start of each library.