File indexing completed on 2025-01-18 10:01:14
0001
0002
0003
0004
0005
0006 #ifndef HEPMC3_READER_H
0007 #define HEPMC3_READER_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 Reader {
0026 public:
0027
0028 Reader() {}
0029
0030
0031 virtual ~Reader() {}
0032
0033
0034 virtual bool skip(const int) { return !failed();}
0035
0036
0037 virtual bool read_event(GenEvent& evt) = 0;
0038
0039 virtual bool failed()=0;
0040
0041 virtual void close()=0;
0042
0043
0044 virtual std::shared_ptr<GenRunInfo> run_info() const { return m_run_info; }
0045
0046
0047 Reader(const Reader&) = delete;
0048
0049 Reader& operator = (const Reader &) = delete;
0050
0051 virtual void set_options(const std::map<std::string, std::string>& options) { m_options = options; }
0052
0053 virtual std::map<std::string, std::string> get_options() const { return m_options; }
0054
0055
0056 virtual void set_run_info(std::shared_ptr<GenRunInfo> run) { m_run_info = run; }
0057
0058 protected:
0059
0060 std::map<std::string, std::string> m_options;
0061 private:
0062
0063 std::shared_ptr<GenRunInfo> m_run_info;
0064 };
0065
0066
0067 }
0068
0069 #endif