File indexing completed on 2025-01-18 10:01:14
0001
0002
0003
0004
0005
0006 #ifndef HEPMC3_WRITERPLUGIN_H
0007 #define HEPMC3_WRITERPLUGIN_H
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019 #include "HepMC3/Writer.h"
0020 #include "HepMC3/GenEvent.h"
0021 namespace HepMC3
0022 {
0023 class WriterPlugin : public Writer
0024 {
0025 public:
0026
0027 WriterPlugin(std::shared_ptr<std::ostream> stream, const std::string &libname, const std::string &newwriter, std::shared_ptr<HepMC3::GenRunInfo> run = std::shared_ptr<GenRunInfo>());
0028
0029
0030 WriterPlugin(std::ostream & stream, const std::string &libname, const std::string &newwriter, std::shared_ptr<HepMC3::GenRunInfo> run = std::shared_ptr<GenRunInfo>());
0031
0032
0033 WriterPlugin(const std::string& filename, const std::string &libname, const std::string &newwriter, std::shared_ptr<HepMC3::GenRunInfo> run = std::shared_ptr<GenRunInfo>());
0034
0035
0036 void write_event(const GenEvent& ev) override {if (!m_writer) return; return m_writer->write_event(ev);};
0037
0038 void close() override { if (!m_writer) return; m_writer->close();};
0039
0040 bool failed() override {if (!m_writer) return true; return m_writer->failed();};
0041
0042 std::shared_ptr<GenRunInfo> run_info() const override { return m_writer?m_writer->run_info():nullptr; }
0043
0044 void set_options(const std::map<std::string, std::string>& options) override { if (!m_writer) return; else m_writer->set_options(options); }
0045
0046 std::map<std::string, std::string> get_options() const override { return m_writer?m_writer->get_options(): std::map<std::string, std::string>(); }
0047
0048 void set_run_info(std::shared_ptr<GenRunInfo> run) override { if (!m_writer) return; else m_writer->set_run_info(run); }
0049
0050 ~WriterPlugin() override;
0051 private:
0052 Writer* m_writer = nullptr;
0053 void* dll_handle = nullptr;
0054 };
0055 }
0056 #endif