CORSIKA  @c8_version@
The framework to simulate particle cascades for astroparticle physics
SubWriter.hpp
1 /*
2  * (c) Copyright 2021 CORSIKA Project, corsika-project@lists.kit.edu
3  *
4  * This software is distributed under the terms of the GNU General Public
5  * Licence version 3 (GPL Version 3). See file LICENSE for a full version of
6  * the license.
7  */
8 
9 #pragma once
10 
11 #include <corsika/output/Configurable.hpp>
12 
13 #include <utility>
14 
15 namespace corsika {
16 
17  template <typename TOutput>
18  class SubWriter : public Configurable {
19 
20  TOutput& output_;
21 
22  public:
23  SubWriter(TOutput& output)
24  : output_(output) {}
25 
26  virtual ~SubWriter() {}
27 
28  /*
29  * Write data to the underlying writer.
30  */
31  template <typename... TArgs>
32  void write(TArgs&&... args) {
33  output_.write(std::forward<TArgs>(args)...);
34  }
35 
36  }; // class SubWriter
37 
38 } // namespace corsika
This is the base class for all classes that have YAML representations of their configurations.
`, since they are used everywhere as integral part of the framework.