HepMC3 event record library: ReaderPlugin Class Reference

HepMC3 event record library

Public Member Functions | Protected Attributes | Private Attributes
ReaderPlugin Class Reference

## Detailed Description

GenEvent I/O parsing and serialization using external plugin.

Definition at line 23 of file ReaderPlugin.h.

`#include <ReaderPlugin.h>`

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

## Public Member Functions
| ReaderPlugin (std::shared_ptr< std::istream > stream, const std::string &libname, const std::string &newreader)
| Constructor to read from stream.
| ReaderPlugin (std::istream &stream, const std::string &libname, const std::string &newreader)
| Constructor to read from stream.
| ReaderPlugin (const std::string &filename, const std::string &libname, const std::string &newreader)
| Constructor to read from file.
bool | skip (const int n) override
| Skip or fast forward reading of some events.
bool | read_event (GenEvent &ev) override
| Reading event.
void | close () override
| Close.
bool | failed () override
| State.
std::shared_ptr< GenRunInfo > | run_info () const override
| Get the global GenRunInfo object.
void | set_options (const std::map< std::string, std::string > &options) override
| Set options.
std::map< std::string, std::string > | get_options () const override
| Get options.
| ~ReaderPlugin () override
| Destructor.
void | set_run_info (std::shared_ptr< GenRunInfo > run) override
| Set the global GenRunInfo object.

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

## Private Attributes
Reader * | m_reader = nullptr
| The actual reader.
void * | dll_handle = nullptr
| library handler
std::shared_ptr< GenRunInfo > | m_run_info
| The global GenRunInfo object.

## Constructor & Destructor Documentation

## ◆ ReaderPlugin() [1/3]

ReaderPlugin | ( | std::shared_ptr< std::istream > | stream,
|  | const std::string & | libname,
|  | const std::string & | newreader )

Constructor to read from stream.

Definition at line 27 of file ReaderPlugin.cc.

References dll_handle, m_reader, and Reader::Reader().

## ◆ ReaderPlugin() [2/3]

ReaderPlugin | ( | std::istream & | stream,
|  | const std::string & | libname,
|  | const std::string & | newreader )

Constructor to read from stream.

Definition at line 47 of file ReaderPlugin.cc.

References dll_handle, m_reader, and Reader::Reader().

## ◆ ReaderPlugin() [3/3]

ReaderPlugin | ( | const std::string & | filename,
|  | const std::string & | libname,
|  | const std::string & | newreader )

Constructor to read from file.

Constructor.

Definition at line 67 of file ReaderPlugin.cc.

References dll_handle, m_reader, and Reader::Reader().

## ◆ ~ReaderPlugin()

~ReaderPlugin | ( |  | ) |
| override

Destructor.

Definition at line 86 of file ReaderPlugin.cc.

References dll_handle, and m_reader.

## Member Function Documentation

## ◆ close()

void close | ( |  | ) |
| inlineoverridevirtual

Close.

Implements Reader.

Definition at line 37 of file ReaderPlugin.h.

References m_reader.

## ◆ failed()

bool failed | ( |  | ) |
| inlineoverridevirtual

State.

Implements Reader.

Definition at line 39 of file ReaderPlugin.h.

References m_reader.

## ◆ get_options()

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

Get options.

Reimplemented from Reader.

Definition at line 45 of file ReaderPlugin.h.

References m_reader.

## ◆ read_event()

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

Reading event.

Implements Reader.

Definition at line 35 of file ReaderPlugin.h.

References m_reader.

## ◆ run_info()

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

Get the global GenRunInfo object.

Reimplemented from Reader.

Definition at line 41 of file ReaderPlugin.h.

References m_reader.

## ◆ set_options()

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

Set options.

Reimplemented from Reader.

Definition at line 43 of file ReaderPlugin.h.

References m_reader.

## ◆ set_run_info()

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

Set the global GenRunInfo object.

Reimplemented from Reader.

Definition at line 49 of file ReaderPlugin.h.

References m_reader.

## ◆ skip()

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

Skip or fast forward reading of some events.

Reimplemented from Reader.

Definition at line 33 of file ReaderPlugin.h.

References m_reader.

## Field Documentation

## ◆ dll_handle

void* dll_handle = nullptr
| private

library handler

Definition at line 52 of file ReaderPlugin.h.

## ◆ m_options

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

Options.

Definition at line 60 of file Reader.h.

## ◆ m_reader

Reader* m_reader = nullptr
| private

The actual reader.

Definition at line 51 of file ReaderPlugin.h.

## ◆ m_run_info

std::shared_ptr<GenRunInfo> m_run_info
| privateinherited

The global GenRunInfo object.

Definition at line 63 of file Reader.h.

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

- ReaderPlugin.h
- ReaderPlugin.cc