Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
output.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file output.h
1 // TRENTO: Reduced Thickness Event-by-event Nuclear Topology
2 // Copyright 2015 Jonah E. Bernhard, J. Scott Moreland
3 // TRENTO3D: Three-dimensional extension of TRENTO by Weiyao Ke
4 // MIT License
5 
6 #ifndef OUTPUT_H
7 #define OUTPUT_H
8 
9 #include <functional>
10 #include <utility>
11 #include <vector>
12 
13 #include "fwd_decl.h"
14 
15 namespace trento {
16 
19 class Output {
20  public:
22  Output(const VarMap& var_map);
23 
33  template <typename... Args>
34  void operator()(Args&&... args) const;
35 
36  private:
38  std::vector<std::function<void(int, double, const Event&)>> writers_;
39 };
40 
41 template <typename... Args>
42 void Output::operator()(Args&&... args) const {
43  for (const auto& write : writers_)
44  write(std::forward<Args>(args)...);
45 }
46 
47 } // namespace trento
48 
49 #endif // OUTPUT_H