File indexing completed on 2025-01-18 10:01:14
0001
0002
0003
0004
0005
0006 #ifndef HEPMC3_WRITER_H
0007 #define HEPMC3_WRITER_H
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #include "HepMC3/GenRunInfo.h"
0019
0020 namespace HepMC3 {
0021
0022
0023 class GenEvent;
0024
0025 class Writer {
0026 public:
0027
0028
0029 Writer() {}
0030
0031
0032 virtual ~Writer() {}
0033
0034
0035 virtual void write_event(const GenEvent &evt) = 0;
0036
0037 virtual bool failed() = 0;
0038
0039 virtual void close() = 0;
0040
0041
0042 virtual void set_run_info(std::shared_ptr<GenRunInfo> run) { m_run_info = run; }
0043
0044
0045 virtual std::shared_ptr<GenRunInfo> run_info() const { return m_run_info; }
0046
0047
0048 Writer(const Writer&) = delete;
0049
0050 Writer& operator = (const Writer &) = delete;
0051
0052 virtual void set_options(const std::map<std::string, std::string>& options) { m_options = options; }
0053
0054 virtual std::map<std::string, std::string> get_options() const { return m_options; }
0055
0056 protected:
0057
0058
0059 std::map<std::string, std::string> m_options;
0060
0061 private:
0062
0063
0064 std::shared_ptr<GenRunInfo> m_run_info;
0065
0066 };
0067
0068
0069 }
0070
0071 #endif