12 #include <boost/filesystem.hpp> 13 #include <corsika/output/BaseOutput.hpp> 26 enum class OutputState {
33 OutputState state_{OutputState::NoInit};
34 std::string
const name_;
35 boost::filesystem::path
const root_;
37 std::chrono::time_point<std::chrono::system_clock>
const start_time{
38 std::chrono::system_clock::now()};
39 inline static auto logger{
get_logger(
"output")};
43 std::map<std::string, std::reference_wrapper<BaseOutput>> outputs_;
48 void writeNode(YAML::Node
const& node, boost::filesystem::path
const& path)
const;
53 void writeTopLevelConfig()
const;
58 void initOutput(std::string
const& name)
const;
63 void writeTopLevelSummary()
const;
72 OutputManager(std::string
const& name, boost::filesystem::path
const& dir);
86 template <
typename TOutput>
87 void add(std::string
const& name, TOutput& output);
118 #include <corsika/detail/output/OutputManager.inl> ~OutputManager()
Handle graceful closure of the outputs upon destruction.
void add(std::string const &name, TOutput &output)
Register an existing output to this manager.
std::shared_ptr< spdlog::logger > get_logger(std::string const &name, bool const defaultlog=false)
Get a smart pointer to an existing logger.
void startOfShower()
Called at the start of each event/shower.
CORSIKA8 logging utilities.
OutputManager(std::string const &name, boost::filesystem::path const &dir)
Construct an OutputManager instance with a name in a given directory.
The cascade namespace assembles all objects needed to simulate full particles cascades.
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.