HepMC3 event record library: ReaderGZ< T > Class Template Reference

HepMC3 event record library

Public Member Functions | Protected Attributes | Private Attributes
ReaderGZ< T > Class Template Reference

## Detailed Description

template<class T>
class HepMC3::ReaderGZ< T >

GenEvent I/O parsing for compressed files.

Examples
  convert_example.cc.

Definition at line 27 of file ReaderGZ.h.

`#include <ReaderGZ.h>`

Inheritance diagram for ReaderGZ< T >:
[legend]
Collaboration diagram for ReaderGZ< T >:
[legend]

## Public Member Functions
| ReaderGZ (const std::string &filename)
| Constructor.
| ReaderGZ (std::istream &is)
| The ctor to read from stdin.
| ReaderGZ (std::shared_ptr< std::istream > s_stream)
| The ctor to read from shared pointer to stream.
| ~ReaderGZ ()
| Destructor.
bool | skip (const int i) override
| skip events
bool | read_event (GenEvent &evt) override
| Load event from file.
bool | failed () override
| Return status of the stream.
void | close () override
| Close file stream.
void | set_run_info (std::shared_ptr< GenRunInfo > run) override
| Set the act reader's GenRunInfo object.
std::shared_ptr< GenRunInfo > | run_info () const override
| Get the act reader's GenRunInfo object.
std::shared_ptr< Reader > | writer ()
| Return reader.
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.

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

## Private Attributes
std::shared_ptr< std::istream > | m_zstr = nullptr
| Close file stream.
std::shared_ptr< Reader > | m_reader = nullptr
| Actual reader.
std::shared_ptr< GenRunInfo > | m_run_info
| The global GenRunInfo object.

## Constructor & Destructor Documentation

## ◆ ReaderGZ() [1/3]

template<class T>

ReaderGZ | ( | const std::string & | filename | ) |
| inline

Constructor.

Definition at line 31 of file ReaderGZ.h.

References m_reader, and m_zstr.

## ◆ ReaderGZ() [2/3]

template<class T>

ReaderGZ | ( | std::istream & | is | ) |
| inline

The ctor to read from stdin.

Definition at line 36 of file ReaderGZ.h.

References m_reader, and m_zstr.

## ◆ ReaderGZ() [3/3]

template<class T>

ReaderGZ | ( | std::shared_ptr< std::istream > | s_stream | ) |
| inline

The ctor to read from shared pointer to stream.

Definition at line 41 of file ReaderGZ.h.

References m_reader, and m_zstr.

## ◆ ~ReaderGZ()

template<class T>

~ReaderGZ | ( |  | ) |
| inline

Destructor.

Definition at line 47 of file ReaderGZ.h.

References close().

## Member Function Documentation

## ◆ close()

template<class T>

void close | ( |  | ) |
| inlineoverridevirtual

Close file stream.

Implements Reader.

Definition at line 63 of file ReaderGZ.h.

References m_reader, and m_zstr.

## ◆ failed()

template<class T>

bool failed | ( |  | ) |
| inlineoverridevirtual

Return status of the stream.

Implements Reader.

Definition at line 59 of file ReaderGZ.h.

References m_reader.

## ◆ get_options()

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

Get options.

Reimplemented in ReaderPlugin.

Definition at line 53 of file Reader.h.

References m_options.

## ◆ read_event()

template<class T>

bool read_event | ( | GenEvent & | evt | ) |
| inlineoverridevirtual

Load event from file.

Parameters

  [out] | evt | Event to be filled

Implements Reader.

Definition at line 55 of file ReaderGZ.h.

References m_reader.

## ◆ run_info()

template<class T>

std::shared_ptr< GenRunInfo > run_info | ( |  | ) | const
| inlineoverridevirtual

Get the act reader's GenRunInfo object.

Reimplemented from Reader.

Definition at line 72 of file ReaderGZ.h.

References m_reader.

## ◆ set_options()

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

Set options.

Reimplemented in ReaderPlugin.

Definition at line 51 of file Reader.h.

References m_options.

## ◆ set_run_info()

template<class T>

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

Set the act reader's GenRunInfo object.

Reimplemented from Reader.

Definition at line 69 of file ReaderGZ.h.

References m_reader.

## ◆ skip()

template<class T>

bool skip | ( | const int | i | ) |
| inlineoverridevirtual

skip events

Reimplemented from Reader.

Definition at line 50 of file ReaderGZ.h.

References m_reader.

## ◆ writer()

template<class T>

std::shared_ptr< Reader > writer | ( |  | ) |
| inline

Return reader.

Definition at line 75 of file ReaderGZ.h.

References m_reader.

## Field Documentation

## ◆ m_options

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

Options.

Definition at line 60 of file Reader.h.

## ◆ m_reader

template<class T>

std::shared_ptr<Reader> m_reader = nullptr
| private

Actual reader.

Definition at line 80 of file ReaderGZ.h.

## ◆ m_run_info

std::shared_ptr<GenRunInfo> m_run_info
| privateinherited

The global GenRunInfo object.

Definition at line 63 of file Reader.h.

## ◆ m_zstr

template<class T>

std::shared_ptr< std::istream > m_zstr = nullptr
| private

Close file stream.

Stream to read

Definition at line 79 of file ReaderGZ.h.

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

- ReaderGZ.h