HepMC3 event record library: Reader Class Reference

HepMC3 event record library

Public Member Functions | Protected Attributes | Private Attributes
Reader Class Referenceabstract

## Detailed Description

Base class for all I/O readers.

Definition at line 25 of file Reader.h.

`#include <Reader.h>`

Inheritance diagram for Reader:
[legend]
Collaboration diagram for Reader:
[legend]

## Public Member Functions
| Reader ()
| Constructor.
virtual | ~Reader ()
| Virtual destructor.
virtual bool | skip (const int)
| skip or fast forward reading of some events
virtual bool | read_event (GenEvent &evt)=0
| Fill next event from input into evt.
virtual bool | failed ()=0
| Get file and/or stream error state.
virtual void | close ()=0
| Close file and/or stream.
virtual std::shared_ptr< GenRunInfo > | run_info () const
| Get the global GenRunInfo object.
| Reader (const Reader &)=delete
| deleted copy constructor
Reader & | operator= (const Reader &)=delete
| deleted copy assignment operator
virtual void | set_options (const std::map< std::string, std::string > &options)
| Set options.
virtual std::map< std::string, std::string > | get_options () const
| Get options.
virtual void | set_run_info (std::shared_ptr< GenRunInfo > run)
| Set the global GenRunInfo object.

## Protected Attributes
std::map< std::string, std::string > | m_options
| Options.

## Private Attributes
std::shared_ptr< GenRunInfo > | m_run_info
| The global GenRunInfo object.

## Constructor & Destructor Documentation

## ◆ Reader() [1/2]

Reader | ( |  | ) |
| inline

Constructor.

Definition at line 28 of file Reader.h.

## ◆ ~Reader()

virtual ~Reader | ( |  | ) |
| inlinevirtual

Virtual destructor.

Definition at line 31 of file Reader.h.

## ◆ Reader() [2/2]

Reader | ( | const Reader & |  | ) |
| delete

deleted copy constructor

References Reader().

## Member Function Documentation

## ◆ close()

virtual void close | ( |  | ) |
| pure virtual

Close file and/or stream.

Implemented in ReaderAscii, ReaderAsciiHepMC2, ReaderGZ< T >, ReaderHEPEVT, ReaderLHEF, ReaderMT< T, m_number_of_threads >, ReaderPlugin, Readerprotobuf, ReaderRoot, and ReaderRootTree.

## ◆ failed()

virtual bool failed | ( |  | ) |
| pure virtual

Get file and/or stream error state.

Implemented in ReaderAscii, ReaderAsciiHepMC2, ReaderGZ< T >, ReaderHEPEVT, ReaderLHEF, ReaderMT< T, m_number_of_threads >, ReaderPlugin, Readerprotobuf, ReaderRoot, and ReaderRootTree.

## ◆ get_options()

virtual std::map< std::string, std::string > get_options | ( |  | ) | const
| inlinevirtual

Get options.

Reimplemented in ReaderPlugin.

Definition at line 53 of file Reader.h.

References m_options.

## ◆ operator=()

Reader & operator= | ( | const Reader & |  | ) |
| delete

deleted copy assignment operator

References Reader().

## ◆ read_event()

virtual bool read_event | ( | GenEvent & | evt | ) |
| pure virtual

Fill next event from input into evt.

Implemented in ReaderAscii, ReaderAsciiHepMC2, ReaderGZ< T >, ReaderHEPEVT, ReaderLHEF, ReaderMT< T, m_number_of_threads >, ReaderPlugin, Readerprotobuf, ReaderRoot, and ReaderRootTree.

## ◆ run_info()

virtual std::shared_ptr< GenRunInfo > run_info | ( |  | ) | const
| inlinevirtual

Get the global GenRunInfo object.

Reimplemented in ReaderGZ< T >, and ReaderPlugin.

Examples
  LHEF_example_cat.cc.

Definition at line 44 of file Reader.h.

References m_run_info.

## ◆ set_options()

virtual void set_options | ( | const std::map< std::string, std::string > & | options | ) |
| inlinevirtual

Set options.

Reimplemented in ReaderPlugin.

Definition at line 51 of file Reader.h.

References m_options.

## ◆ set_run_info()

virtual void set_run_info | ( | std::shared_ptr< GenRunInfo > | run | ) |
| inlinevirtual

Set the global GenRunInfo object.

Reimplemented in ReaderGZ< T >, and ReaderPlugin.

Definition at line 56 of file Reader.h.

References m_run_info.

## ◆ skip()

virtual bool skip | ( | const int |  | ) |
| inlinevirtual

skip or fast forward reading of some events

Reimplemented in ReaderAscii, ReaderAsciiHepMC2, ReaderGZ< T >, ReaderHEPEVT, ReaderLHEF, ReaderMT< T, m_number_of_threads >, ReaderPlugin, Readerprotobuf, ReaderRoot, and ReaderRootTree.

Definition at line 34 of file Reader.h.

References failed().

## Field Documentation

## ◆ m_options

std::map<std::string, std::string> m_options
| protected

Options.

Definition at line 60 of file Reader.h.

## ◆ m_run_info

std::shared_ptr<GenRunInfo> m_run_info
| private

The global GenRunInfo object.

Definition at line 63 of file Reader.h.

The documentation for this class was generated from the following file:

- Reader.h