Fork me on GitHub

source: git/external/HepMC3/Reader.h@ 302624f

Last change on this file since 302624f was 95a917c, checked in by Pavel Demin <pavel.demin@…>, 3 years ago

add HepMC3 library

  • Property mode set to 100644
File size: 1.7 KB
Line 
1// -*- C++ -*-
2//
3// This file is part of HepMC
4// Copyright (C) 2014-2020 The HepMC collaboration (see AUTHORS for details)
5//
6#ifndef HEPMC3_READER_H
7#define HEPMC3_READER_H
8///
9/// @file Reader.h
10/// @brief Definition of interface \b Reader
11///
12/// @class HepMC3::Reader
13/// @brief Base class for all I/O readers
14///
15/// @ingroup IO
16///
17
18#include "HepMC3/GenRunInfo.h"
19
20namespace HepMC3 {
21
22// Forward declaration
23class GenEvent;
24
25class Reader {
26public:
27 ///Constructor
28 Reader() {}
29
30 /// Virtual destructor
31 virtual ~Reader() {}
32
33 /// skip or fast forward reading of some events
34 virtual bool skip(const int) { return !failed();}
35
36 /// Fill next event from input into @a evt
37 virtual bool read_event(GenEvent& evt) = 0;
38 /** @brief Get file and/or stream error state */
39 virtual bool failed()=0;
40 /** @brief Close file and/or stream */
41 virtual void close()=0;
42
43 /// Get the global GenRunInfo object.
44 std::shared_ptr<GenRunInfo> run_info() const {
45 return m_run_info;
46 }
47
48///deleted copy constructor
49 Reader(const Reader&) = delete;
50///deleted copy assignment operator
51 Reader& operator = (const Reader &) = delete;
52 /// Set options
53 void set_options(const std::map<std::string, std::string>& options)
54 {
55 m_options=options;
56 }
57 /// Set options
58 std::map<std::string, std::string> get_options() const
59 {
60 return m_options;
61 }
62protected:
63 /// Set the global GenRunInfo object.
64 void set_run_info(std::shared_ptr<GenRunInfo> run) {
65 m_run_info = run;
66 }
67 /// options
68 std::map<std::string, std::string> m_options;
69private:
70 /// The global GenRunInfo object.
71 std::shared_ptr<GenRunInfo> m_run_info;
72};
73
74
75} // namespace HepMC3
76
77#endif
Note: See TracBrowser for help on using the repository browser.